Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/grammar/impala/ImpalaSqlLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ KW_LOAD : 'LOAD';
KW_LOCALTIME : 'LOCALTIME';
KW_LOCALTIMESTAMP : 'LOCALTIMESTAMP';
KW_METADATA : 'METADATA';
KW_MAP : 'MAP';
KW_MINUTE : 'MINUTE';
KW_MINUTES : 'MINUTES';
KW_MONTH : 'MONTH';
Expand Down Expand Up @@ -213,7 +212,6 @@ KW_SHOW : 'SHOW';
KW_SHUTDOWN : 'SHUTDOWN';
KW_SOME : 'SOME';
KW_STATS : 'STATS';
KW_STRUCT : 'STRUCT';
KW_STRAIGHT_JOIN : 'STRAIGHT_JOIN';
KW_SUBSTRING : 'SUBSTRING';
KW_SYSTEM : 'SYSTEM';
Expand Down Expand Up @@ -259,6 +257,26 @@ KW_REFERENCES : 'REFERENCES';
KW_NOVALIDATE : 'NOVALIDATE';
KW_RELY : 'RELY';

// dataType
KW_BINARY : 'BINARY';
KW_BIGINT : 'BIGINT';
KW_BOOLEAN : 'BOOLEAN';
KW_CHAR : 'CHAR';
KW_DATE : 'DATE';
KW_DECIMAL : 'DECIMAL';
KW_DOUBLE : 'DOUBLE';
KW_INT : 'INT';
KW_MAP : 'MAP';
KW_REAL : 'REAL';
KW_SMALLINT : 'SMALLINT';
KW_FLOAT : 'FLOAT';
KW_STRING : 'STRING';
KW_STRUCT : 'STRUCT';
KW_TIMESTAMP : 'TIMESTAMP';
KW_TINYINT : 'TINYINT';
KW_VARCHAR : 'VARCHAR';
KW_COMPLEX : 'COMPLEX';

STATS_NUMDVS : '\'NUMDVS\'';
STATS_NUMNULLS : '\'NUMNULLS\'';
STATS_AVGSIZE : '\'AVGSIZE\'';
Expand Down
29 changes: 26 additions & 3 deletions src/grammar/impala/ImpalaSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ computeStats
;

computeIncrementalStats
: KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION expression)?
: KW_COMPUTE KW_INCREMENTAL KW_STATS tableNamePath (KW_PARTITION LPAREN expression RPAREN)?
;

dropStatement
Expand Down Expand Up @@ -1003,8 +1003,30 @@ type
: type KW_ARRAY
| KW_ARRAY LT type GT
| KW_MAP LT type COMMA type GT
| KW_STRUCT LT identifier COLON type (COMMA identifier COLON type)* GT
| baseType (LPAREN typeParameter (COMMA typeParameter)* RPAREN)?
| KW_STRUCT LT identifier type (COMMA identifier type)* GT
| (baseType | dataType) (LPAREN typeParameter (COMMA typeParameter)* RPAREN)?
;

dataType
: KW_ARRAY
| KW_BINARY
| KW_BIGINT
| KW_BOOLEAN
| KW_CHAR
| KW_DATE
| KW_DECIMAL
| KW_DOUBLE
| KW_FLOAT
| KW_INT
| KW_MAP
| KW_REAL
| KW_SMALLINT
| KW_STRING
| KW_STRUCT
| KW_TIMESTAMP
| KW_TINYINT
| KW_VARCHAR
| KW_COMPLEX
;

typeParameter
Expand Down Expand Up @@ -1125,6 +1147,7 @@ nonReserved
// IMPORTANT: this rule must only contain tokens. Nested rules are not supported. See SqlParser.exitNonReserved
: KW_BERNOULLI
| KW_DAY
| KW_DATE
| KW_DAYS
| KW_EXCLUDING
| KW_HOUR
Expand Down
62 changes: 55 additions & 7 deletions src/lib/impala/ImpalaSqlLexer.interp

Large diffs are not rendered by default.

Loading