-
Notifications
You must be signed in to change notification settings - Fork 525
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
feat(parser): Adds support for parsing order by in functions #3566
Conversation
Co-authored-by: Yuhao Su <31772373+yuhao-su@users.noreply.github.com>
Co-authored-by: Yuhao Su <31772373+yuhao-su@users.noreply.github.com>
…rity-data/risingwave into steven/parsing-agg-order
@@ -561,7 +561,7 @@ impl Parser { | |||
pub fn parse_function(&mut self, name: ObjectName) -> Result<Expr, ParserError> { | |||
self.expect_token(&Token::LParen)?; | |||
let distinct = self.parse_all_or_distinct()?; | |||
let args = self.parse_optional_args()?; | |||
let (args, order_by) = self.parse_optional_args()?; |
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.
Do we need to check the function name before deciding whether ORDER BY
is acceptable?
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.
I think it is ok to accept ORDER BY
without checking the function name since Postgresql seems to do the same.
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.
The check can be done in binder.
Codecov Report
@@ Coverage Diff @@
## main #3566 +/- ##
=======================================
Coverage 74.38% 74.38%
=======================================
Files 771 771
Lines 108701 108714 +13
=======================================
+ Hits 80861 80872 +11
- Misses 27840 27842 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
rest lgtm
@@ -561,7 +561,7 @@ impl Parser { | |||
pub fn parse_function(&mut self, name: ObjectName) -> Result<Expr, ParserError> { | |||
self.expect_token(&Token::LParen)?; | |||
let distinct = self.parse_all_or_distinct()?; | |||
let args = self.parse_optional_args()?; | |||
let (args, order_by) = self.parse_optional_args()?; |
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.
The check can be done in binder.
* feat(parser): Add support for parsing ORDER BY in agg functions * feat(expr): Fix typo Co-authored-by: Yuhao Su <31772373+yuhao-su@users.noreply.github.com> * feat(parser): Fix typo Co-authored-by: Yuhao Su <31772373+yuhao-su@users.noreply.github.com> * feat(parser): Fix test * feat(parser): Fix additional test * feat(parser): Throw error when using order by for table functions Co-authored-by: Yuhao Su <31772373+yuhao-su@users.noreply.github.com>
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
Checklist
./risedev check
(or alias,./risedev c
)Refer to a related PR or issue link (optional)
Fixes #3434