Skip to content

feat: represent source-defined key groups separately from native hash - #26875

Open
wirybeaver wants to merge 1 commit into
apache:mainfrom
wirybeaver:spj/distribution-contract-upstream
Open

wirybeaver wants to merge 1 commit into
apache:mainfrom
wirybeaver:spj/distribution-contract-upstream

Conversation

@wirybeaver

@wirybeaver wirybeaver commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

D0 for apache/datafusion-ballista#1677.

Rationale for this change

Joins can reuse a provider's existing key groups when both inputs have the same layout. Treating external buckets as native hash partitions can route rows to the wrong partition.

What changes are included in this PR?

Add Partitioning::Grouped with key expressions, a scheme, and ordered group IDs. Distribution checks use this metadata to decide whether a join can reuse the layout.

provider grouping -> Grouped(keys, scheme, IDs)
                              |
                   distribution requirements
                     /                   \
               compatible             incompatible
                   |                       |
             retain grouping          repartition

This draft targets DataFusion main. Ballista integration uses the 56.0.0-rc1 backport.

Are these changes tested?

Ballista tests the 56.0.0-rc1 backport end to end by comparing bucketed Parquet joins with shuffle joins after task serialization.

Are there any user-facing changes?

Adds a public Partitioning variant and its protobuf representation. FFI exposes source groups as unknown partitioning.

Benchmark results of Divisor Alignment

TPC-H SF10 Q12 benchmark results in the Ballista roadmap

@github-actions github-actions Bot added documentation Improvements or additions to documentation physical-expr Changes to the physical-expr crates optimizer Optimizer rules datasource Changes to the datasource crate ffi Changes to the ffi crate physical-plan Changes to the physical-plan crate labels Oct 29, 2026
@github-actions github-actions Bot added the auto detected api change Auto detected API change label Oct 29, 2026
@wirybeaver
wirybeaver force-pushed the spj/distribution-contract-upstream branch from de1fd59 to a6eed49 Compare November 22, 2026 03:34
@github-actions github-actions Bot removed the auto detected api change Auto detected API change label Nov 22, 2026
@wirybeaver
wirybeaver marked this pull request as ready for review November 23, 2026 02:41
@wirybeaver
wirybeaver marked this pull request as draft November 23, 2026 02:44
@wirybeaver
wirybeaver marked this pull request as ready for review November 23, 2026 03:17
@wirybeaver
wirybeaver force-pushed the spj/distribution-contract-upstream branch from a6eed49 to 16aa588 Compare November 29, 2026 02:39
@wirybeaver
wirybeaver force-pushed the spj/distribution-contract-upstream branch from 16aa588 to 23556af Compare November 29, 2026 02:55
@github-actions github-actions Bot removed the documentation Improvements or additions to documentation label Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate ffi Changes to the ffi crate optimizer Optimizer rules physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant