-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support zero copy hash repartitioning for Hash Aggregate #15383
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
Comments
take |
@Dandandan When the selection vector mode is enabled:
The plan looks like this:
I'll review more aggregation patterns and add additional tests. |
Based on goldmedal#3, I did the some benchmarks( In conclusion, HashAggregate is slower in the selection vector mode.
I tried to profile Clickbench QQuery 4: When selection vector disabled: In the current implementation, the CPU time of |
I'm considering another approach. Maybe I shouldn't use |
Agree with you, we should try to avoid directly operate on the record batch. |
Yes, doing so will copy the entire batch (which is what we try to avoid) and will be slower than |
I think also need to filter rows in |
I have another implementation for this issue goldmedal#4 Because it may involve many changes, I want to check if the implementations make sense. I also did some optimization for the sv-mode repartition https://github.com/apache/datafusion/pull/15423/files#r2051721176. However, I found the performance won't be better for Clickbench queries 4 and 7.
I'm not sure if I'm on the right way 🤔 @Dandandan @Rachelint Do you have any suggestions for it? |
I think it may be possible that the test queries can't reflect the improvement well. |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem or challenge?
Is your feature request related to a problem or challenge?
Currently
RepartitionExec: partitioning=Hash
will be added whenever for aggregates inFinalPartitioned
andSinglePartitioned
The benefit is increased parallelism, but at the cost of copying the entire table (in a not-so efficient way).
We should consider lowering the cost of repartitioning by not having to copy the input.
Dependencies
Describe the solution you'd like
Instead of repartitioning the input in
RepartitionExec
, support repartitioning the inputs based on a selection vector.Instead of
taking
theRecordBatch
, we can consider doing the following:true
means the row is selected for the partition.RecordBatch
remains unchanged (i.e. no copy).Describe alternatives you've considered
The partitioning could be done inside the hash aggregate (at the cost of more complexity inside it).
Additional context
No response
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: