Skip to content

Conversation

AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Oct 10, 2025

Which issue does this PR close?

The PR is split into two commits, the first one includes a passing test that shows the bug, and the second PR fixes the formatting and the test.

Rationale for this change

Fixes tree formatting for SortPreservingMergeExec

What changes are included in this PR?

Fix tree formatting for SortPreservingMergeExec and add a test for the behavior.

Are these changes tested?

A new slt test

Are there any user-facing changes?

Only if a user asserts the tree-display in this case.

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) physical-plan Changes to the physical-plan crate labels Oct 10, 2025
@AdamGS AdamGS force-pushed the adamg/fix-sort-merge-exec-tree-fmt-limit branch from 1b56fc3 to 8f009a2 Compare October 10, 2025 11:43
@AdamGS AdamGS changed the title Adamg/fix sort merge exec tree fmt limit Fix SortPreservingMergeExec tree formatting with limit Oct 10, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AdamGS


if let Some(fetch) = self.fetch {
writeln!(f)?;
writeln!(f, "limit={fetch}")?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the last one should be just write! rather than writeln! 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could move the previous logic before the PhysicalSortExec iteration, which would be more intuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

SortPreservingMergeExec tree formatting with limit is missing a new line

3 participants