Add support for Hive dialect GROUPING SETS.#1539
Conversation
… SETS ((a, b), (a, c))`
| <K_GROUP> <K_BY> | ||
| ( LOOKAHEAD(2) ( | ||
| "(" ")" { groupBy.withUsingBrackets(true); } | ||
| ( |
There was a problem hiding this comment.
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.
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.