From c6f6599126dffc1e4801cd1a2f295e0e4b01dda3 Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:19:30 +0800 Subject: [PATCH] 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 0000000..3813ecd --- /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 0000000..cc9981e --- /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