mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-09 21:42:05 +00:00
Fix: GROUPING SETS accept values without parenthesis (#1867)
This commit is contained in:
parent
80d47eee84
commit
394a534486
2 changed files with 39 additions and 1 deletions
|
@ -10111,7 +10111,13 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
if self.parse_keywords(&[Keyword::GROUPING, Keyword::SETS]) {
|
||||
self.expect_token(&Token::LParen)?;
|
||||
let result = self.parse_comma_separated(|p| p.parse_tuple(true, true))?;
|
||||
let result = self.parse_comma_separated(|p| {
|
||||
if p.peek_token_ref().token == Token::LParen {
|
||||
p.parse_tuple(true, true)
|
||||
} else {
|
||||
Ok(vec![p.parse_expr()?])
|
||||
}
|
||||
})?;
|
||||
self.expect_token(&Token::RParen)?;
|
||||
modifiers.push(GroupByWithModifier::GroupingSets(Expr::GroupingSets(
|
||||
result,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue