Skip to content

Add range partitioning compatibility helpers #22589

@gene-bordegaray

Description

@gene-bordegaray

Parent: #22395

Add partitioning compatibility helpers.

Partitioning::Range describes range-partitioned data, but optimizer and execution work lack a good way to ask whether two partitioning schemes describe the same partition map. This issue adds that API surface without changing planning behavior:

  • Add Partitioning::compatible_with.
  • Add RangePartitioning::compatible_with.

compatible_with is different from satisfaction:

  • satisfaction asks whether a partitioning can satisfy a required distribution.
    • Example: a single-partition input satisfies HashPartitioned([a]) because no repartition is needed for correctness.
  • compatible_with asks whether partition i on both sides covers the same key domain. Example: two range partitionings on a with split points [10, 20] are compatible because partition 1 means 10 <= a < 20 on both sides.

This distinction is useful for partition-local behavior such as joins or dynamic filters. If two partition maps are compatible, partition-local state from partition i can be applied to partition i safely. If compatibility is not proven, later optimizer rules should keep the existing safe fallback behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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