Skip to content

Commit ed7e81e

Browse files
committed
feat(flink): implement suggestion support for table properties in CREATE TABLE
# Conflicts: # test/parser/flink/suggestion/tokenSuggestion.test.ts
1 parent 94ec619 commit ed7e81e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/parser/flink/suggestion/tokenSuggestion.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,33 @@ describe('Flink SQL Token Suggestion', () => {
121121
expect(suggestion[0].syntaxContextType).toBe(scenario.entityContextType);
122122
});
123123
});
124+
125+
test('Create Statement table properties', () => {
126+
const tokenSql = `CREATE TABLE tmp_table (col INT) WITH ('connector'='kafka');`;
127+
const scenarios = [
128+
{
129+
caretPosition: {
130+
lineNumber: 1,
131+
column: 45,
132+
},
133+
entityContextType: EntityContextType.TABLE_PROPERTY_KEY,
134+
},
135+
{
136+
caretPosition: {
137+
lineNumber: 1,
138+
column: 55,
139+
},
140+
entityContextType: EntityContextType.TABLE_PROPERTY_VALUE,
141+
},
142+
];
143+
144+
scenarios.forEach((scenario) => {
145+
const suggestion = flink.getSuggestionAtCaretPosition(
146+
tokenSql,
147+
scenario.caretPosition
148+
)?.syntax;
149+
150+
expect(suggestion[0].syntaxContextType).toBe(scenario.entityContextType);
151+
});
152+
});
124153
});

0 commit comments

Comments
 (0)