add empty sql support

This commit is contained in:
HSunboy 2019-09-25 16:48:19 +08:00
parent 54d44dccc5
commit 325a2db4cf
4 changed files with 3906 additions and 3842 deletions

View File

@ -1,6 +1,6 @@
{
"name": "dt-sql-parser",
"version": "2.0.0",
"version": "2.0.1",
"description": "sql,hive,parser ",
"keywords": [
"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,6 +67,15 @@ describe('syntax test', () => {
const result = flinksqlParser(sql);
expect(result).toBeNull();
});
test('sql comment', () => {
const sql = `-- name asf
-- type FlinkSQL
-- author admin@dtstack.com
-- create time 2019-06-12 18:11:05
-- desc `;
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);