lava-oushudb-dt-sql-parser/test/parser/spark/lexer.test.ts

15 lines
442 B
TypeScript
Raw Normal View History

2020-10-28 21:34:13 +08:00
import SQLParser from '../../../src/parser/spark';
describe('SparkSQL Lexer tests', () => {
const mysqlParser = new SQLParser();
// const sql = 'select id,name,sex from user1;';
const sql = 'select * from person where age >= 20 order by age desc limit 2;';
const tokens = mysqlParser.getAllTokens(sql);
console.log('tokens', tokens);
test('token counts', () => {
expect(tokens.length).toBe(28);
});
});