Skip to content

Allow co-partitioned Partitioning::Range inputs for left-side hash joins #23452

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. Left-side partitioned equi joins still use the conservative hash repartition path even when both inputs are already co-partitioned by the join keys.

Example

HashJoinExec: mode=Partitioned, join_type=Left, 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 not add hash repartitions.

Describe the solution you'd like

Extend the InputDistributionRequirements::co_partitioned(...) to left-side partitioned equi hash joins.

Covered join types:

  • Left
  • LeftSemi
  • LeftAnti
  • LeftMark

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.
  • LeftMark 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

This should follow the multi-child requirement model added in #23184.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions