test: remove barrier files to improve unit testing performance (#249)
* test: remove barrier files to improve unit testing performance * chore: change check-types command
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
# FlinkSQL Benchmark
|
||||
| Name | Rows | Times | Total Time(ms) | Average Time(ms) |
|
||||
| ---- | ---- | ---- | ---- | ---- |
|
||||
| CreateTable | 100 | 1 | 3858.63 | 3858.63 |
|
||||
| CreateTable | 1000 | 1 | 4845.70 | 4845.70 |
|
||||
| CreateTable | 5000 | 1 | 14629.31 | 14629.31 |
|
||||
| SelectTable | 100 | 1 | 3796.21 | 3796.21 |
|
||||
| SelectTable | 1000 | 1 | 7207.75 | 7207.75 |
|
||||
| SelectTable | 5000 | 1 | 26171.22 | 26171.22 |
|
||||
| InsertTable | 100 | 1 | 57.62 | 57.62 |
|
||||
| InsertTable | 1000 | 1 | 111.11 | 111.11 |
|
||||
| InsertTable | 5000 | 1 | 2056.96 | 2056.96 |
|
||||
| CreateTable | 100 | 1 | 256.26 | 256.26 |
|
||||
| CreateTable | 1000 | 1 | 343.14 | 343.14 |
|
||||
| CreateTable | 5000 | 1 | 1816.20 | 1816.20 |
|
||||
| SelectTable | 100 | 1 | 460.68 | 460.68 |
|
||||
| SelectTable | 1000 | 1 | 1124.45 | 1124.45 |
|
||||
| SelectTable | 5000 | 1 | 5212.31 | 5212.31 |
|
||||
| InsertTable | 100 | 1 | 9.10 | 9.10 |
|
||||
| InsertTable | 1000 | 1 | 41.80 | 41.80 |
|
||||
| InsertTable | 5000 | 1 | 318.83 | 318.83 |
|
@ -1,11 +1,11 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import {
|
||||
readSQL,
|
||||
benchmark,
|
||||
getReportTableHeader,
|
||||
getReportTableRow,
|
||||
exportReportTable,
|
||||
} from '../../../helper';
|
||||
} from 'test/helper';
|
||||
|
||||
const features = {
|
||||
selectTable: readSQL(__dirname, 'selectTable.sql'),
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { FlinkSQL, FlinkSqlSplitListener, FlinkSqlParserListener } from '../../filters';
|
||||
import FlinkSQL, { FlinkSqlSplitListener } from 'src/parser/flinksql';
|
||||
import { FlinkSqlParserListener } from 'src/lib/flinksql/FlinkSqlParserListener';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FlinkSQL } from '../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
|
||||
describe('FlinkSQL Lexer tests', () => {
|
||||
const parser = new FlinkSQL();
|
||||
|
@ -1,9 +1,7 @@
|
||||
import {
|
||||
FlinkSQL,
|
||||
FlinkSqlParserListener,
|
||||
FlinkSqlParserRuleContext,
|
||||
ParseTreeListener,
|
||||
} from '../../filters';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { FlinkSqlParserListener } from 'src/lib/flinksql/FlinkSqlParserListener';
|
||||
import { TableExpressionContext } from 'src/lib/flinksql/FlinkSqlParser';
|
||||
|
||||
describe('Flink SQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
@ -15,9 +13,7 @@ describe('Flink SQL Listener Tests', () => {
|
||||
test('Listener enterTableName', async () => {
|
||||
let result = '';
|
||||
class MyListener implements FlinkSqlParserListener {
|
||||
enterTableExpression = (
|
||||
ctx: FlinkSqlParserRuleContext.TableExpressionContext
|
||||
): void => {
|
||||
enterTableExpression = (ctx: TableExpressionContext): void => {
|
||||
result = ctx.text.toLowerCase();
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, FlinkSQL } from '../../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, FlinkSQL } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { FlinkSQL, CaretPosition } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
table: readSQL(__dirname, 'alterTable.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
// 综合测试的 sql 不做切割
|
||||
const features = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
|
||||
// 注释 sql 不做切割
|
||||
const features = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
|
||||
// 综合测试的 sql 不做切割
|
||||
const features = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
describes: readSQL(__dirname, 'describe.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
table: readSQL(__dirname, 'dropTable.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
dtAddFiles: readSQL(__dirname, 'dtAddFile.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
explains: readSQL(__dirname, 'explain.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
expression: readSQL(__dirname, 'expression.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new FlinkSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
shows: readSQL(__dirname, 'show.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { FlinkSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
uses: readSQL(__dirname, 'use.sql'),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { FlinkSQL } from '../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { FlinkSQL, AbstractParseTreeVisitor, FlinkSqlParserVisitor } from '../../filters';
|
||||
import FlinkSQL from 'src/parser/flinksql';
|
||||
import { FlinkSqlParserVisitor } from 'src/lib/flinksql/FlinkSqlParserVisitor';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
|
||||
describe('Flink SQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { HiveSQL, HiveSqlSplitListener, HiveSqlParserListener } from '../../filters';
|
||||
import HiveSQL, { HiveSqlSplitListener } from 'src/parser/hive';
|
||||
import { HiveSqlParserListener } from 'src/lib';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HiveSQL } from '../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
|
||||
describe('HiveSQL Lexer tests', () => {
|
||||
const parser = new HiveSQL();
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { ParseTreeListener } from 'antlr4ts/tree';
|
||||
import { HiveSQL, HiveSqlParserListener, HiveSqlParserRuleContext } from '../../filters';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { ProgramContext } from 'src/lib/hive/HiveSqlParser';
|
||||
import { HiveSqlParserListener } from 'src/lib/hive/HiveSqlParserListener';
|
||||
|
||||
describe('HiveSQL Listener Tests', () => {
|
||||
const parser = new HiveSQL();
|
||||
@ -16,10 +18,7 @@ describe('HiveSQL Listener Tests', () => {
|
||||
}
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(
|
||||
listenTableName as ParseTreeListener,
|
||||
parseTree as HiveSqlParserRuleContext.ProgramContext
|
||||
);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parseTree as ProgramContext);
|
||||
expect(result).toBe(expectTableName.toUpperCase());
|
||||
});
|
||||
test('Listener enterCreateTable', async () => {
|
||||
@ -33,10 +32,7 @@ describe('HiveSQL Listener Tests', () => {
|
||||
}
|
||||
const listenTableName = new MyListener();
|
||||
|
||||
await parser.listen(
|
||||
listenTableName as ParseTreeListener,
|
||||
parseTree as HiveSqlParserRuleContext.ProgramContext
|
||||
);
|
||||
await parser.listen(listenTableName as ParseTreeListener, parseTree as ProgramContext);
|
||||
expect(result).toBe('DROPTABLETABLE_NAME');
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, HiveSQL } from '../../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, HiveSQL } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, HiveSQL } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
exports: readSQL(__dirname, 'export.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const features = {
|
||||
imports: readSQL(__dirname, 'import.sql'),
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { HiveSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new HiveSQL();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { HiveSQL } from '../../filters';
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,9 +1,8 @@
|
||||
import {
|
||||
HiveSQL,
|
||||
HiveSqlParserVisitor,
|
||||
AbstractParseTreeVisitor,
|
||||
HiveSqlParserRuleContext,
|
||||
} from '../../filters';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
|
||||
import HiveSQL from 'src/parser/hive';
|
||||
import { HiveSqlParserVisitor } from 'src/lib/hive/HiveSqlParserVisitor';
|
||||
import { ProgramContext } from 'src/lib/hive/HiveSqlParser';
|
||||
|
||||
describe('HiveSQL Visitor Tests', () => {
|
||||
const expectTableName = 'dm_gis.dlv_addr_tc_count';
|
||||
@ -27,7 +26,7 @@ describe('HiveSQL Visitor Tests', () => {
|
||||
}
|
||||
|
||||
const visitor = new MyVisitor();
|
||||
visitor.visit(parseTree as HiveSqlParserRuleContext.ProgramContext);
|
||||
visitor.visit(parseTree as ProgramContext);
|
||||
|
||||
expect(result).toBe(expectTableName);
|
||||
});
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { ImpalaSQL, ImpalaSqlSplitListener, ImpalaSqlParserListener } from '../../filters';
|
||||
import ImpalaSQL, { ImpalaSqlSplitListener } from 'src/parser/impala';
|
||||
import { ImpalaSqlParserListener } from 'src/lib/impala/ImpalaSqlParserListener';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ImpalaSQL } from '../../filters';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
|
||||
describe('ImpalaSQL Lexer tests', () => {
|
||||
const parser = new ImpalaSQL();
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { ImpalaSQL, ImpalaSqlParserListener, ParseTreeListener } from '../../filters';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { ImpalaSqlParserListener } from 'src/lib/impala/ImpalaSqlParserListener';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
|
||||
describe('impala SQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { ImpalaSQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { ImpalaSQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { ImpalaSQL, CaretPosition } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { ImpalaSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new ImpalaSQL();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ImpalaSQL } from '../../filters';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { ImpalaSQL, ImpalaSqlParserVisitor, AbstractParseTreeVisitor } from '../../filters';
|
||||
import ImpalaSQL from 'src/parser/impala';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
import { ImpalaSqlParserVisitor } from 'src/lib/impala/ImpalaSqlParserVisitor';
|
||||
|
||||
describe('impala SQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MySQL } from '../../filters';
|
||||
import { MysqlSplitListener, MySqlParserListener } from '../../filters';
|
||||
import MySQL, { MysqlSplitListener } from 'src/parser/mysql';
|
||||
import { MySqlParserListener } from 'src/lib/mysql/MySqlParserListener';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MySQL } from '../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
|
||||
describe('MySQL Lexer tests', () => {
|
||||
const parser = new MySQL();
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { MySQL } from '../../filters';
|
||||
import { MySqlParserListener, ParseTreeListener } from '../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { MySqlParserListener } from 'src/lib/mysql/MySqlParserListener';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
|
||||
describe('MySQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { MySQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { MySQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { SyntaxContextType, CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { MySQL, CaretPosition } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MySQL } from '../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
|
||||
describe('MySQL Syntax Tests', () => {
|
||||
const parser = new MySQL();
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MySQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new MySQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MySQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new MySQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MySQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new MySQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MySQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new MySQL();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { MySQL } from '../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { MySQL, MySqlParserVisitor, AbstractParseTreeVisitor } from '../../filters';
|
||||
import MySQL from 'src/parser/mysql';
|
||||
import { MySqlParserVisitor } from 'src/lib/mysql/MySqlParserVisitor';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
|
||||
describe('MySQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { PostgresSQL, PgSqlSplitListener, PostgreSQLParserListener } from '../../filters';
|
||||
import PostgresSQL, { PgSqlSplitListener } from 'src/parser/pgsql';
|
||||
import { PostgreSQLParserListener } from 'src/lib/pgsql/PostgreSQLParserListener';
|
||||
|
||||
const validSQL1 = `INSERT INTO country_page_view
|
||||
VALUES ('Chinese', 'mumiao', 18),
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PostgresSQL } from '../../filters';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
|
||||
describe('PostgresSQL Lexer tests', () => {
|
||||
const mysqlParser = new PostgresSQL();
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { PostgresSQL, PostgreSQLParserListener, ParseTreeListener } from '../../filters';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { PostgreSQLParserListener } from 'src/lib/pgsql/PostgreSQLParserListener';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
|
||||
describe('PostgresSQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { CaretPosition, SyntaxContextType, PostgresSQL } from '../../../filters';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'multipleStatement.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { PostgresSQL, CaretPosition, SyntaxContextType } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { CaretPosition, SyntaxContextType } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const syntaxSql = fs.readFileSync(
|
||||
path.join(__dirname, 'fixtures', 'syntaxSuggestion.sql'),
|
||||
|
@ -1,7 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { PostgresSQL, CaretPosition } from '../../../filters';
|
||||
import { commentOtherLine } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { CaretPosition } from 'src/parser/common/basic-parser-types';
|
||||
import { commentOtherLine } from 'test/helper';
|
||||
|
||||
const tokenSql = fs.readFileSync(path.join(__dirname, 'fixtures', 'tokenSuggestion.sql'), 'utf-8');
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { PostgresSQL } from '../../../filters';
|
||||
import { readSQL } from '../../../helper';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { readSQL } from 'test/helper';
|
||||
|
||||
const parser = new PostgresSQL();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PostgresSQL } from '../../filters';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
|
||||
const randomText = `dhsdansdnkla ndjnsla ndnalks`;
|
||||
const unCompleteSQL = `CREATE TABLE`;
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { PostgresSQL, AbstractParseTreeVisitor, PostgreSQLParserVisitor } from '../../filters';
|
||||
import PostgresSQL from 'src/parser/pgsql';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
import { PostgreSQLParserVisitor } from 'src/lib/pgsql/PostgreSQLParserVisitor';
|
||||
|
||||
describe('MySQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PLSQL } from '../../filters';
|
||||
import PLSQL from 'src/parser/plsql';
|
||||
|
||||
describe('PLSQL Lexer tests', () => {
|
||||
const parser = new PLSQL();
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { PLSQL, PlSqlParserListener, ParseTreeListener } from '../../filters';
|
||||
import PLSQL from 'src/parser/plsql';
|
||||
import { ParseTreeListener } from 'antlr4ts/tree/ParseTreeListener';
|
||||
import { PlSqlParserListener } from 'src/lib/plsql/PlSqlParserListener';
|
||||
|
||||
describe('PLSQL Listener Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PLSQL } from '../../filters';
|
||||
import PLSQL from 'src/parser/plsql';
|
||||
|
||||
describe('PLSQL Syntax Tests', () => {
|
||||
const parser = new PLSQL();
|
||||
|
@ -1,4 +1,6 @@
|
||||
import { PLSQL, AbstractParseTreeVisitor, PlSqlParserVisitor } from '../../filters';
|
||||
import PLSQL from 'src/parser/plsql';
|
||||
import { AbstractParseTreeVisitor } from 'antlr4ts/tree/AbstractParseTreeVisitor';
|
||||
import { PlSqlParserVisitor } from 'src/lib/plsql/PlSqlParserVisitor';
|
||||
|
||||
describe('PLSQL Visitor Tests', () => {
|
||||
const expectTableName = 'user1';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user