refactor(hash-aggr): Migrate ordered partial/final aggregation#23181
Open
2010YOUY01 wants to merge 1 commit into
Open
refactor(hash-aggr): Migrate ordered partial/final aggregation#231812010YOUY01 wants to merge 1 commit into
2010YOUY01 wants to merge 1 commit into
Conversation
2010YOUY01
commented
Jun 25, 2026
| assert!(collected_running.len() > 2); | ||
| // Running should produce more chunk than the usual AggregateExec. | ||
| // Otherwise it means that we cannot generate result in running mode. | ||
| assert!(collected_running.len() > collected_usual.len()); |
Contributor
Author
There was a problem hiding this comment.
This is asserting: we run the same query on OrderedAggregateStream and AggregateStream, the first one should return more number of batches.
This is implementation dependent, and later it will compare the whole result row-by-row, so it's safe to delete
| /// `k = 100`, it is safe to emit all groups with keys less than 100 because the | ||
| /// input is ordered. | ||
| /// | ||
| /// ## Implementation Note |
Contributor
Author
There was a problem hiding this comment.
It's obvious there are many applicable optimizations for this path, here is the explanation why this PR tends to keep it simple.
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn ordered_partial_aggregate_partially_sorted_no_emit_panic() -> Result<()> { |
Contributor
Author
There was a problem hiding this comment.
This test case is migrated from row_hash.rs's existing UT, and there is a comment left at the original test, so we can check it easier when deleting the old implementation eventually.
10 tasks
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?
Rationale for this change
Part of #22710
This PRs implements the cases that input is ordered by group keys.
Comments at datafusion/physical-plan/src/aggregates/ordered_partial_stream.rs explains the high-level idea.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?