improved sql parser.

This commit is contained in:
wenshao
2017-08-10 14:50:10 +08:00
parent 1c900720d8
commit 52bb3da616
4 changed files with 90 additions and 12 deletions
@@ -284,6 +284,11 @@ public class SQLSelectParser extends SQLParser {
accept(Token.LPAREN);
groupBy.setWithRollUp(true);
}
if (identifierEquals("CUBE")) {
lexer.nextToken();
accept(Token.LPAREN);
groupBy.setWithCube(true);
}
for (;;) {
SQLExpr item = parseGroupByItem();
@@ -297,7 +302,7 @@ public class SQLSelectParser extends SQLParser {
lexer.nextToken();
}
if (groupBy.isWithRollUp()) {
if (groupBy.isWithRollUp() || groupBy.isWithCube()) {
accept(Token.RPAREN);
}