e203f1a48a
* feat(impala): add impala sqlLexer * feat(impala): add impala grammar * feat(impala): add alter table sql * feat(impala): update alter table sql * feat(impala): add alter db sql * feat(impala): add alter view sql * feat(impala): add compute stats/comment statement and update partition_desc for alter table * feat(impala): add drop statement sql * feat(impala): add revoke and grant sql * feat(impala): add create db/function/role/view sql * feat(impala): add describe/explain/invalidata_metadata/load_data sql * feat(impala): add refresh/set/shutdown sql * feat(impala): add truncate_table/use/values sql * fix(impala): update shutdown and invaliddate_metadata * feat(impala): add show/update/upsert sql * feat(impala): add create/insert sql * feat(impala): add select and delete sql * feat(impala): add impala tokens and fix todo * feat(impala): update impalaparser and some test unit * feat(impala): add syntax suggestion * feat(impala): add syntax suggestion * feat(impala): update test unit * feat(impala): remove reference * fix(impala): add statement for sqlname and collect tableName * fix(impala): fix syntax suggestion unit test * fix(impala): update syntax suggestion and collect column * feat(impala): add collect column create
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import ImpalaSQL from '../../../../src/parser/impala';
|
|
import { readSQL } from '../../../helper';
|
|
|
|
const parser = new ImpalaSQL();
|
|
|
|
const features = {
|
|
dbs: readSQL(__dirname, 'drop_db.sql'),
|
|
functions: readSQL(__dirname, 'drop_function.sql'),
|
|
roles: readSQL(__dirname, 'drop_role.sql'),
|
|
stats: readSQL(__dirname, 'drop_stats.sql'),
|
|
tables: readSQL(__dirname, 'drop_table.sql'),
|
|
views: readSQL(__dirname, 'drop_view.sql'),
|
|
};
|
|
|
|
describe('ImpalaSQL Drop Syntax Tests', () => {
|
|
describe('DROP DATABASE', () => {
|
|
features.dbs.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
describe('DROP FUNCTION', () => {
|
|
features.functions.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
describe('DROP ROLE', () => {
|
|
features.roles.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
describe('DROP STATS', () => {
|
|
features.stats.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
describe('DROP TABLE', () => {
|
|
features.tables.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
describe('DROP VIEW', () => {
|
|
features.views.forEach((db) => {
|
|
it(db, () => {
|
|
expect(parser.validate(db).length).toBe(0);
|
|
});
|
|
});
|
|
});
|
|
});
|