Fix FilterExec tree render missing fetch display#21230
Merged
zhuqi-lucas merged 1 commit intoapache:mainfrom Mar 30, 2026
Merged
Fix FilterExec tree render missing fetch display#21230zhuqi-lucas merged 1 commit intoapache:mainfrom
zhuqi-lucas merged 1 commit intoapache:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in DataFusion’s physical plan TreeRender formatting by ensuring FilterExec displays its pushed-down fetch limit, making EXPLAIN FORMAT TREE output more complete and consistent with the default/verbose formats.
Changes:
- Update
FilterExec::fmt_asforDisplayFormatType::TreeRenderto append, fetch=Nwhenfetchis present. - Add a new sqllogictest case asserting
fetchappears inEXPLAIN FORMAT TREEoutput for aFilterExecnode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
datafusion/physical-plan/src/filter.rs |
Adds fetch rendering to FilterExec’s TreeRender formatting. |
datafusion/sqllogictest/test_files/limit.slt |
Adds regression coverage for TreeRender output including fetch on FilterExec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
424ef47 to
2e8c43e
Compare
2010YOUY01
reviewed
Mar 30, 2026
2e8c43e to
101be80
Compare
When `FilterExec` has a `fetch` (limit pushed down), the `TreeRender` display format does not show it, while `Default`/`Verbose` formats do. This makes `EXPLAIN FORMAT TREE` output incomplete for queries with LIMIT pushed into FilterExec. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
101be80 to
851055f
Compare
xudong963
approved these changes
Mar 30, 2026
Contributor
Author
|
Thanks @xiedeyantu @2010YOUY01 @xudong963 for review, merged now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #21229
Rationale for this change
When
FilterExechas afetchvalue (from limit pushdown),EXPLAIN FORMAT TREEdoes not show it, whileEXPLAIN(default/verbose) correctly showsfetch=N. This makes the tree format output incomplete and can be confusing when debugging query plans.What changes are included in this PR?
fetchdisplay toFilterExec::fmt_asforTreeRenderformatfetchappears in tree format outputHow are these changes tested?
limitsqllogictests passfetchis shown inEXPLAIN FORMAT TREEAre these changes safe?
Yes — display-only change, no execution logic affected.