refactor(hash-aggr): treat soft limit as hint - #24260
Draft
2010YOUY01 wants to merge 2 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24260 +/- ##
==========================================
- Coverage 81.06% 81.00% -0.06%
==========================================
Files 1107 1108 +1
Lines 382191 384589 +2398
Branches 382191 384589 +2398
==========================================
+ Hits 309805 311531 +1726
- Misses 54083 54700 +617
- Partials 18303 18358 +55 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part of #22710
Depends on #24259
Only the last commit belongs to this PR. I’ll rebase onto main after the dependent PR is merged.
Rationale for this change
For the background of 'soft limit optimization' in aggregation, see:
datafusion/datafusion/physical-plan/src/aggregates/hash_stream.rs
Line 81 in 8cb7c84
'soft' in the term means it's only a hint for the operator, it can try to produce outputs less than the 'soft limit' for efficiency, if it ignores this soft limit, there will be no correctness issue, there will be a downstream
LimitExecfor the final processing.The original implementation only targets partial/final mode for this optimization: #8038, but somehow this soft limit hint can be pushed to other aggregation modes (like
singleaggregation)For simplicity, this PR allows soft limit in all aggregation modes, since
Later we can try to apply this optimization more widely, or trying to implement the related optimizer rule more defensively.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?