Skip to content

Commit fc2ce21

Browse files
committed
fix
1 parent 75ba7d8 commit fc2ce21

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

datafusion/datasource-parquet/src/source.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

datafusion/physical-plan/src/filter_pushdown.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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)]

0 commit comments

Comments
 (0)