From 6f7a59775cbfb4e44ff297f0b3532cdb038d9dae Mon Sep 17 00:00:00 2001 From: hayden Date: Fri, 7 Jul 2023 17:04:37 +0800 Subject: [PATCH 1/6] test: hivesql alter syntax unit tests --- .../parser/hive/syntax/alterStatement.test.ts | 36 +++++ .../hive/syntax/fixtures/alterConnector.sql | 7 + .../hive/syntax/fixtures/alterDatabase.sql | 19 +++ .../hive/syntax/fixtures/alterTable.sql | 123 ++++++++++++++++++ .../parser/hive/syntax/fixtures/alterView.sql | 9 ++ 5 files changed, 194 insertions(+) create mode 100644 test/parser/hive/syntax/fixtures/alterConnector.sql create mode 100644 test/parser/hive/syntax/fixtures/alterDatabase.sql create mode 100644 test/parser/hive/syntax/fixtures/alterTable.sql create mode 100644 test/parser/hive/syntax/fixtures/alterView.sql diff --git a/test/parser/hive/syntax/alterStatement.test.ts b/test/parser/hive/syntax/alterStatement.test.ts index eb81e3ef..ca5599a1 100644 --- a/test/parser/hive/syntax/alterStatement.test.ts +++ b/test/parser/hive/syntax/alterStatement.test.ts @@ -4,10 +4,38 @@ import { readSQL } from '../../../helper'; const parser = new HiveSQL(); const features = { + databases: readSQL(__dirname, 'alterDatabase.sql'), + connectors: readSQL(__dirname, 'alterConnector.sql'), + tables: readSQL(__dirname, 'alterTable.sql'), indexes: readSQL(__dirname, 'alterIndex.sql'), + views: readSQL(__dirname, 'alterView.sql'), }; describe('Hive Alter Syntax Tests', () => { + describe('ALTER DATABASE', () => { + features.databases.forEach((db) => { + it(db, () => { + expect(parser.validate(db).length).toBe(0); + }); + }); + }); + + describe('ALTER CONNECTOR', () => { + features.connectors.forEach((ctors) => { + it(ctors, () => { + expect(parser.validate(ctors).length).toBe(0); + }); + }); + }); + + describe('ALTER TABLE', () => { + features.tables.forEach((tb) => { + it(tb, () => { + expect(parser.validate(tb).length).toBe(0); + }); + }); + }); + describe('ALTER INDEX', () => { features.indexes.forEach((index) => { it(index, () => { @@ -15,4 +43,12 @@ describe('Hive Alter Syntax Tests', () => { }); }); }); + + describe('ALTER VIEW', () => { + features.views.forEach((view) => { + it(view, () => { + expect(parser.validate(view).length).toBe(0); + }); + }); + }); }); diff --git a/test/parser/hive/syntax/fixtures/alterConnector.sql b/test/parser/hive/syntax/fixtures/alterConnector.sql new file mode 100644 index 00000000..45dd85ea --- /dev/null +++ b/test/parser/hive/syntax/fixtures/alterConnector.sql @@ -0,0 +1,7 @@ +ALTER CONNECTOR mysql_local SET DCPROPERTIES ('creator'='hayden','date'='2023-07-07'); + +ALTER CONNECTOR pg_local SET URL 'jdbc:postgresql://localhost:5400'; + +ALTER CONNECTOR hbase_local SET OWNER USER `hayden`; + +ALTER CONNECTOR hbase_local SET OWNER ROLE `admin`; \ No newline at end of file diff --git a/test/parser/hive/syntax/fixtures/alterDatabase.sql b/test/parser/hive/syntax/fixtures/alterDatabase.sql new file mode 100644 index 00000000..cdba438b --- /dev/null +++ b/test/parser/hive/syntax/fixtures/alterDatabase.sql @@ -0,0 +1,19 @@ +ALTER DATABASE mydb1 SET DBPROPERTIES ('creator'='hayden','date'='2023-07-07'); + +ALTER SCHEMA myschema1 SET DBPROPERTIES ('creator'='hayden','date'='2023-07-07'); + +ALTER DATABASE database_name SET OWNER USER hayden; + +ALTER SCHEMA database_name SET OWNER ROLE `admin`; + +ALTER DATABASE database_name SET OWNER USER jack; + +ALTER SCHEMA database_name SET OWNER ROLE ddladmin; + +ALTER DATABASE database_name SET LOCATION '/myhive/mydb'; + +ALTER SCHEMA database_name SET LOCATION '/myhive/myschema'; + +ALTER DATABASE database_name SET MANAGEDLOCATION '/myhive/myinnerdb'; + +ALTER SCHEMA database_name SET MANAGEDLOCATION '/myhive/myinnerschema'; \ No newline at end of file diff --git a/test/parser/hive/syntax/fixtures/alterTable.sql b/test/parser/hive/syntax/fixtures/alterTable.sql new file mode 100644 index 00000000..92a4fbe8 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/alterTable.sql @@ -0,0 +1,123 @@ +-- Rename Table +ALTER TABLE tbl1 RENAME TO tbl2; + +-- Alter Table Properties +ALTER TABLE mydb.tb22 SET TBLPROPERTIES ('creator'='hayden'); + +-- Alter Table Comment +ALTER TABLE mydb.tb22 SET TBLPROPERTIES ('comment' = 'This is a new comment!'); + +-- Add SerDe Properties +ALTER TABLE employee_tb SET SERDE 'com.dt.test'; + +ALTER TABLE employee_tb +SET SERDE 'com.dt.test' +WITH SERDEPROPERTIES ('field.delim' = ','); + +ALTER TABLE sale_rbl +PARTITION ( + `pt1`='1' +) +SET SERDEPROPERTIES ('field.delim' = ','); + +-- Remove SerDe Properties +ALTER TABLE sale_rbl UNSET SERDEPROPERTIES ('field.delim'); + +-- Alter Table Storage Properties +ALTER TABLE students +CLUSTERED BY (id, `name`, age) +SORTED BY (age) +INTO 2 BUCKETS; + +-- Alter Table Skewed or Stored as Directories +ALTER TABLE dt_shop +SKEWED BY (id, cost) +ON (('id',1), ('cost', 1000)); + +ALTER TABLE dt_shop +SKEWED BY (id, cost) +ON (('id',1), ('cost', 1000)) +STORED AS DIRECTORIES; + +-- Alter Table Not Skewed +ALTER TABLE dt_shop NOT SKEWED; + +-- Alter Table Not Stored as Directories +ALTER TABLE dt_shop NOT STORED AS DIRECTORIES; + +-- Alter Table Set Skewed Location +ALTER TABLE dt_shop SET SKEWED LOCATION ('id'='location1', "cost"="loaction2" ); + +-- Alter Table Constraints +ALTER TABLE tbl1 +ADD CONSTRAINT const1 +PRIMARY KEY (id) +DISABLE NOVALIDATE; + +ALTER TABLE tbl2 +ADD CONSTRAINT const2 +FOREIGN KEY (id, `name`) +REFERENCES refer_tb(rid, rname) +DISABLE NOVALIDATE RELY; + +ALTER TABLE tbl3 +ADD CONSTRAINT const3 +UNIQUE (`name`, `age`) +DISABLE NOVALIDATE; + +ALTER TABLE tbl4 +CHANGE COLUMN `col1` `col2` STRING CONSTRAINT const4 +NOT NULL ENABLE; + +ALTER TABLE tbl5 +CHANGE COLUMN `col3` `col4` INT CONSTRAINT const5 +DEFAULT 998 ENABLE; + +ALTER TABLE tbl6 +CHANGE COLUMN col5 col6 MAP CONSTRAINT const6 +CHECK (1) ENABLE; + +ALTER TABLE tbl7 DROP CONSTRAINT remove_const; + +-- Alter Partition +ALTER TABLE add_par_tbl +ADD IF NOT EXISTS +PARTITION (`pt1` = 1) LOCATION '/pat/loc' +PARTITION (`pt2` = 2, `pt3`=3) LOCATION '/pat/loc' + +-- Rename Partition +ALTER TABLE ren_par_tbl +PARTITION (`pt1`=1) +RENAME TO PARTITION (`pt2`=2) ; + +-- Exchange Partition +ALTER TABLE ex_part_tbl2 +EXCHANGE PARTITION (`pt1`=1) +WITH TABLE ex_part_tbl1; + +-- Recover Partitions +MSCK TABLE rec_tbl; + +MSCK REPAIR TABLE rec_tbl SYNC PARTITIONS; + +-- Drop Partitions +ALTER TABLE dr_tbl1 DROP PARTITION (`pt1`=1); + +ALTER TABLE dr_tbl2 DROP IF EXISTS PARTITION (`pt2`=2) PURGE; + +-- ALTER TABLE dr_tbl2 DROP IF EXISTS PARTITION (`pt2`=2) IGNORE PROTECTION PURGE; + +-- Archive Partition +ALTER TABLE arch_pt_tbl1 ARCHIVE PARTITION (`pt1`=1); + +ALTER TABLE arch_pt_tbl2 UNARCHIVE PARTITION (`pt2`=2) ; + +-- Add/Replace Columns +ALTER TABLE rp_col_tbl1 ADD COLUMNS (`col1` INT); + +ALTER TABLE rp_col_tbl2 REPLACE COLUMNS (`col2` INT); + +ALTER TABLE rp_col_tbl2 +PARTITION (`pt1`=1) +ADD COLUMNS (`col3` INT COMMENT 'a new col') +CASCADE; diff --git a/test/parser/hive/syntax/fixtures/alterView.sql b/test/parser/hive/syntax/fixtures/alterView.sql new file mode 100644 index 00000000..b71a4184 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/alterView.sql @@ -0,0 +1,9 @@ +ALTER VIEW mydb.view1 SET TBLPROPERTIES ('author'='hayden','date'='2023-07-07') + +ALTER VIEW view2 +AS SELECT DISTINCT id, `name`, runtime + FROM task_tbl + WHERE type='hour'; + +ALTER MATERIALIZED VIEW myschema1.materialized_view_1 +ENABLE REWRITE; \ No newline at end of file From af1c640c9d5ec0783831d0e74d7b3a71fe9a487e Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:09:03 +0800 Subject: [PATCH 2/6] test: hivesql drop syntax unit tests --- test/parser/hive/syntax/dropStatement.test.ts | 17 +++++--- test/parser/hive/syntax/fixtures/drop.sql | 41 +++++++++++++++++++ .../parser/hive/syntax/fixtures/dropIndex.sql | 3 -- test/parser/hive/syntax/fixtures/reload.sql | 3 ++ 4 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 test/parser/hive/syntax/fixtures/drop.sql delete mode 100644 test/parser/hive/syntax/fixtures/dropIndex.sql create mode 100644 test/parser/hive/syntax/fixtures/reload.sql diff --git a/test/parser/hive/syntax/dropStatement.test.ts b/test/parser/hive/syntax/dropStatement.test.ts index d2301f1c..b9d181be 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 00000000..01450021 --- /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 95aad1b7..00000000 --- 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 00000000..473ad132 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/reload.sql @@ -0,0 +1,3 @@ +RELOAD FUNCTION; + +RELOAD FUNCTIONS; From 5f0a0851a690b6fbf28b0576d651447b48a93345 Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:09:28 +0800 Subject: [PATCH 3/6] test: hivesql show syntax unit tests --- test/parser/hive/syntax/fixtures/show.sql | 107 ++++++++++++++++++ test/parser/hive/syntax/showStatement.test.ts | 16 +++ 2 files changed, 123 insertions(+) create mode 100644 test/parser/hive/syntax/fixtures/show.sql create mode 100644 test/parser/hive/syntax/showStatement.test.ts diff --git a/test/parser/hive/syntax/fixtures/show.sql b/test/parser/hive/syntax/fixtures/show.sql new file mode 100644 index 00000000..5c163cb1 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/show.sql @@ -0,0 +1,107 @@ +-- Show Databases +SHOW SCHEMAS; + +SHOW DATABASES LIKE 'identifier_with_wildcards'; + +-- Show Connectors +SHOW CONNECTORS; + +-- Show Tables +SHOW TABLES; + +SHOW TABLES IN db1 'identifier_with_wildcards'; + +-- Show Views +SHOW VIEWS; + +SHOW VIEWS FROM schema1 LIKE 'pattern_with_wildcards'; + +SHOW MATERIALIZED VIEWS IN database2 LIKE 'pattern_with_wildcards'; + +-- Show Partitions +SHOW PARTITIONS tbl1; + +SHOW PARTITIONS table_name PARTITION(ds='2010-03-03', hr='12'); + +SHOW PARTITIONS databaseFoo.tableBar WHERE hr >= 10 AND ds='2010-03-03' ORDER BY hr DESC LIMIT 10; + +-- Show Table/Partition Extended +SHOW TABLE EXTENDED LIKE part_table; + +SHOW TABLE EXTENDED IN database3 LIKE 'identifier_with_wildcards' PARTITION(ds='2010-03-03', hr='12'); + +-- Show Table Properties +SHOW TBLPROPERTIES tblname; + +SHOW TBLPROPERTIES tblname("foo"); + +-- Show Create Table +SHOW CREATE TABLE db.tbl1; + +-- Show Indexes +-- SHOW INDEX ON idx_tbl; + +-- SHOW FORMATTED INDEXES ON idx_tbl2 FROM db_1; + +-- Show Columns +SHOW COLUMNS FROM tble; + +SHOW COLUMNS IN table_name FROM db_1 LIKE 'pattern_with_wildcards'; + +-- Show Functions +SHOW FUNCTIONS; + +SHOW FUNCTIONS LIKE ""; + +-- Show Locks +SHOW LOCKS tbl1; + +SHOW LOCKS tbl2 EXTENDED; + +SHOW LOCKS tbl3 PARTITION (ds='2010-03-03', hr='12'); + +SHOW LOCKS tbl4 PARTITION (ds='2010-03-03', hr='12') EXTENDED; + +SHOW LOCKS DATABASE db1; + +-- Show Conf +SHOW CONF 'conf1'; + +-- Show Transactions +SHOW TRANSACTIONS; + +-- Show Compactions +SHOW COMPACTIONS; + +SHOW COMPACTIONS DATABASE db1; + +SHOW COMPACTIONS tbl0; + +SHOW COMPACTIONS db1.tbl0 +PARTITION (p=101,day='Monday') +POOL 'pool0' +TYPE 'minor' +STATUS 'ready for clean' +ORDER BY cq_table DESC, cq_state +LIMIT 42; + +-- Show Roles +SHOW ROLES; + +SHOW CURRENT ROLES; + +-- Show Role Grant +SHOW ROLE GRANT USER user1; + +-- Show Principals +SHOW PRINCIPALS role1; + +-- Show Grant +SHOW GRANT USER ashutosh ON TABLE hivejiratable; + +SHOW GRANT ROLE role1 ON ALL; + +SHOW GRANT ON TABLE hivejiratable; + + + diff --git a/test/parser/hive/syntax/showStatement.test.ts b/test/parser/hive/syntax/showStatement.test.ts new file mode 100644 index 00000000..5a7bb2eb --- /dev/null +++ b/test/parser/hive/syntax/showStatement.test.ts @@ -0,0 +1,16 @@ +import HiveSQL from '../../../../src/parser/hive'; +import { readSQL } from '../../../helper'; + +const parser = new HiveSQL(); + +const features = { + shows: readSQL(__dirname, 'show.sql'), +}; + +describe('Hive Show Syntax Tests', () => { + features.shows.forEach((show) => { + it(show, () => { + expect(parser.validate(show).length).toBe(0); + }); + }); +}); From c6f6599126dffc1e4801cd1a2f295e0e4b01dda3 Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:19:30 +0800 Subject: [PATCH 4/6] test: hivesql describe syntax unit tests --- .../parser/hive/syntax/describeStatement.test.ts | 16 ++++++++++++++++ test/parser/hive/syntax/fixtures/describe.sql | 3 +++ 2 files changed, 19 insertions(+) create mode 100644 test/parser/hive/syntax/describeStatement.test.ts create mode 100644 test/parser/hive/syntax/fixtures/describe.sql diff --git a/test/parser/hive/syntax/describeStatement.test.ts b/test/parser/hive/syntax/describeStatement.test.ts new file mode 100644 index 00000000..3813ecdf --- /dev/null +++ b/test/parser/hive/syntax/describeStatement.test.ts @@ -0,0 +1,16 @@ +import HiveSQL from '../../../../src/parser/hive'; +import { readSQL } from '../../../helper'; + +const parser = new HiveSQL(); + +const features = { + desc: readSQL(__dirname, 'describe.sql'), +}; + +describe('Hive Describe Syntax Tests', () => { + features.desc.forEach((des) => { + it(des, () => { + expect(parser.validate(des).length).toBe(0); + }); + }); +}); diff --git a/test/parser/hive/syntax/fixtures/describe.sql b/test/parser/hive/syntax/fixtures/describe.sql new file mode 100644 index 00000000..cc9981ed --- /dev/null +++ b/test/parser/hive/syntax/fixtures/describe.sql @@ -0,0 +1,3 @@ +DESCRIBE FORMATTED default.src_table PARTITION (part_col = 100) columnA; + +DESCRIBE default.src_thrift lintString.$elem$.myint; \ No newline at end of file From faabeffe8ad8e7f60aada368d5b73f8e836c155f Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:21:16 +0800 Subject: [PATCH 5/6] test: hivesql abort syntax unit tests --- test/parser/hive/syntax/abortStatement.test.ts | 16 ++++++++++++++++ test/parser/hive/syntax/fixtures/abort.sql | 1 + 2 files changed, 17 insertions(+) create mode 100644 test/parser/hive/syntax/abortStatement.test.ts create mode 100644 test/parser/hive/syntax/fixtures/abort.sql diff --git a/test/parser/hive/syntax/abortStatement.test.ts b/test/parser/hive/syntax/abortStatement.test.ts new file mode 100644 index 00000000..1f2673da --- /dev/null +++ b/test/parser/hive/syntax/abortStatement.test.ts @@ -0,0 +1,16 @@ +import HiveSQL from '../../../../src/parser/hive'; +import { readSQL } from '../../../helper'; + +const parser = new HiveSQL(); + +const features = { + aborts: readSQL(__dirname, 'abort.sql'), +}; + +describe('Hive Abort Syntax Tests', () => { + features.aborts.forEach((ab) => { + it(ab, () => { + expect(parser.validate(ab).length).toBe(0); + }); + }); +}); diff --git a/test/parser/hive/syntax/fixtures/abort.sql b/test/parser/hive/syntax/fixtures/abort.sql new file mode 100644 index 00000000..b6047e28 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/abort.sql @@ -0,0 +1 @@ +ABORT TRANSACTIONS 0000007 0000008 0000010 0000015; \ No newline at end of file From 13e52f50f777315c2151b8019f4561c218aae3ee Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:37:19 +0800 Subject: [PATCH 6/6] test: hivesql schedule query ddl syntax unit tests --- test/parser/hive/syntax/alterStatement.test.ts | 9 +++++++++ test/parser/hive/syntax/fixtures/alterScheduleQuery.sql | 7 +++++++ .../parser/hive/syntax/fixtures/createScheduledQuery.sql | 4 ++-- test/parser/hive/syntax/fixtures/drop.sql | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/parser/hive/syntax/fixtures/alterScheduleQuery.sql diff --git a/test/parser/hive/syntax/alterStatement.test.ts b/test/parser/hive/syntax/alterStatement.test.ts index ca5599a1..b319d744 100644 --- a/test/parser/hive/syntax/alterStatement.test.ts +++ b/test/parser/hive/syntax/alterStatement.test.ts @@ -9,6 +9,7 @@ const features = { tables: readSQL(__dirname, 'alterTable.sql'), indexes: readSQL(__dirname, 'alterIndex.sql'), views: readSQL(__dirname, 'alterView.sql'), + scheduleQueries: readSQL(__dirname, 'alterScheduleQuery.sql'), }; describe('Hive Alter Syntax Tests', () => { @@ -51,4 +52,12 @@ describe('Hive Alter Syntax Tests', () => { }); }); }); + + describe('ALTER SCHEDULE QUERY', () => { + features.scheduleQueries.forEach((sq) => { + it(sq, () => { + expect(parser.validate(sq).length).toBe(0); + }); + }); + }); }); diff --git a/test/parser/hive/syntax/fixtures/alterScheduleQuery.sql b/test/parser/hive/syntax/fixtures/alterScheduleQuery.sql new file mode 100644 index 00000000..d545165b --- /dev/null +++ b/test/parser/hive/syntax/fixtures/alterScheduleQuery.sql @@ -0,0 +1,7 @@ +ALTER SCHEDULED QUERY sq_1 EVERY HOUR AT '0:07:30'; + +ALTER SCHEDULED QUERY sq_2 EXECUTED AS 'user2'; + +ALTER SCHEDULED QUERY sq_3 DISABLED; + +ALTER SCHEDULED QUERY sq_4 AS SELECT * FROM tbl1; diff --git a/test/parser/hive/syntax/fixtures/createScheduledQuery.sql b/test/parser/hive/syntax/fixtures/createScheduledQuery.sql index a1a8ae29..d5e54375 100644 --- a/test/parser/hive/syntax/fixtures/createScheduledQuery.sql +++ b/test/parser/hive/syntax/fixtures/createScheduledQuery.sql @@ -9,12 +9,12 @@ AS ANALYZE TABLE t CREATE SCHEDULED QUERY s_day EVERY 2 DAY OFFSET BY 'offsetTs' -EXECUTED AS 'SELECT * FROM aa' +EXECUTED AS 'admin' ENABLE DEFINED AS INSERT INTO t VALUES (1); CREATE SCHEDULED QUERY s_hour EVERY HOUR AT '0:07:30' -EXECUTED AS 'SELECT * FROM aa' +EXECUTED AS 'query_user_1' DISABLE DEFINED AS INSERT INTO t VALUES (1); diff --git a/test/parser/hive/syntax/fixtures/drop.sql b/test/parser/hive/syntax/fixtures/drop.sql index 01450021..b84630ce 100644 --- a/test/parser/hive/syntax/fixtures/drop.sql +++ b/test/parser/hive/syntax/fixtures/drop.sql @@ -39,3 +39,6 @@ DROP INDEX IF EXISTS table02_index ON table02; DROP FUNCTION func1; DROP FUNCTION IF EXISTS func2; + +-- Drop Schedule Query +DROP SCHEDULED QUERY sq_1; \ No newline at end of file