You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
optimize_projections fails on leaf-expression pushdown over a view with an unconsumed column #22955
When a leaf-pushable expression (e.g. get_field / col['key']) appears in both the SELECT list and the WHERE clause, the bare base column is also projected, and the source is a view/SubqueryAlias that projects a column the outer query doesn't use, the leaf-expression-pushdown passes produce an inconsistent plan and optimization fails.
To Reproduce
Run the following SQL via datafusion-cli:
CREATETABLEbaseASSELECT named_struct('status', 'active') AS s, 1AS id;
CREATEVIEWvASSELECT s, id, id +1AS synth FROM base;
SELECT s['status'], s, id FROM v WHERE s['status'] IS NOT NULL;
It outputs with the following:
Optimizer rule 'optimize_projections' failed
caused by
Schema error: No field named __datafusion_extracted_2. Did you mean 'v.__datafusion_extracted_1'?
Activity
Fix leaf expression reconciliation (apache#22971)
Fix leaf expression reconciliation (apache#22971)