Skip to content

Fix sort enforcement for single-partition output#53

Merged
xudong963 merged 1 commit intobranch-52from
xudong963/fix-limit-sort-dist
Apr 30, 2026
Merged

Fix sort enforcement for single-partition output#53
xudong963 merged 1 commit intobranch-52from
xudong963/fix-limit-sort-dist

Conversation

@xudong963
Copy link
Copy Markdown
Collaborator

Summary

  • make EnforceSorting account for parent SinglePartition requirements when inserting a missing sort
  • use SortExec + SortPreservingMergeExec when a child must be both ordered and single-partitioned
  • add a regression test that runs SanityCheckPlan for ordered single-partition output requirements

Tests

  • cargo fmt --all --check
  • cargo check -p datafusion-physical-optimizer --lib
  • cargo test -p datafusion --test core_integration output_requirement_adds_merge_after_partition_preserving_sort -- --nocapture
  • cargo test -p datafusion --test core_integration physical_optimizer::enforce_sorting -- --nocapture

@xudong963 xudong963 force-pushed the xudong963/fix-limit-sort-dist branch from c926d59 to ff5aac8 Compare April 30, 2026 01:33
@xudong963 xudong963 merged commit 689bc94 into branch-52 Apr 30, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants