Skip to content

Allow Partitioning::Range to satisfy window Distribution::KeyPartitioned requirements #23289

Closed

Description

@gene-bordegaray

Related:

Is your feature request related to a problem or challenge?

Window functions like WindowAggExec and BoundedWindowAggExec require Distribution::KeyPartitioned, but Partitioning::Range does not yet generally satisfy this through Partitioning::satisfaction.

This means DF can insert an unnecessary repartition even when the input is already range partitioned which satisfies the distribution.

Example:

BoundedWindowAggExec: PARTITION BY [a] ORDER BY [...]
  Input: Partitioning::Range(ordering=[a ASC], split_points=[...])

Rows with the same a value are colocated in one range partition, so the window does not need a hash repartition just to satisfy the KeyPartitioned distribution.

Describe the solution you'd like

Allow compatible Partitioning::Range inputs to satisfy window partition requirements for window operators.

This should include:

  • WindowAggExec::required_input_distribution
  • BoundedWindowAggExec::required_input_distribution
  • Exact range satisfaction, such as Range([a]) satisfying PARTITION BY a
  • Subset range satisfaction, such as Range([a]) satisfying PARTITION BY a, b, when subset satisfaction is enabled
  • Fallback to hash repartitioning when the range key is incompatible.
  • This should include a suit of slt tests in range_partitioning.slt that tests core behavior across positive / negative cases and settings like:
    • datafusion.optimizer.preserve_file_partitions
    • datafusion.execution.target_partitions
    • datafusion.optimizer.subset_repartition_threshold

This should be a private satisfaction implementation. General Partitioning::satisfaction for Partitioning::Range will be implemented once a more operators have been covered to reduce blast-radius of optimizer changes.

Additional context

Activity

  1. saadtajwar commented on Jul 2, 2026

    @saadtajwar
    Contributor

    take

  2. saadtajwar commented on Jul 6, 2026

    @saadtajwar
    Contributor

    untake

  3. mithuncy commented on Jul 7, 2026

    @mithuncy
    Contributor

    /take

  4. mithuncy commented on Jul 9, 2026

    @mithuncy
    Contributor

    take

  5. added 3 commits that reference this issue on Jul 11, 2026
    f125c39
    2995df1
    a065d66
  6. added a commit that references this issue on Jul 14, 2026
    4b68de6
  7. added a commit that references this issue on Jul 24, 2026
    eb4f680
  8. added a commit that references this issue on Aug 7, 2026
    1248881
  9. added a commit that references this issue on Aug 12, 2026
    40cffe8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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