fix hive insert syntax

This commit is contained in:
HSunboy 2020-03-26 11:47:47 +08:00
parent 364dc5fcae
commit 0c5f6164f4
7 changed files with 697 additions and 692 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": "3.0.2", "version": "3.0.3",
"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

@ -255,7 +255,7 @@ GenericInsert_EDIT
InsertValuesList InsertValuesList
: ParenthesizedRowValuesList : ParenthesizedRowValuesList
| RowValuesList ',' ParenthesizedRowValuesList | ParenthesizedRowValuesList ',' ParenthesizedRowValuesList
; ;
ParenthesizedRowValuesList ParenthesizedRowValuesList

View File

@ -76,6 +76,11 @@ describe('syntax test', () => {
const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Hive); const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Hive);
expect(result).toBe(false); expect(result).toBe(false);
}); });
test('insert', () => {
const sql = `insert into table user1 values (1, 'a'), (2, 'b')`;
const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Hive);
expect(result).toBe(false);
});
test('select table should not be null', () => { test('select table should not be null', () => {
const sql = 'select id,name from '; const sql = 'select id,name from ';
const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Hive) as SyntaxResult; const result = parser.parseSyntax([sql, ''], dtSqlParser.parser.sqlType.Hive) as SyntaxResult;