-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Project sort expressions in StreamingTable #19719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project sort expressions in StreamingTable #19719
Conversation
kosiew
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment explaining the projection adjustment will be helpful here
|
Shall we merge it? Thank you for the review @kosiew |
|
Yes. I just pushed the requested code comments, and I'll merge after CI finishes. |
|
🎉 -- keeping the code flowing |
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