Skip to content

Allow Range partitioned inputs to PartitionedTopK#23355

Open
stuhood wants to merge 2 commits into
apache:mainfrom
paradedb:stuhood.range-partitioned-top-k
Open

Allow Range partitioned inputs to PartitionedTopK#23355
stuhood wants to merge 2 commits into
apache:mainfrom
paradedb:stuhood.range-partitioned-top-k

Conversation

@stuhood

@stuhood stuhood commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

In two commits:

  • Improve the robustness of WindowTopN to intermediate RepartitionExec nodes, to ensure that PartitionedTopK can still be used when target_partitions mismatches physical partitions.
  • Use required_input_distributions to declare required partitioning for PartitionedTopKExec, BoundedWindowAggExec, and WindowAggExec.

Are these changes tested?

Yes, new slt tests are added for both the WindowTopN robustness fix, and for the use of required_input_distributions in PartitionedTopK.

Are there any user-facing changes?

No: only plan changes.

@github-actions github-actions Bot added physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Jul 6, 2026
@stuhood stuhood changed the title Stuhood.range partitioned top k Allow Range partitioned inputs to PartitionedTopK Jul 6, 2026
@github-actions github-actions Bot added the auto detected api change Auto detected API change label Jul 6, 2026
@stuhood stuhood force-pushed the stuhood.range-partitioned-top-k branch from 1b1c490 to e236f7b Compare July 8, 2026 19:30
@github-actions github-actions Bot added the datasource Changes to the datasource crate label Jul 8, 2026
@stuhood stuhood force-pushed the stuhood.range-partitioned-top-k branch 3 times, most recently from eb2c841 to 3ab476d Compare July 8, 2026 23:10
@gene-bordegaray

Copy link
Copy Markdown
Contributor

This is in my queue, just waiting for #23184 to land 🙇

@stuhood stuhood force-pushed the stuhood.range-partitioned-top-k branch from 3ab476d to 7d0f380 Compare July 10, 2026 18:10
@github-actions github-actions Bot removed physical-expr Changes to the physical-expr crates core Core DataFusion crate datasource Changes to the datasource crate auto detected api change Auto detected API change labels Jul 10, 2026
@stuhood stuhood marked this pull request as ready for review July 10, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

optimizer Optimizer rules physical-plan Changes to the physical-plan crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Partitioning::Range to satisfy PartitionedTopK Distribution::KeyPartitioned requirements

2 participants