Skip to content

Add Distribution::HashPartitioned to Distribution::KeyPartitioned API bridge#23259

Open
gene-bordegaray wants to merge 1 commit into
apache:mainfrom
gene-bordegaray:gene.bordegaray/2026/06/key-partitioned-api-bridge
Open

Add Distribution::HashPartitioned to Distribution::KeyPartitioned API bridge#23259
gene-bordegaray wants to merge 1 commit into
apache:mainfrom
gene-bordegaray:gene.bordegaray/2026/06/key-partitioned-api-bridge

Conversation

@gene-bordegaray

@gene-bordegaray gene-bordegaray commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

HashPartitioned is historical naming for a key-partitioning requirement. This keeps the old variant as a deprecated compatibility bridge while moving DataFusion internals to KeyPartitioned.

What changes are included in this PR?

Adds KeyPartitioned, deprecates HashPartitioned, and treats both equivalently during the transition to avoid breaking changes for downstream consumers. A blast radius report on this was done here #23241

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes, Distribution::HashPartitioned is deprecated and trainsitioned to Distribution::KeyPartitioned.

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate physical-plan Changes to the physical-plan crate labels Jun 30, 2026
@gene-bordegaray gene-bordegaray changed the title Add KeyPartitioned distribution bridge Add Distribution::HashPartitioned to Distribution::KeyPartitioned API bridge Jun 30, 2026
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

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
     Cloning apache/main
    Building datafusion v54.0.0 (current)
       Built [ 101.728s] (current)
     Parsing datafusion v54.0.0 (current)
      Parsed [   0.034s] (current)
    Building datafusion v54.0.0 (baseline)
       Built [ 100.916s] (baseline)
     Parsing datafusion v54.0.0 (baseline)
      Parsed [   0.036s] (baseline)
    Checking datafusion v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.586s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [ 205.055s] datafusion
    Building datafusion-physical-expr v54.0.0 (current)
       Built [  28.393s] (current)
     Parsing datafusion-physical-expr v54.0.0 (current)
      Parsed [   0.045s] (current)
    Building datafusion-physical-expr v54.0.0 (baseline)
       Built [  28.732s] (baseline)
     Parsing datafusion-physical-expr v54.0.0 (baseline)
      Parsed [   0.049s] (baseline)
    Checking datafusion-physical-expr v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.384s] 223 checks: 221 pass, 2 fail, 0 warn, 30 skip

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.48.0/src/lints/enum_variant_added.ron

Failed in:
  variant Distribution:KeyPartitioned in /home/runner/work/datafusion/datafusion/datafusion/physical-expr/src/partitioning.rs:609

--- failure enum_variant_marked_deprecated: enum variant #[deprecated] added ---

Description:
An enum variant is now #[deprecated]. Downstream crates will get a compiler warning when using this variant.
        ref: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-deprecated-attribute
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.48.0/src/lints/enum_variant_marked_deprecated.ron

Failed in:
  variant datafusion_physical_expr::Distribution::HashPartitioned in /home/runner/work/datafusion/datafusion/datafusion/physical-expr/src/partitioning.rs:606

     Summary semver requires new major version: 1 major and 1 minor checks failed
    Finished [  59.090s] datafusion-physical-expr
    Building datafusion-physical-optimizer v54.0.0 (current)
       Built [  38.748s] (current)
     Parsing datafusion-physical-optimizer v54.0.0 (current)
      Parsed [   0.022s] (current)
    Building datafusion-physical-optimizer v54.0.0 (baseline)
       Built [  38.718s] (baseline)
     Parsing datafusion-physical-optimizer v54.0.0 (baseline)
      Parsed [   0.022s] (baseline)
    Checking datafusion-physical-optimizer v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.128s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [  78.848s] datafusion-physical-optimizer
    Building datafusion-physical-plan v54.0.0 (current)
       Built [  36.607s] (current)
     Parsing datafusion-physical-plan v54.0.0 (current)
      Parsed [   0.132s] (current)
    Building datafusion-physical-plan v54.0.0 (baseline)
       Built [  36.406s] (baseline)
     Parsing datafusion-physical-plan v54.0.0 (baseline)
      Parsed [   0.131s] (baseline)
    Checking datafusion-physical-plan v54.0.0 -> v54.0.0 (no change; assume patch)
     Checked [   0.574s] 223 checks: 223 pass, 30 skip
     Summary no semver update required
    Finished [  75.144s] datafusion-physical-plan

@github-actions github-actions Bot added the auto detected api change Auto detected API change label Jun 30, 2026
@gene-bordegaray gene-bordegaray force-pushed the gene.bordegaray/2026/06/key-partitioned-api-bridge branch from 15c8c67 to a7a0d37 Compare June 30, 2026 14:01
Comment thread datafusion/physical-expr/src/partitioning.rs

@gabotechs gabotechs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Nice!

Comment thread datafusion/physical-expr/src/partitioning.rs Outdated
Comment thread datafusion/physical-expr/src/partitioning.rs

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread datafusion/physical-expr/src/partitioning.rs Outdated
Comment thread datafusion/physical-expr/src/partitioning.rs
Comment thread datafusion/physical-expr/src/partitioning.rs
@gene-bordegaray gene-bordegaray force-pushed the gene.bordegaray/2026/06/key-partitioned-api-bridge branch from a7a0d37 to 858990a Compare June 30, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto detected api change Auto detected API change core Core DataFusion 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.

Replace / rename HashPartitioned distribution as KeyPartitioned

3 participants