-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add support for Hive dialect GROUPING SETS. #1539
Conversation
… SETS ((a, b), (a, c))`
@@ -2734,6 +2734,19 @@ GroupByElement GroupByColumnReferences(): | |||
<K_GROUP> <K_BY> | |||
( LOOKAHEAD(2) ( | |||
"(" ")" { groupBy.withUsingBrackets(true); } | |||
( |
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.
Could you more compress this production? There are three nearly identical copies of this inserted block.
+ " Sometable\n" | ||
+ "GROUP BY C1, C2, C3 GROUPING SETS ((C1, C2), (C1, C2, C3), ())"; | ||
|
||
statement = CCJSqlParserUtil.parse(sql); |
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.
This hole parsing process is done using assertSqlCanBeParsedAndDeparsed. So you could skip it.
I still do not get the difference to our current grouping sets variant. Could you explain more specific what you want to achieve? |
JsqlParser could not parse It's an equivalent of Presto's |
Could you change the test method, like I requested? |
The test method is changed now. |
Hive dialect requires all columns appear in GROUPING SETS clause to be in GROUP BY clause.