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
Describe the bug
Projection is removed when it contains the same fields.
This
To Reproduce
>select (1+1) as a from (select1as a);
+---+
| a |
+---+
| 1 |
+---+1 rows inset. Query took 0 seconds.;
Expected behavior
Should return 2 instead of reusing the expression from the field.
Additional context
The bug seems to originate from the project function https://github.com/apache/arrow-datafusion/blob/master/datafusion/src/sql/planner.rs#L652 .
I think when we remove the "optimization" to get rid of the projection, the query will return the correct result.
Removal of any redundant projections should move to a properly tested optimization pass rather than in the sql -> logical plan planner.
Activity
fix: Only trigger Comet Final aggregation on Comet partial aggregation (
Explain bindings (apache#264)