2024-03-27 10:33:25 +08:00
|
|
|
import { FlinkSQL } from 'src/parser/flink';
|
2024-01-19 21:10:00 +08:00
|
|
|
import { readSQL } from 'test/helper';
|
2023-02-27 19:03:32 +08:00
|
|
|
|
2024-03-27 10:33:25 +08:00
|
|
|
const flink = new FlinkSQL();
|
2023-05-12 09:31:54 +08:00
|
|
|
|
|
|
|
const features = {
|
|
|
|
InsertFromSelectQueries: readSQL(__dirname, 'insertFromSelectQueries.sql'),
|
|
|
|
InsertValuesIntoTable: readSQL(__dirname, 'insertValuesIntoTable.sql'),
|
2023-10-13 11:16:36 +08:00
|
|
|
InsertMultipleTable: readSQL(__dirname, 'insertMultipleTable.sql'),
|
2023-05-12 09:31:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
describe('FlinkSQL Insert Syntax Tests', () => {
|
|
|
|
features.InsertFromSelectQueries.forEach((insertFromSelectQueries) => {
|
|
|
|
it(insertFromSelectQueries, () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
expect(flink.validate(insertFromSelectQueries).length).toBe(0);
|
2023-05-12 09:31:54 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
features.InsertValuesIntoTable.forEach((insertValuesIntoTable) => {
|
|
|
|
it(insertValuesIntoTable, () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
expect(flink.validate(insertValuesIntoTable).length).toBe(0);
|
2023-05-12 09:31:54 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
features.InsertMultipleTable.forEach((insertMultipleTable) => {
|
|
|
|
it(insertMultipleTable, () => {
|
2024-03-27 10:33:25 +08:00
|
|
|
expect(flink.validate(insertMultipleTable).length).toBe(0);
|
2023-05-12 09:31:54 +08:00
|
|
|
});
|
2023-02-27 19:03:32 +08:00
|
|
|
});
|
|
|
|
});
|