refactor: separate aggregate group completion from input ordering - #24697
Draft
xavlee wants to merge 1 commit into
Draft
refactor: separate aggregate group completion from input ordering#24697xavlee wants to merge 1 commit into
xavlee wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24697 +/- ##
==========================================
- Coverage 81.45% 81.44% -0.02%
==========================================
Files 1118 1119 +1
Lines 399685 400533 +848
Branches 399685 400533 +848
==========================================
+ Hits 325576 326207 +631
- Misses 55103 55245 +142
- Partials 19006 19081 +75 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xavlee
force-pushed
the
refactor/aggregate-group-completion-mode
branch
from
August 26, 2026 19:20
689f76d to
0e05631
Compare
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 relate to?
Rationale for this change
InputOrderModerecords how aggregate input is ordered relative to its grouping expressions and also selects the runtime mechanism that determines when groups are complete. This PR gives the runtime capability its own private representation, allowing aggregate execution to consume group-completion evidence whileInputOrderModecontinues to describe ordering.What changes are included?
GroupCompletionMode::{None, Partial, Full}variants.GroupCompletionModefromInputOrderModeduringAggregateExecconstruction.GroupCompletionModethrough ordered aggregate tables, streams, and spill replay paths.InputOrderModefor required ordering, output ordering, andmaintains_input_ordermetadata.GroupOrdering::try_new(&InputOrderMode)as the public compatibility entry point.Linear -> None -> Finalbehavior and observes the aggregate remaining pending before EOF.The conversion remains one-to-one in this PR:
This mapping preserves the existing execution paths and plan properties.
Stack
This is the first of three commits for #24438. It establishes the private aggregate capability and the blocking
Linearbaseline. The final consumer commit updates that same regression into paired contiguous and default-empty cases.Are these changes tested?
Yes:
linear_aggregate_waits_for_input_endassertsLinear,None,Final, the ordinary hash stream, and pending output before EOFcargo test -p datafusion-physical-plan --lib(1,785 tests)datafusion-physical-plan, all targets and featurescargo fmt --all -- --checkAre there any user-facing changes?
This is an internal refactor.
GroupCompletionModeis crate-private, andGroupOrdering::try_new(&InputOrderMode)remains the public entry point.