@@ -12,23 +12,21 @@ use datafusion::common::{
1212 config_datafusion_err, not_impl_err,
1313} ;
1414use datafusion:: datasource:: file_format:: file_compression_type:: FileCompressionType ;
15- use datafusion:: datasource:: file_format:: { FileFormat , FileFormatFactory , FilePushdownSupport } ;
15+ use datafusion:: datasource:: file_format:: { FileFormat , FileFormatFactory } ;
1616use datafusion:: datasource:: physical_plan:: {
1717 FileScanConfig , FileScanConfigBuilder , FileSinkConfig , FileSource ,
1818} ;
1919use datafusion:: datasource:: sink:: DataSinkExec ;
2020use datafusion:: datasource:: source:: DataSourceExec ;
21- use datafusion:: logical_expr:: Expr ;
2221use datafusion:: logical_expr:: dml:: InsertOp ;
23- use datafusion:: physical_expr:: { LexRequirement , PhysicalExpr } ;
22+ use datafusion:: physical_expr:: LexRequirement ;
2423use datafusion:: physical_plan:: ExecutionPlan ;
2524use futures:: { FutureExt , StreamExt as _, TryStreamExt as _, stream} ;
2625use itertools:: Itertools ;
2726use object_store:: { ObjectMeta , ObjectStore } ;
2827use vortex:: dtype:: DType ;
2928use vortex:: dtype:: arrow:: FromArrowType ;
3029use vortex:: error:: { VortexExpect , VortexResult , vortex_err} ;
31- use vortex:: expr:: { ExprRef , VortexExpr , and} ;
3230use vortex:: file:: VORTEX_FILE_EXTENSION ;
3331use vortex:: metrics:: VortexMetrics ;
3432use vortex:: session:: VortexSession ;
@@ -38,8 +36,8 @@ use vortex::stats::{Stat, StatsProviderExt, StatsSet};
3836use super :: cache:: VortexFileCache ;
3937use super :: sink:: VortexSink ;
4038use super :: source:: VortexSource ;
41- use crate :: convert :: { TryFromDataFusion , TryToDataFusion } ;
42- use crate :: { PrecisionExt as _ , can_be_pushed_down } ;
39+ use crate :: PrecisionExt as _ ;
40+ use crate :: convert :: TryToDataFusion ;
4341
4442/// Vortex implementation of a DataFusion [`FileFormat`].
4543pub struct VortexFormat {
@@ -298,7 +296,6 @@ impl FileFormat for VortexFormat {
298296 & self ,
299297 _state : & dyn Session ,
300298 file_scan_config : FileScanConfig ,
301- filters : Option < & Arc < dyn PhysicalExpr > > ,
302299 ) -> DFResult < Arc < dyn ExecutionPlan > > {
303300 if file_scan_config
304301 . file_groups
@@ -317,11 +314,7 @@ impl FileFormat for VortexFormat {
317314 return not_impl_err ! ( "Vortex doesn't support output ordering" ) ;
318315 }
319316
320- let mut source = VortexSource :: new ( self . file_cache . clone ( ) , self . session . metrics ( ) . clone ( ) ) ;
321- if let Some ( predicate) = make_vortex_predicate ( filters) {
322- source = source. with_predicate ( predicate) ;
323- }
324-
317+ let source = VortexSource :: new ( self . file_cache . clone ( ) , self . session . metrics ( ) . clone ( ) ) ;
325318 Ok ( DataSourceExec :: from_data_source (
326319 FileScanConfigBuilder :: from ( file_scan_config)
327320 . with_source ( Arc :: new ( source) )
@@ -350,23 +343,6 @@ impl FileFormat for VortexFormat {
350343 Ok ( Arc :: new ( DataSinkExec :: new ( input, sink, order_requirements) ) as _ )
351344 }
352345
353- fn supports_filters_pushdown (
354- & self ,
355- _file_schema : & Schema ,
356- table_schema : & Schema ,
357- filters : & [ & Expr ] ,
358- ) -> DFResult < FilePushdownSupport > {
359- let is_pushdown = filters
360- . iter ( )
361- . all ( |expr| can_be_pushed_down ( expr, table_schema) ) ;
362-
363- if is_pushdown {
364- Ok ( FilePushdownSupport :: Supported )
365- } else {
366- Ok ( FilePushdownSupport :: NotSupportedForFilter )
367- }
368- }
369-
370346 fn file_source ( & self ) -> Arc < dyn FileSource > {
371347 Arc :: new ( VortexSource :: new (
372348 self . file_cache . clone ( ) ,
@@ -375,22 +351,6 @@ impl FileFormat for VortexFormat {
375351 }
376352}
377353
378- pub ( crate ) fn make_vortex_predicate (
379- predicate : Option < & Arc < dyn PhysicalExpr > > ,
380- ) -> Option < Arc < dyn VortexExpr > > {
381- predicate
382- // If we cannot convert an expr to a vortex expr, we run no filter, since datafusion
383- // will rerun the filter expression anyway.
384- . and_then ( |expr| {
385- // This splits expressions into conjunctions and converts them to vortex expressions.
386- // Any inconvertible expressions are dropped since true /\ a == a.
387- datafusion:: physical_expr:: split_conjunction ( expr)
388- . into_iter ( )
389- . filter_map ( |e| ExprRef :: try_from_df ( e. as_ref ( ) ) . ok ( ) )
390- . reduce ( and)
391- } )
392- }
393-
394354#[ cfg( test) ]
395355mod tests {
396356 use datafusion:: execution:: SessionStateBuilder ;
0 commit comments