minor: fix to support scalars#8559
Merged
mustafasrepo merged 2 commits intoapache:mainfrom Dec 18, 2023
Merged
Conversation
Contributor
Author
|
@mustafasrepo please review |
mustafasrepo
approved these changes
Dec 17, 2023
Contributor
mustafasrepo
left a comment
There was a problem hiding this comment.
LGTM! Thanks @comphead. I have one minor comment. However It is not important for this PR.
| .filter(|e| !matches!(e, sqlparser::ast::Expr::Value { .. },)) | ||
| .map(|e| self.sql_expr_to_logical_expr(e, schema, planner_context)) | ||
| .collect::<Result<Vec<_>>>()?; | ||
| let mut order_by = self.order_by_to_sort_expr( |
Contributor
There was a problem hiding this comment.
According to test it seems that we have no problem with ScalarValues inside window order_by. However, I think we can apply similar filtering done for window.partition_by to the window.order_by.
alamb
approved these changes
Dec 17, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
Looks good to me -- thank you @comphead and @mustafasrepo
| 1 | ||
| 1 | ||
|
|
||
| # support scalar value in both ORDER BY and PARTITION BY, RANK function |
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?
Closes #8386 .
Rationale for this change
Support scalars for
PARTITION BYclause to avoidExpects PARTITION BY expression to be orderederror.What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
No