-
Notifications
You must be signed in to change notification settings - Fork 1.9k
allow expressions to pass through RepartitionExec #19365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6572ff5 to
966491d
Compare
| &self, | ||
| projection: &ProjectionExec, | ||
| ) -> Result<Option<Arc<dyn ExecutionPlan>>> { | ||
| // If the projection does not narrow the schema, we should not try to push it down. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this still shows up in the plans, in some cases the number of fields is bigger before repartitition because of this (and might hurt performance as RepartitionExec copies the input columns (currently twice)). Can we instead relax the conditition to > instead of >= so it will be pushed down if it also keeps the number of fields equal?
|
run benchmarks |
|
🤖 |
|
We discussed in the meeting today. |
|
🤖: Benchmark completed Details
|
|
run benchmarks |
|
🤖 |
|
🤖: Benchmark completed Details
|
kosiew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this
I think adding unit tests to validate:
- Projections with computed expressions (binary operators) can be swapped through repartition
- Hash partition expressions are correctly preserved after swap
would improve test coverage.
I don't see any reason for these limitations.
It can be incredibly beneficial to push down non-column expressions, I don't think the logic of benefits / does not benefit from re-partitioning is sound.
Maybe this made more sense when e.g. ParquetSource couldn't push down struct field access, couldn't optimize away data casts, etc?
This behavior was introduced in #14235, @buraksenn @berkaysynnada if you have any context please share.