add impala lifecycle

This commit is contained in:
HSunboy 2019-12-25 10:58:12 +08:00
parent 67b3f68113
commit a486270ab1
8 changed files with 1035 additions and 1034 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "dt-sql-parser", "name": "dt-sql-parser",
"version": "2.0.10", "version": "2.0.11",
"description": "sql,hive,parser ", "description": "sql,hive,parser ",
"keywords": [ "keywords": [
"hive", "hive",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -67,7 +67,6 @@
<hive>'USER' { return '<hive>USER'; } <hive>'USER' { return '<hive>USER'; }
<hive>'USING' { return '<hive>USING'; } <hive>'USING' { return '<hive>USING'; }
<hive>'VIEWS' { return '<hive>VIEWS'; } <hive>'VIEWS' { return '<hive>VIEWS'; }
<hive>'LIFECYCLE' { return '<hive>LIFECYCLE'; }
// Non-reserved Keywords // Non-reserved Keywords
<hive>'ABORT' { parser.determineCase(yytext); return '<hive>ABORT'; } <hive>'ABORT' { parser.determineCase(yytext); return '<hive>ABORT'; }
@ -331,6 +330,7 @@
<between>'AND' { this.popState(); return 'BETWEEN_AND'; } <between>'AND' { this.popState(); return 'BETWEEN_AND'; }
// Reserved Keywords // Reserved Keywords
'LIFECYCLE' { return 'LIFECYCLE'; }
'ALL' { return 'ALL'; } 'ALL' { return 'ALL'; }
'ALTER' { parser.determineCase(yytext); parser.addStatementTypeLocation('ALTER', yylloc, yy.lexer.upcomingInput()); return 'ALTER'; } 'ALTER' { parser.determineCase(yytext); parser.addStatementTypeLocation('ALTER', yylloc, yy.lexer.upcomingInput()); return 'ALTER'; }
'AND' { return 'AND'; } 'AND' { return 'AND'; }

View File

@ -157,7 +157,7 @@ TableDefinition
LifeCyclePart LifeCyclePart
: :
| '<hive>LIFECYCLE' 'UNSIGNED_INTEGER' | 'LIFECYCLE' 'UNSIGNED_INTEGER'
; ;
TableDefinition_EDIT TableDefinition_EDIT

View File

@ -48,7 +48,8 @@ describe('syntax test', () => {
WITH SERDEPROPERTIES ('field.delim'=',', 'line.delim'='\n', 'serialization.format'=',') WITH SERDEPROPERTIES ('field.delim'=',', 'line.delim'='\n', 'serialization.format'=',')
STORED AS TEXTFILE STORED AS TEXTFILE
LOCATION 'hdfs://kudu1' LOCATION 'hdfs://kudu1'
TBLPROPERTIES ('last_modified_by'='anonymous', 'last_modified_time'='1577082098', 'skip.header.line.count'='1')`; TBLPROPERTIES ('last_modified_by'='anonymous', 'last_modified_time'='1577082098', 'skip.header.line.count'='1')
lifecycle 888`;
const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Impala); const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Impala);
expect(result).toBe(false); expect(result).toBe(false);
}) })