feat: add narrow group-contiguous source property - #24698
Draft
xavlee wants to merge 2 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24698 +/- ##
==========================================
- Coverage 81.45% 81.43% -0.03%
==========================================
Files 1118 1119 +1
Lines 399685 400740 +1055
Branches 399685 400740 +1055
==========================================
+ Hits 325576 326337 +761
- Misses 55103 55305 +202
- Partials 19006 19098 +92 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xavlee
force-pushed
the
feat/issue-24438-group-contiguous-property
branch
from
August 26, 2026 19:20
b2ceb1a to
6bd697f
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
Sources that combine ordered, disjoint logical runs can know that each complete grouping tuple occupies one contiguous range in an output stream, even when tuple values reset between runs. This PR gives sources a precise way to express that fact and defines its propagation through the first row-transparent operators in the physical plan.
Property contract
ExecutionPlan::group_contiguous_exprsdescribes one complete composite tuple. Within each output partition, every distinct tuple occupies at most one contiguous range of rows. Tuple values may appear in any order.The source owns this correctness assertion.
AggregateExeccan use it to emit a tuple after the stream advances to the next tuple.What changes are included?
The property follows this explicit lifecycle:
DataSource::group_contiguous_exprsdeclares the tuple, with an empty default.DataSourceExecexposes the source declaration and includes it in explain output.ProjectionExecprojects the complete tuple when every component maps to the output schema; an incomplete mapping produces the empty default.CooperativeExecdelegates the tuple because it preserves the input row sequence.ExecutionPlandefault.group_contiguous_exprsis represented separately fromPlanProperties, making forwarding an explicit operator decision.ProjectionExecrecomputes it during child replacement, including the same-PlanPropertiesfast path.Stack
This draft carries #24697 as its first commit and the property implementation as its second commit (
6bd697fe8). Once #24697 merges, this branch can be rebased to the property commit.The
Linear -> None -> Finalaggregate regression introduced by #24697 retains its baseline behavior in this propagation layer. The following consumer commit updates that test to exercise the new assertion.Are these changes tested?
Tests cover:
DataSourcetoDataSourceExecdelegation and explain display;PlanPropertieschild replacement;CooperativeExecforwarding;Linearaggregate blocking baseline inherited from refactor: separate aggregate group completion from input ordering #24697.Validation:
cargo test -p datafusion-physical-plan --libcargo test -p datafusion-datasource --libcargo-semver-checksfor both cratesAre there any user-facing changes?
ExecutionPlanandDataSourceimplementors receive default-emptygroup_contiguous_exprsmethods and can override them to declare a complete contiguous tuple.