fix: #295 #297 optimize impala data types suggestion and create table (#296)

* fix: #295 impala data types suggestion

* fix: #297 impala create table with STRUCT
This commit is contained in:
琉易
2024-04-21 12:10:36 +08:00
committed by GitHub
parent fa30fe9253
commit 31b57a494b
13 changed files with 5738 additions and 5248 deletions

View File

@ -7,3 +7,5 @@ DROP ;
INSERT ;
SHOW ;
CREATE TABLE t1 (id );

View File

@ -109,4 +109,38 @@ describe('Impala SQL Token Suggestion', () => {
'CURRENT',
]);
});
test('Create table with column dataType', () => {
const pos: CaretPosition = {
lineNumber: 11,
column: 21,
};
const suggestion = impala.getSuggestionAtCaretPosition(
commentOtherLine(tokenSql, pos.lineNumber),
pos
)?.keywords;
const dataTypes = [
'INT',
'BINARY',
'BIGINT',
'BOOLEAN',
'CHAR',
'DATE',
'DECIMAL',
'DOUBLE',
'INT',
'MAP',
'REAL',
'SMALLINT',
'FLOAT',
'STRING',
'STRUCT',
'TIMESTAMP',
'TINYINT',
'VARCHAR',
'COMPLEX',
];
expect(dataTypes.every((dataType) => suggestion.includes(dataType))).toBe(true);
});
});