Project sort expressions in StreamingTable#19719
Merged
timsaucer merged 3 commits intoapache:mainfrom Jan 16, 2026
Merged
Conversation
kosiew
approved these changes
Jan 14, 2026
Comment on lines
+110
to
+115
| if let Some(p) = projection { | ||
| let schema = Arc::new(self.schema.project(p)?); | ||
| LexOrdering::new(original_sort_exprs) | ||
| .and_then(|lex_ordering| project_ordering(&lex_ordering, &schema)) | ||
| .map(|lex_ordering| lex_ordering.to_vec()) | ||
| .unwrap_or_default() |
Contributor
There was a problem hiding this comment.
A comment explaining the projection adjustment will be helpful here
Contributor
|
Shall we merge it? Thank you for the review @kosiew |
Member
Author
|
Yes. I just pushed the requested code comments, and I'll merge after CI finishes. |
Member
Author
Contributor
|
🎉 -- keeping the code flowing |
de-bgunter
pushed a commit
to de-bgunter/datafusion
that referenced
this pull request
Mar 24, 2026
## Which issue does this PR close? - Closes apache#19717 ## Rationale for this change If we have a `StreamingTable` that has both physical sort expressions and projection, we will get errors when trying to execute the plan if the sort expressions are not included in the projection. ## What changes are included in this PR? When we have both projection and physical sort expressions, project the schema and the sort expressions. ## Are these changes tested? Unit test added. ## Are there any user-facing changes? No --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
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?
StreamingTabledoes not project physical sort expressions #19717Rationale for this change
If we have a
StreamingTablethat has both physical sort expressions and projection, we will get errors when trying to execute the plan if the sort expressions are not included in the projection.What changes are included in this PR?
When we have both projection and physical sort expressions, project the schema and the sort expressions.
Are these changes tested?
Unit test added.
Are there any user-facing changes?
No