Skip to content

Conversation

@mohit7705
Copy link
Contributor

@mohit7705 mohit7705 commented Jan 7, 2026

Backport of #19668 to branch-52.

This PR cherry-picks commit 680ddcc from main.

Includes:

  • Split of BatchPartitioner::try_new into hash and round-robin constructors
  • Documentation improvements
  • No behavior changes

part of #18566

…ructors (apache#19668)

### Which issue does this PR close?

Closes apache#19664

---

### Rationale for this change

After apache#18880, `BatchPartitioner::try_new` gained additional parameters
that are
only relevant for round-robin repartitioning. This made the constructor
API
confusing, as hash repartitioning received parameters it does not use.

Splitting the constructor improves clarity and avoids passing
round-robin–specific parameters to hash partitioning.

---

### What changes are included in this PR?

- Introduce `BatchPartitioner::try_new_hash`
- Introduce `BatchPartitioner::try_new_round_robin`
- Refactor callers to use the specialized constructors
- Retain `BatchPartitioner::try_new` as a delegator for backward
compatibility

This is a pure refactor; behavior is unchanged.

---

### Are these changes tested?

Yes. Existing tests cover this code path.
All builds pass locally.

---

### Are there any user-facing changes?

No. This change is internal only and does not affect user-facing
behavior or APIs.

---------

Co-authored-by: Your Name <[email protected]>
@github-actions github-actions bot added the physical-plan Changes to the physical-plan crate label Jan 7, 2026
@milenkovicm milenkovicm changed the title chore(repartition): backport split BatchPartitioner::try_new constructors to branch-52 feat: split BatchPartitioner::try_new into hash and round-robin constructors Jan 7, 2026
@milenkovicm
Copy link
Contributor

perhaps @xudong963 should decide if to merge this to branch-52 as he's running 52 release cycle

@milenkovicm milenkovicm requested review from alamb and xudong963 January 7, 2026 12:57
@milenkovicm milenkovicm changed the title feat: split BatchPartitioner::try_new into hash and round-robin constructors [branch-52] Split BatchPartitioner::try_new into hash and round-robin constructors Jan 7, 2026
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

Thank you!

@xudong963 xudong963 merged commit d5dae86 into apache:branch-52 Jan 8, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants