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 singleStatement
: statement ';'* EOF : (statement SEMICOLON? | emptyStatement)*
;
emptyStatement
: SEMICOLON
; ;
singleExpression singleExpression
@ -1741,6 +1745,7 @@ AMPERSAND: '&';
PIPE: '|'; PIPE: '|';
CONCAT_PIPE: '||'; CONCAT_PIPE: '||';
HAT: '^'; HAT: '^';
SEMICOLON: ';';
STRING 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. // Enter a parse tree produced by SparkSqlParser#singleExpression.
SparkSqlListener.prototype.enterSingleExpression = function(ctx) { 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. // Visit a parse tree produced by SparkSqlParser#singleExpression.
SparkSqlVisitor.prototype.visitSingleExpression = function(ctx) { SparkSqlVisitor.prototype.visitSingleExpression = function(ctx) {
return this.visitChildren(ctx); return this.visitChildren(ctx);

View File

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