add empty sql support
This commit is contained in:
parent
54d44dccc5
commit
325a2db4cf
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dt-sql-parser",
|
"name": "dt-sql-parser",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"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
@ -67,6 +67,15 @@ describe('syntax test', () => {
|
|||||||
const result = flinksqlParser(sql);
|
const result = flinksqlParser(sql);
|
||||||
expect(result).toBeNull();
|
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', () => {
|
test('syntax error', () => {
|
||||||
const sql = 'select id from user.id; \nselect id from us*er.id; \nselect id from *user.id;';
|
const sql = 'select id from user.id; \nselect id from us*er.id; \nselect id from *user.id;';
|
||||||
const result = flinksqlParser(sql);
|
const result = flinksqlParser(sql);
|
||||||
|
Loading…
Reference in New Issue
Block a user