-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When upgrade latest datafusion from a old version, I found optimize_projections rule produce wrong projection. Eg:
create table t(x bigint, y bigint) as values (1,1), (2,2);
select x from t where y > 0;Only x will be included in projection, y is missing from the plan.
To Reproduce
First apply following changes, the purpose is to push down all filters
@@ -884,6 +884,7 @@ impl OptimizerRule for PushDownFilter {
let results = scan
.source
.supports_filters_pushdown(filter_predicates.as_slice())?;
+ let results = vec![TableProviderFilterPushDown::Exact; results.len()];
let zip = filter_predicates.iter().zip(results);Then run datafusion-cli:
create table t(x bigint, y bigint) as values (1,1), (2,2);
explain verbose select x from t where y > 0;Then we will get
| logical_plan after optimize_projections | Projection: t.x |
| | TableScan: t projection=[x], unsupported_filters=[t.y > Int64(0)] |
Expected behavior
The right projection should be [x, y].
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working