feat: allow Partitioning::Range to satisfy window Distribution::KeyPartitioned requirements#23416
Draft
mithuncy wants to merge 2 commits into
Draft
feat: allow Partitioning::Range to satisfy window Distribution::KeyPartitioned requirements#23416mithuncy wants to merge 2 commits into
mithuncy wants to merge 2 commits into
Conversation
…rtitioned requirements Windows got a hash repartition even when the input was already range partitioned on the PARTITION BY keys. Opt WindowAggExec and BoundedWindowAggExec into range satisfaction for KeyPartitioned, the same way AggregateExec does. Incompatible keys still fall back to hash repartitioning, and windows without PARTITION BY keep requiring a single partition. Covered by enforce_distribution and sanity_checker tests plus a window section in range_partitioning.slt. Closes apache#23289
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Contributor
|
This is in my queue, just waiting for #23184 to land 🙇 |
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?
Partitioning::Rangeto satisfy windowDistribution::KeyPartitionedrequirements #23289.Stacked on #23184 (first commit); only the last commit is this PR. Rebase and mark ready once #23184 merges. Overlaps with #23355, which also opts the window execs into range satisfaction as part of its PartitionedTopK work — happy to rebase whichever lands second.
What changes are included in this PR?
In one commit on top of #23184:
WindowAggExecandBoundedWindowAggExecwith partition keys into range satisfaction viaInputDistributionRequirements::allow_range_satisfaction_for_key_partitioning, mirroringAggregateExec. Compatible range-partitioned inputs then satisfy the window key requirement without a hash repartition; subset satisfaction and the hash fallback for incompatible keys come from the existing satisfaction machinery. Windows withoutPARTITION BYkeep requiring a single partition.Are these changes tested?
Yes: new
slttests inrange_partitioning.slt(exact and subset reuse, rehash on incompatible keys,subset_repartition_threshold/preserve_file_partitions/target_partitionsbehavior,WindowAggExecvia an unbounded frame, and no-PARTITION BY), plus plan-shape tests inenforce_distribution.rsand acceptance/rejection tests insanity_checker.rs.Are there any user-facing changes?
No: only plan changes.