diff --git a/test/parser/hive/syntax/dropStatement.test.ts b/test/parser/hive/syntax/dropStatement.test.ts index d2301f1..b9d181b 100644 --- a/test/parser/hive/syntax/dropStatement.test.ts +++ b/test/parser/hive/syntax/dropStatement.test.ts @@ -4,15 +4,20 @@ import { readSQL } from '../../../helper'; const parser = new HiveSQL(); const features = { - indexes: readSQL(__dirname, 'dropIndex.sql'), + drops: readSQL(__dirname, 'drop.sql'), + reloads: readSQL(__dirname, 'reload.sql') }; describe('Hive Drop Syntax Tests', () => { - describe('DROP INDEX', () => { - features.indexes.forEach((index) => { - it(index, () => { - expect(parser.validate(index).length).toBe(0); - }); + features.drops.forEach((drop) => { + it(drop, () => { + expect(parser.validate(drop).length).toBe(0); + }); + }); + + features.reloads.forEach((reload) => { + it(reload, () => { + expect(parser.validate(reload).length).toBe(0); }); }); }); diff --git a/test/parser/hive/syntax/fixtures/drop.sql b/test/parser/hive/syntax/fixtures/drop.sql new file mode 100644 index 0000000..0145002 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/drop.sql @@ -0,0 +1,41 @@ +-- Drop Database +DROP SCHEMA schema1 ; + +DROP DATABASE IF EXISTS mydb1 RESTRICT; + +DROP DATABASE IF EXISTS mydb1 CASCADE; + +-- Drop Connector +DROP CONNECTOR connector1; + +DROP CONNECTOR IF EXISTS connector1; + +-- Drop View +DROP VIEW view1; + +DROP VIEW IF EXISTS mydb1.view2; + +DROP MATERIALIZED VIEW materialized_view_name; + +-- Drop Table +DROP TABLE tb1; + +DROP TABLE IF EXISTS db1.tb2 PURGE; + +-- Drop Macro +DROP TEMPORARY MACRO macro1; + +DROP TEMPORARY MACRO IF EXISTS macro2; + +-- Drop Role +DROP ROLE `admin`; + +-- Drop Index +DROP INDEX table01_index ON table01; + +DROP INDEX IF EXISTS table02_index ON table02; + +-- Drop Function +DROP FUNCTION func1; + +DROP FUNCTION IF EXISTS func2; diff --git a/test/parser/hive/syntax/fixtures/dropIndex.sql b/test/parser/hive/syntax/fixtures/dropIndex.sql deleted file mode 100644 index 95aad1b..0000000 --- a/test/parser/hive/syntax/fixtures/dropIndex.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP INDEX table01_index ON table01; - -DROP INDEX IF EXISTS table02_index ON table02; diff --git a/test/parser/hive/syntax/fixtures/reload.sql b/test/parser/hive/syntax/fixtures/reload.sql new file mode 100644 index 0000000..473ad13 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/reload.sql @@ -0,0 +1,3 @@ +RELOAD FUNCTION; + +RELOAD FUNCTIONS;