@@ -70,6 +70,7 @@ impl<'a> Dumper<'a> {
7070 import_op_idx : usize ,
7171 import_op : & ' a AnalyzedImportOp ,
7272 key : & value:: KeyValue ,
73+ key_aux_info : & serde_json:: Value ,
7374 collected_values_buffer : & ' b mut Vec < Vec < value:: FieldValues > > ,
7475 ) -> Result < Option < IndexMap < & ' b str , TargetExportData < ' b > > > >
7576 where
@@ -83,6 +84,7 @@ impl<'a> Dumper<'a> {
8384 key,
8485 import_op_idx,
8586 } ,
87+ key_aux_info,
8688 self . setup_execution_ctx ,
8789 EvaluationMemoryOptions {
8890 enable_cache : self . options . use_cache ,
@@ -134,6 +136,7 @@ impl<'a> Dumper<'a> {
134136 import_op_idx : usize ,
135137 import_op : & AnalyzedImportOp ,
136138 key : value:: KeyValue ,
139+ key_aux_info : serde_json:: Value ,
137140 file_path : PathBuf ,
138141 ) -> Result < ( ) > {
139142 let _permit = import_op
@@ -142,7 +145,13 @@ impl<'a> Dumper<'a> {
142145 . await ?;
143146 let mut collected_values_buffer = Vec :: new ( ) ;
144147 let ( exports, error) = match self
145- . evaluate_source_entry ( import_op_idx, import_op, & key, & mut collected_values_buffer)
148+ . evaluate_source_entry (
149+ import_op_idx,
150+ import_op,
151+ & key,
152+ & key_aux_info,
153+ & mut collected_values_buffer,
154+ )
146155 . await
147156 {
148157 Ok ( exports) => ( exports, None ) ,
@@ -177,7 +186,10 @@ impl<'a> Dumper<'a> {
177186 import_op_idx : usize ,
178187 import_op : & AnalyzedImportOp ,
179188 ) -> Result < ( ) > {
180- let mut keys_by_filename_prefix: IndexMap < String , Vec < value:: KeyValue > > = IndexMap :: new ( ) ;
189+ let mut keys_by_filename_prefix: IndexMap <
190+ String ,
191+ Vec < ( value:: KeyValue , serde_json:: Value ) > ,
192+ > = IndexMap :: new ( ) ;
181193
182194 let mut rows_stream = import_op. executor . list ( & SourceExecutorListOptions {
183195 include_ordinal : false ,
@@ -196,7 +208,10 @@ impl<'a> Dumper<'a> {
196208 . find ( |i| s. is_char_boundary ( * i) )
197209 . unwrap_or ( 0 ) ,
198210 ) ;
199- keys_by_filename_prefix. entry ( s) . or_default ( ) . push ( row. key ) ;
211+ keys_by_filename_prefix
212+ . entry ( s)
213+ . or_default ( )
214+ . push ( ( row. key , row. key_aux_info ) ) ;
200215 }
201216 }
202217 let output_dir = Path :: new ( & self . options . output_dir ) ;
@@ -205,22 +220,25 @@ impl<'a> Dumper<'a> {
205220 . into_iter ( )
206221 . flat_map ( |( filename_prefix, keys) | {
207222 let num_keys = keys. len ( ) ;
208- keys. into_iter ( ) . enumerate ( ) . map ( move |( i, key) | {
209- let extra_id = if num_keys > 1 {
210- Cow :: Owned ( format ! ( ".{i}" ) )
211- } else {
212- Cow :: Borrowed ( "" )
213- } ;
214- let file_name =
215- format ! ( "{}@{}{}.yaml" , import_op. name, filename_prefix, extra_id) ;
216- let file_path = output_dir. join ( Path :: new ( & file_name) ) ;
217- self . evaluate_and_dump_source_entry (
218- import_op_idx,
219- import_op,
220- key,
221- file_path,
222- )
223- } )
223+ keys. into_iter ( )
224+ . enumerate ( )
225+ . map ( move |( i, ( key, key_aux_info) ) | {
226+ let extra_id = if num_keys > 1 {
227+ Cow :: Owned ( format ! ( ".{i}" ) )
228+ } else {
229+ Cow :: Borrowed ( "" )
230+ } ;
231+ let file_name =
232+ format ! ( "{}@{}{}.yaml" , import_op. name, filename_prefix, extra_id) ;
233+ let file_path = output_dir. join ( Path :: new ( & file_name) ) ;
234+ self . evaluate_and_dump_source_entry (
235+ import_op_idx,
236+ import_op,
237+ key,
238+ key_aux_info,
239+ file_path,
240+ )
241+ } )
224242 } ) ;
225243 try_join_all ( evaluate_futs) . await ?;
226244 Ok ( ( ) )
0 commit comments