fix: add partitioned by sql unit test and compile impala (#221)

This commit is contained in:
霜序
2023-11-29 10:02:16 +08:00
committed by GitHub
parent 4fbb85dfba
commit 4be3640219
4 changed files with 173 additions and 157 deletions

View File

@ -42,4 +42,6 @@ CREATE TABLE census_data (last_name STRING);
ALTER TABLE my_table ADD COLUMN age INT COMMENT 'Updated Age';
CREATE TABLE kudu_no_partition_by_clause (id bigint PRIMARY KEY, s STRING, b BOOLEAN ) STORED AS KUDU;
CREATE TABLE kudu_no_partition_by_clause (id bigint PRIMARY KEY, s STRING, b BOOLEAN ) STORED AS KUDU;
CREATE TABLE PARTITIONS_YES PARTITIONED BY (YEAR, MONTH);

View File

@ -346,4 +346,18 @@ describe('Impala SQL Syntax Suggestion', () => {
expect(suggestion).not.toBeUndefined();
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['id']);
});
test('Create Table partitions', () => {
const pos: CaretPosition = {
lineNumber: 47,
column: 49,
};
const syntaxes = parser.getSuggestionAtCaretPosition(syntaxSql, pos)?.syntax;
const suggestion = syntaxes?.find(
(syn) => syn.syntaxContextType === SyntaxContextType.COLUMN_CREATE
);
expect(suggestion).not.toBeUndefined();
expect(suggestion?.wordRanges.map((token) => token.text)).toEqual(['YEAR']);
});
});