2020-10-22 19:57:13 +08:00
|
|
|
import SQLParser from '../../../src/parser/flinksql';
|
|
|
|
|
|
|
|
describe('FlinkSQL Syntax Tests', () => {
|
|
|
|
const parser = new SQLParser();
|
|
|
|
|
|
|
|
test('Test simple CreateTable Statement', () => {
|
|
|
|
const sql = `
|
|
|
|
CREATE TABLE Orders (
|
2020-10-23 17:52:43 +08:00
|
|
|
user BIGINT
|
2020-10-22 19:57:13 +08:00
|
|
|
) WITH (
|
|
|
|
"connector" = "kafka",
|
|
|
|
"scan.startup.mode" = "earliest-offset"
|
|
|
|
);
|
|
|
|
`;
|
|
|
|
const result = parser.validate(sql);
|
2020-10-23 17:52:43 +08:00
|
|
|
console.log(result);
|
2020-10-22 19:57:13 +08:00
|
|
|
expect(result.length).toBe(0);
|
|
|
|
});
|
|
|
|
});
|