Skip to content

Allow co-partitioned Partitioning::Range inputs for right-side hash joins #23453

Closed

Description

@gene-bordegaray

Related:

Is your feature request related to a problem or challenge?

#23184 lets compatible range-partitioned inputs satisfy inner partitioned hash joins without repartitioning. Right-side partitioned equi joins still use the repartition path even when both inputs are already co-partitioned by the join keys.

Example

HashJoinExec: mode=Partitioned, join_type=Right, on=[(range_key@0, range_key@0)]
  DataSourceExec: output_partitioning=Range([range_key@0 ASC], [(10), (20), (30)], 4)
  DataSourceExec: output_partitioning=Range([range_key@0 ASC], [(10), (20), (30)], 4)

The compatible range inputs are already co-partitioned by partition index. The optimizer should preserve that layout instead of inserting hash repartitions for the right join.

Describe the solution you'd like

Extend InputDistributionRequirements::co_partitioned(...) to right-side partitioned equi hash joins where execution remains partition-local.

Covered join types:

  • Right
  • RightSemi
  • RightAnti
  • RightMark

Acceptance criteria

  • Compatible range/range inputs avoid hash repartitioning for the covered join types.
  • Incompatible split points, partition counts, sort options, or key expressions still trigger repartitioning.
  • Tests cover matched and unmatched rows.
  • RightMark tests cover null-related marker behavior.
  • Partitioned dynamic filters remain unchanged unless separately addressed by Support dynamic filters for range co-partitioned joins #23376.

Additional context

Activity

  1. added a commit that references this issue on Jul 21, 2026
    ed22a4a
  2. added a commit that references this issue on Jul 24, 2026
    4a88bd6
  3. added a commit that references this issue on Aug 7, 2026
    34149d9
  4. added a commit that references this issue on Aug 12, 2026
    85ea100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions