File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ impl FileSource for ParquetSource {
613613
614614 let mut source = self . clone ( ) ;
615615 let filters = PredicateSupports :: new_with_supported_check ( filters, |filter| {
616- pushdown_filters && can_expr_be_pushed_down_with_schemas ( filter, & file_schema)
616+ can_expr_be_pushed_down_with_schemas ( filter, & file_schema)
617617 } ) ;
618618 if filters. is_all_unsupported ( ) {
619619 // No filters can be pushed down, so we can just return the remaining filters
@@ -629,6 +629,12 @@ impl FileSource for ParquetSource {
629629 } ;
630630 source. predicate = Some ( predicate) ;
631631 let source = Arc :: new ( source) ;
632+ // If pushdown_filters is false we tell our parents that they still have to handle the filters,
633+ // even if we updated the predicate to include the filters (they will only be used for stats pruning).
634+ if !pushdown_filters {
635+ return Ok ( FilterPushdownPropagation :: with_filters ( filters. make_unsupported ( ) )
636+ . with_updated_node ( source) ) ;
637+ }
632638 Ok ( FilterPushdownPropagation :: with_filters ( filters) . with_updated_node ( source) )
633639 }
634640}
Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ pub enum PredicateSupport {
3131 Unsupported ( Arc < dyn PhysicalExpr > ) ,
3232}
3333
34+ impl PredicateSupport {
35+ pub fn into_inner ( self ) -> Arc < dyn PhysicalExpr > {
36+ match self {
37+ PredicateSupport :: Supported ( expr) | PredicateSupport :: Unsupported ( expr) => expr,
38+ }
39+ }
40+ }
41+
3442/// A thin wrapper around [`PredicateSupport`]s that allows for easy collection of
3543/// supported and unsupported filters. Inner vector stores each predicate for one node.
3644#[ derive( Debug , Clone ) ]
You can’t perform that action at this time.
0 commit comments