modify sparkSql grammar

This commit is contained in:
xigua 2020-12-17 16:35:49 +08:00
parent 8418c42c26
commit 084efe1aab
10 changed files with 8424 additions and 8237 deletions

View File

@ -75,7 +75,11 @@ program
;
singleStatement
: statement ';'* EOF
: (statement SEMICOLON? | emptyStatement)*
;
emptyStatement
: SEMICOLON
;
singleExpression
@ -1741,6 +1745,7 @@ AMPERSAND: '&';
PIPE: '|';
CONCAT_PIPE: '||';
HAT: '^';
SEMICOLON: ';';
STRING
: '\'' ( ~('\''|'\\') | ('\\' .) )* '\''

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,15 @@ SparkSqlListener.prototype.exitSingleStatement = function(ctx) {
};
// Enter a parse tree produced by SparkSqlParser#emptyStatement.
SparkSqlListener.prototype.enterEmptyStatement = function(ctx) {
};
// Exit a parse tree produced by SparkSqlParser#emptyStatement.
SparkSqlListener.prototype.exitEmptyStatement = function(ctx) {
};
// Enter a parse tree produced by SparkSqlParser#singleExpression.
SparkSqlListener.prototype.enterSingleExpression = function(ctx) {
};

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,12 @@ SparkSqlVisitor.prototype.visitSingleStatement = function(ctx) {
};
// Visit a parse tree produced by SparkSqlParser#emptyStatement.
SparkSqlVisitor.prototype.visitEmptyStatement = function(ctx) {
return this.visitChildren(ctx);
};
// Visit a parse tree produced by SparkSqlParser#singleExpression.
SparkSqlVisitor.prototype.visitSingleExpression = function(ctx) {
return this.visitChildren(ctx);

View File

@ -282,7 +282,6 @@ SELECT * FROM t2;`,
`SHOW PARTITIONS customer;`,
`SHOW PARTITIONS customer PARTITION (city = 'San Jose');`,
`SHOW TABLE EXTENDED LIKE 'employee';`,
// `SHOW TABLE EXTENDED IN default LIKE 'empl*' PARTITION ('grade=1');`,
`SHOW TABLES;`,
`SHOW TABLES FROM userdb;`,
`SHOW TABLES LIKE 'sam*|suj';`,