Skip to content

fix: allow equal range split points - #27384

Open
jayshrivastava wants to merge 1 commit into
apache:mainfrom
jayshrivastava:js/allow-equal-range-split-points
Open

jayshrivastava wants to merge 1 commit into
apache:mainfrom
jayshrivastava:js/allow-equal-range-split-points

Conversation

@jayshrivastava

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #26509. Extracted from #26593 following the request to land equal split points separately and the request for standalone routing tests.

Rationale for this change

Repeated quantile cuts on skewed keys and intentionally empty partitions can require equal adjacent split points. These layouts currently fail validation. Allowing non-decreasing cuts preserves the requested partition count: splits [10, 10, 20] route keys [5, 10, 15, 25] to [5], [], [10, 15], and [25].

What changes are included in this PR?

  • Allow equality in validate_range_split_points, while continuing to reject decreasing cuts and invalid tuple widths.
  • Document that equal keys route after the last equal split point and that intervening partitions are empty.
  • Update constructor, file-scan, and range-transform validation tests, and add RepartitionExec routing regressions for primitive and two-column keys.

What is the testing strategy for this PR?

Both new routing regressions fail with the old validation. The primitive case exercises the specialized router; the compound case also checks keys that differ in the second column around repeated boundaries.

  • 5,978 unit tests across the five affected crates passed (two existing ignored tests).
  • 2,486 core and CLI tests passed, and all 549 SQL logic test files passed.
  • All checks in dev/rust_lint.sh passed, including all-targets/all-features Clippy with -D warnings, generated documentation checks, and Rust/HTML documentation builds. The final checks were resumed after rebuilding a locally incompatible cargo-machete binary.
  • Eight range_repartition Criterion cases against main (b5bcea88a4, release-nonlto) detected no regressions: uniform and sequential keys, partitioner construction, and unchanged RangeExpr routing at 8 and 512 partitions (30 samples per case, pinned to the same CPU).

Are there any user-facing changes?

datafusion_common::validate_range_split_points and the logical and physical RangePartitioning constructors now accept equal adjacent split points. Callers that relied on duplicate rejection must check for equality explicitly. The DataFusion 57 upgrade guide documents this behavior change.

Accept non-decreasing split points so repeated cuts preserve empty
partitions, with primitive and compound-key routing regression tests.

Generated-by: Codex
@github-actions github-actions Bot added documentation Improvements or additions to documentation logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates common Related to common crate datasource Changes to the datasource crate physical-plan Changes to the physical-plan crate labels Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate datasource Changes to the datasource crate documentation Improvements or additions to documentation logical-expr Logical plan and expressions 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