test: hivesql schedule query ddl syntax unit tests
This commit is contained in:
parent
faabeffe8a
commit
13e52f50f7
@ -9,6 +9,7 @@ const features = {
|
|||||||
tables: readSQL(__dirname, 'alterTable.sql'),
|
tables: readSQL(__dirname, 'alterTable.sql'),
|
||||||
indexes: readSQL(__dirname, 'alterIndex.sql'),
|
indexes: readSQL(__dirname, 'alterIndex.sql'),
|
||||||
views: readSQL(__dirname, 'alterView.sql'),
|
views: readSQL(__dirname, 'alterView.sql'),
|
||||||
|
scheduleQueries: readSQL(__dirname, 'alterScheduleQuery.sql'),
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Hive Alter Syntax Tests', () => {
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
7
test/parser/hive/syntax/fixtures/alterScheduleQuery.sql
Normal file
7
test/parser/hive/syntax/fixtures/alterScheduleQuery.sql
Normal file
@ -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;
|
@ -9,12 +9,12 @@ AS ANALYZE TABLE t
|
|||||||
|
|
||||||
CREATE SCHEDULED QUERY s_day
|
CREATE SCHEDULED QUERY s_day
|
||||||
EVERY 2 DAY OFFSET BY 'offsetTs'
|
EVERY 2 DAY OFFSET BY 'offsetTs'
|
||||||
EXECUTED AS 'SELECT * FROM aa'
|
EXECUTED AS 'admin'
|
||||||
ENABLE
|
ENABLE
|
||||||
DEFINED AS INSERT INTO t VALUES (1);
|
DEFINED AS INSERT INTO t VALUES (1);
|
||||||
|
|
||||||
CREATE SCHEDULED QUERY s_hour
|
CREATE SCHEDULED QUERY s_hour
|
||||||
EVERY HOUR AT '0:07:30'
|
EVERY HOUR AT '0:07:30'
|
||||||
EXECUTED AS 'SELECT * FROM aa'
|
EXECUTED AS 'query_user_1'
|
||||||
DISABLE
|
DISABLE
|
||||||
DEFINED AS INSERT INTO t VALUES (1);
|
DEFINED AS INSERT INTO t VALUES (1);
|
||||||
|
@ -39,3 +39,6 @@ DROP INDEX IF EXISTS table02_index ON table02;
|
|||||||
DROP FUNCTION func1;
|
DROP FUNCTION func1;
|
||||||
|
|
||||||
DROP FUNCTION IF EXISTS func2;
|
DROP FUNCTION IF EXISTS func2;
|
||||||
|
|
||||||
|
-- Drop Schedule Query
|
||||||
|
DROP SCHEDULED QUERY sq_1;
|
Loading…
Reference in New Issue
Block a user