@@ -40,7 +40,7 @@ use datafusion_datasource::{as_file_source, TableSchema};
4040use arrow:: buffer:: Buffer ;
4141use arrow:: ipc:: reader:: { FileDecoder , FileReader , StreamReader } ;
4242use datafusion_common:: error:: Result ;
43- use datafusion_common:: { exec_datafusion_err, Statistics } ;
43+ use datafusion_common:: exec_datafusion_err;
4444use datafusion_datasource:: file:: FileSource ;
4545use datafusion_datasource:: file_scan_config:: FileScanConfig ;
4646use datafusion_datasource:: projection:: { ProjectionOpener , SplitProjection } ;
@@ -246,14 +246,12 @@ impl FileOpener for ArrowFileOpener {
246246 }
247247}
248248
249-
250249/// `FileSource` for both Arrow IPC file and stream formats
251250#[ derive( Clone ) ]
252251pub struct ArrowSource {
253252 format : ArrowFormat ,
254253 table_schema : TableSchema ,
255254 metrics : ExecutionPlanMetricsSet ,
256- projected_statistics : Option < Statistics > ,
257255 schema_adapter_factory : Option < Arc < dyn SchemaAdapterFactory > > ,
258256 projection : SplitProjection ,
259257}
@@ -265,7 +263,6 @@ impl ArrowSource {
265263 Self {
266264 format : ArrowFormat :: File ,
267265 metrics : ExecutionPlanMetricsSet :: new ( ) ,
268- projected_statistics : None ,
269266 schema_adapter_factory : None ,
270267 projection : SplitProjection :: unprojected ( & table_schema) ,
271268 table_schema,
@@ -278,7 +275,6 @@ impl ArrowSource {
278275 Self {
279276 format : ArrowFormat :: Stream ,
280277 metrics : ExecutionPlanMetricsSet :: new ( ) ,
281- projected_statistics : None ,
282278 schema_adapter_factory : None ,
283279 projection : SplitProjection :: unprojected ( & table_schema) ,
284280 table_schema,
@@ -315,24 +311,10 @@ impl FileSource for ArrowSource {
315311 Arc :: new ( Self { ..self . clone ( ) } )
316312 }
317313
318- fn with_statistics ( & self , statistics : Statistics ) -> Arc < dyn FileSource > {
319- Arc :: new ( Self {
320- projected_statistics : Some ( statistics) ,
321- ..self . clone ( )
322- } )
323- }
324-
325314 fn metrics ( & self ) -> & ExecutionPlanMetricsSet {
326315 & self . metrics
327316 }
328317
329- fn statistics ( & self ) -> Result < Statistics > {
330- Ok ( self
331- . projected_statistics
332- . clone ( )
333- . expect ( "projected_statistics must be set" ) )
334- }
335-
336318 fn file_type ( & self ) -> & str {
337319 match self . format {
338320 ArrowFormat :: File => "arrow" ,
@@ -378,7 +360,9 @@ impl FileSource for ArrowSource {
378360 // Use the default trait implementation logic for file format
379361 use datafusion_datasource:: file_groups:: FileGroupPartitioner ;
380362
381- if config. file_compression_type . is_compressed ( ) || config. new_lines_in_values {
363+ if config. file_compression_type . is_compressed ( )
364+ || config. new_lines_in_values
365+ {
382366 return Ok ( None ) ;
383367 }
384368
@@ -388,7 +372,8 @@ impl FileSource for ArrowSource {
388372 . with_preserve_order_within_groups ( output_ordering. is_some ( ) )
389373 . repartition_file_groups ( & config. file_groups ) ;
390374
391- if let Some ( repartitioned_file_groups) = repartitioned_file_groups_option {
375+ if let Some ( repartitioned_file_groups) = repartitioned_file_groups_option
376+ {
392377 let mut source = config. clone ( ) ;
393378 source. file_groups = repartitioned_file_groups;
394379 return Ok ( Some ( source) ) ;
0 commit comments