@@ -24,12 +24,13 @@ use std::sync::Arc;
2424use arrow_avro:: reader:: { Reader , ReaderBuilder } ;
2525use arrow_avro:: schema:: { AvroSchema , SCHEMA_METADATA_KEY } ;
2626use datafusion_common:: error:: Result ;
27- use datafusion_common:: { DataFusionError , Statistics } ;
27+ use datafusion_common:: DataFusionError ;
2828use datafusion_datasource:: file:: FileSource ;
2929use datafusion_datasource:: file_scan_config:: FileScanConfig ;
3030use datafusion_datasource:: file_stream:: FileOpener ;
3131use datafusion_datasource:: schema_adapter:: SchemaAdapterFactory ;
3232use datafusion_datasource:: TableSchema ;
33+ use datafusion_physical_expr_common:: sort_expr:: LexOrdering ;
3334use datafusion_physical_plan:: metrics:: ExecutionPlanMetricsSet ;
3435
3536use object_store:: ObjectStore ;
@@ -40,7 +41,7 @@ use serde_json::Value;
4041pub struct AvroSource {
4142 table_schema : TableSchema ,
4243 batch_size : Option < usize > ,
43- projection : Option < Vec < usize > > ,
44+ projection : Option < Vec < String > > ,
4445 metrics : ExecutionPlanMetricsSet ,
4546 schema_adapter_factory : Option < Arc < dyn SchemaAdapterFactory > > ,
4647}
@@ -181,7 +182,7 @@ impl FileSource for AvroSource {
181182
182183 fn with_projection ( & self , config : & FileScanConfig ) -> Arc < dyn FileSource > {
183184 let mut conf = self . clone ( ) ;
184- conf. projection = config. file_column_projection_indices ( ) ;
185+ conf. projection = config. projected_file_column_names ( ) ;
185186 Arc :: new ( conf)
186187 }
187188
0 commit comments