add lateral table support

This commit is contained in:
HSunboy 2019-10-08 17:22:35 +08:00
parent 3b6c224e0e
commit eb0d32751b
10 changed files with 6877 additions and 6684 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

View File

@ -238,21 +238,22 @@ ANTI=237
LOCAL=238
INPATH=239
WATERMARK=240
STRING=241
BIGINT_LITERAL=242
SMALLINT_LITERAL=243
TINYINT_LITERAL=244
INTEGER_VALUE=245
DECIMAL_VALUE=246
DOUBLE_LITERAL=247
BIGDECIMAL_LITERAL=248
IDENTIFIER=249
BACKQUOTED_IDENTIFIER=250
SIMPLE_COMMENT=251
BRACKETED_EMPTY_COMMENT=252
BRACKETED_COMMENT=253
WS=254
UNRECOGNIZED=255
UNNEST=241
STRING=242
BIGINT_LITERAL=243
SMALLINT_LITERAL=244
TINYINT_LITERAL=245
INTEGER_VALUE=246
DECIMAL_VALUE=247
DOUBLE_LITERAL=248
BIGDECIMAL_LITERAL=249
IDENTIFIER=250
BACKQUOTED_IDENTIFIER=251
SIMPLE_COMMENT=252
BRACKETED_EMPTY_COMMENT=253
BRACKETED_COMMENT=254
WS=255
UNRECOGNIZED=256
'('=1
')'=2
'.'=3
@ -485,4 +486,5 @@ UNRECOGNIZED=255
'LOCAL'=238
'INPATH'=239
'WATERMARK'=240
'/**/'=252
'UNNEST'=241
'/**/'=253

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -238,21 +238,22 @@ ANTI=237
LOCAL=238
INPATH=239
WATERMARK=240
STRING=241
BIGINT_LITERAL=242
SMALLINT_LITERAL=243
TINYINT_LITERAL=244
INTEGER_VALUE=245
DECIMAL_VALUE=246
DOUBLE_LITERAL=247
BIGDECIMAL_LITERAL=248
IDENTIFIER=249
BACKQUOTED_IDENTIFIER=250
SIMPLE_COMMENT=251
BRACKETED_EMPTY_COMMENT=252
BRACKETED_COMMENT=253
WS=254
UNRECOGNIZED=255
UNNEST=241
STRING=242
BIGINT_LITERAL=243
SMALLINT_LITERAL=244
TINYINT_LITERAL=245
INTEGER_VALUE=246
DECIMAL_VALUE=247
DOUBLE_LITERAL=248
BIGDECIMAL_LITERAL=249
IDENTIFIER=250
BACKQUOTED_IDENTIFIER=251
SIMPLE_COMMENT=252
BRACKETED_EMPTY_COMMENT=253
BRACKETED_COMMENT=254
WS=255
UNRECOGNIZED=256
'('=1
')'=2
'.'=3
@ -485,4 +486,5 @@ UNRECOGNIZED=255
'LOCAL'=238
'INPATH'=239
'WATERMARK'=240
'/**/'=252
'UNNEST'=241
'/**/'=253

File diff suppressed because one or more lines are too long

View File

@ -82,6 +82,14 @@ describe('syntax test', () => {
expect(result.token.start).toBe(0);
expect(result.token.stop).toBe(4);
});
test('test lateral table', () => {
const sql = `select
id
FROM
userTable, LATERAL table(json(mess)) as t(ord, name_id);`;
const result = flinksqlParser(sql);
expect(result).toBeNull();
});
test('syntax error', () => {
const sql = 'select id from user.id; \nselect id from us*er.id; \nselect id from *user.id;';
const result = flinksqlParser(sql);