diff --git a/src/index.ts b/src/index.ts index 0ecdb53..6d87c17 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,3 +8,6 @@ export * from './lib/hive/HiveSqlListener'; export * from './lib/hive/HiveSqlVisitor'; export * from './lib/plsql/PlSqlParserListener'; export * from './lib/plsql/PlSqlParserVisitor'; +export * from './lib/spark/SparkSqlVisitor'; +export * from './lib/spark/SparkSqlListener'; + diff --git a/src/parser/spark.ts b/src/parser/spark.ts index 7a7ef31..9e511e4 100644 --- a/src/parser/spark.ts +++ b/src/parser/spark.ts @@ -1,9 +1,6 @@ import { InputStream, CommonTokenStream, Lexer } from 'antlr4'; import { SparkSqlLexer } from '../lib/spark/SparkSqlLexer'; import { SparkSqlParser } from '../lib/spark/SparkSqlParser'; -export * from '../lib/spark/SparkSqlVisitor'; -export * from '../lib/spark/SparkSqlListener'; - import BasicParser from './common/basicParser'; export default class SparkSQL extends BasicParser { diff --git a/test/parser/spark/lexer.test.ts b/test/parser/spark/lexer.test.ts index 2bc694a..ea7e0ff 100644 --- a/test/parser/spark/lexer.test.ts +++ b/test/parser/spark/lexer.test.ts @@ -1,9 +1,9 @@ -import SQLParser from '../../../src/parser/spark'; +import { SparkSQL } from '../../../src'; const log = console.log.bind(console); describe('SparkSQL Lexer tests', () => { - const parser = new SQLParser(); + const parser = new SparkSQL(); test('select id,name from user1;', () => { const sql = `select id,name from user1;`; diff --git a/test/parser/spark/listener.test.ts b/test/parser/spark/listener.test.ts index 8b9a1cf..999b2cf 100644 --- a/test/parser/spark/listener.test.ts +++ b/test/parser/spark/listener.test.ts @@ -1,9 +1,9 @@ -import SQLParser, { SparkSqlListener } from '../../../src/parser/spark'; +import { SparkSQL, SparkSqlListener } from '../../../src'; describe('Spark SQL Listener Tests', () => { const expectTableName = 'user1'; const sql = `select id,name,sex from ${expectTableName};`; - const parser = new SQLParser(); + const parser = new SparkSQL(); const parserTree = parser.parse(sql); diff --git a/test/parser/spark/syntax.test.ts b/test/parser/spark/syntax.test.ts index 7f25897..a6c1375 100644 --- a/test/parser/spark/syntax.test.ts +++ b/test/parser/spark/syntax.test.ts @@ -1,10 +1,9 @@ -/* eslint-disable max-len */ -import SQLParser from '../../../src/parser/spark'; +import { SparkSQL } from '../../../src'; const error = console.log.bind(console, '***** error\n'); const validateTest = (sqls) => { - const parser = new SQLParser(); + const parser = new SparkSQL(); sqls.forEach((sql, i) => { const result = parser.validate(sql); if (result.length !== 0) { diff --git a/test/parser/spark/visitor.test.ts b/test/parser/spark/visitor.test.ts index 4c625b9..7eeaf8d 100644 --- a/test/parser/spark/visitor.test.ts +++ b/test/parser/spark/visitor.test.ts @@ -1,9 +1,9 @@ -import SQLParser, { SparkSqlVisitor } from '../../../src/parser/spark'; +import { SparkSQL, SparkSqlVisitor } from '../../../src'; describe('Spark SQL Visitor Tests', () => { const expectTableName = 'user1'; const sql = `select id,name,sex from ${expectTableName};`; - const parser = new SQLParser(); + const parser = new SparkSQL(); const parserTree = parser.parse(sql, (error) => { console.log('Parse error:', error);