Feat/auto complete (#175)
* feat: update hive grammar to adapt to c3 * feat: support viewName, dbName, fnName autoComplete to hive * test: add hive suggestion unit test * test: optimze flink suggestion unit tests
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/xuxiaoqi/Documents/work/daishu-code/dt-sql-parser/src/grammar/hive/HiveSqlLexer.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
// Generated from /Users/hayden/Desktop/dt-works/dt-sql-parser/src/grammar/hive/HiveSqlLexer.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
|
||||
|
||||
import { ATN } from "antlr4ts/atn/ATN";
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/xuxiaoqi/Documents/work/daishu-code/dt-sql-parser/src/grammar/hive/HiveSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
// Generated from /Users/hayden/Desktop/dt-works/dt-sql-parser/src/grammar/hive/HiveSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
|
||||
|
||||
import { ParseTreeListener } from "antlr4ts/tree/ParseTreeListener";
|
||||
@ -111,7 +111,6 @@ import { AlterScheduledQueryChangeContext } from "./HiveSqlParser";
|
||||
import { ScheduleSpecContext } from "./HiveSqlParser";
|
||||
import { ExecutedAsSpecContext } from "./HiveSqlParser";
|
||||
import { DefinedAsSpecContext } from "./HiveSqlParser";
|
||||
import { ShowFunctionIdentifierContext } from "./HiveSqlParser";
|
||||
import { ShowStmtIdentifierContext } from "./HiveSqlParser";
|
||||
import { TableCommentContext } from "./HiveSqlParser";
|
||||
import { CreateTablePartitionSpecContext } from "./HiveSqlParser";
|
||||
@ -331,8 +330,13 @@ import { TableSampleContext } from "./HiveSqlParser";
|
||||
import { TableSourceContext } from "./HiveSqlParser";
|
||||
import { AsOfClauseContext } from "./HiveSqlParser";
|
||||
import { UniqueJoinTableSourceContext } from "./HiveSqlParser";
|
||||
import { DbSchemaNameContext } from "./HiveSqlParser";
|
||||
import { DbSchemaNameCreateContext } from "./HiveSqlParser";
|
||||
import { TableOrViewContext } from "./HiveSqlParser";
|
||||
import { TableNameContext } from "./HiveSqlParser";
|
||||
import { TableNameCreateContext } from "./HiveSqlParser";
|
||||
import { ViewNameContext } from "./HiveSqlParser";
|
||||
import { ViewNameCreateContext } from "./HiveSqlParser";
|
||||
import { SubQuerySourceContext } from "./HiveSqlParser";
|
||||
import { PartitioningSpecContext } from "./HiveSqlParser";
|
||||
import { PartitionTableFunctionSourceContext } from "./HiveSqlParser";
|
||||
@ -389,7 +393,10 @@ import { SortByClauseContext } from "./HiveSqlParser";
|
||||
import { TrimFunctionContext } from "./HiveSqlParser";
|
||||
import { Function_Context } from "./HiveSqlParser";
|
||||
import { Null_treatmentContext } from "./HiveSqlParser";
|
||||
import { FunctionNameContext } from "./HiveSqlParser";
|
||||
import { FunctionNameForDDLContext } from "./HiveSqlParser";
|
||||
import { FunctionNameForInvokeContext } from "./HiveSqlParser";
|
||||
import { UserDefinedFuncNameContext } from "./HiveSqlParser";
|
||||
import { FunctionNameCreateContext } from "./HiveSqlParser";
|
||||
import { CastExpressionContext } from "./HiveSqlParser";
|
||||
import { CaseExpressionContext } from "./HiveSqlParser";
|
||||
import { WhenExpressionContext } from "./HiveSqlParser";
|
||||
@ -458,7 +465,6 @@ import { PartitionSelectorValContext } from "./HiveSqlParser";
|
||||
import { PartitionSelectorOperatorContext } from "./HiveSqlParser";
|
||||
import { SubQuerySelectorOperatorContext } from "./HiveSqlParser";
|
||||
import { SysFuncNamesContext } from "./HiveSqlParser";
|
||||
import { DescFuncNamesContext } from "./HiveSqlParser";
|
||||
import { Id_Context } from "./HiveSqlParser";
|
||||
import { FunctionIdentifierContext } from "./HiveSqlParser";
|
||||
import { PrincipalIdentifierContext } from "./HiveSqlParser";
|
||||
@ -1712,17 +1718,6 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitDefinedAsSpec?: (ctx: DefinedAsSpecContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.showFunctionIdentifier`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterShowFunctionIdentifier?: (ctx: ShowFunctionIdentifierContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.showFunctionIdentifier`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitShowFunctionIdentifier?: (ctx: ShowFunctionIdentifierContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.showStmtIdentifier`.
|
||||
* @param ctx the parse tree
|
||||
@ -4132,6 +4127,39 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitUniqueJoinTableSource?: (ctx: UniqueJoinTableSourceContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.dbSchemaName`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterDbSchemaName?: (ctx: DbSchemaNameContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.dbSchemaName`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitDbSchemaName?: (ctx: DbSchemaNameContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.dbSchemaNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterDbSchemaNameCreate?: (ctx: DbSchemaNameCreateContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.dbSchemaNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitDbSchemaNameCreate?: (ctx: DbSchemaNameCreateContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.tableOrView`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterTableOrView?: (ctx: TableOrViewContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.tableOrView`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitTableOrView?: (ctx: TableOrViewContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.tableName`.
|
||||
* @param ctx the parse tree
|
||||
@ -4143,6 +4171,17 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitTableName?: (ctx: TableNameContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.tableNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterTableNameCreate?: (ctx: TableNameCreateContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.tableNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitTableNameCreate?: (ctx: TableNameCreateContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.viewName`.
|
||||
* @param ctx the parse tree
|
||||
@ -4154,6 +4193,17 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitViewName?: (ctx: ViewNameContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.viewNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterViewNameCreate?: (ctx: ViewNameCreateContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.viewNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitViewNameCreate?: (ctx: ViewNameCreateContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.subQuerySource`.
|
||||
* @param ctx the parse tree
|
||||
@ -4771,15 +4821,48 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
exitNull_treatment?: (ctx: Null_treatmentContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.functionName`.
|
||||
* Enter a parse tree produced by `HiveSqlParser.functionNameForDDL`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterFunctionName?: (ctx: FunctionNameContext) => void;
|
||||
enterFunctionNameForDDL?: (ctx: FunctionNameForDDLContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.functionName`.
|
||||
* Exit a parse tree produced by `HiveSqlParser.functionNameForDDL`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitFunctionName?: (ctx: FunctionNameContext) => void;
|
||||
exitFunctionNameForDDL?: (ctx: FunctionNameForDDLContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.functionNameForInvoke`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterFunctionNameForInvoke?: (ctx: FunctionNameForInvokeContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.functionNameForInvoke`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitFunctionNameForInvoke?: (ctx: FunctionNameForInvokeContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.userDefinedFuncName`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterUserDefinedFuncName?: (ctx: UserDefinedFuncNameContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.userDefinedFuncName`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitUserDefinedFuncName?: (ctx: UserDefinedFuncNameContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.functionNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterFunctionNameCreate?: (ctx: FunctionNameCreateContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.functionNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitFunctionNameCreate?: (ctx: FunctionNameCreateContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.castExpression`.
|
||||
@ -5529,17 +5612,6 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitSysFuncNames?: (ctx: SysFuncNamesContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.descFuncNames`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterDescFuncNames?: (ctx: DescFuncNamesContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.descFuncNames`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitDescFuncNames?: (ctx: DescFuncNamesContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.id_`.
|
||||
* @param ctx the parse tree
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Generated from /Users/xuxiaoqi/Documents/work/daishu-code/dt-sql-parser/src/grammar/hive/HiveSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
// Generated from /Users/hayden/Desktop/dt-works/dt-sql-parser/src/grammar/hive/HiveSqlParser.g4 by ANTLR 4.9.0-SNAPSHOT
|
||||
|
||||
|
||||
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor";
|
||||
@ -111,7 +111,6 @@ import { AlterScheduledQueryChangeContext } from "./HiveSqlParser";
|
||||
import { ScheduleSpecContext } from "./HiveSqlParser";
|
||||
import { ExecutedAsSpecContext } from "./HiveSqlParser";
|
||||
import { DefinedAsSpecContext } from "./HiveSqlParser";
|
||||
import { ShowFunctionIdentifierContext } from "./HiveSqlParser";
|
||||
import { ShowStmtIdentifierContext } from "./HiveSqlParser";
|
||||
import { TableCommentContext } from "./HiveSqlParser";
|
||||
import { CreateTablePartitionSpecContext } from "./HiveSqlParser";
|
||||
@ -331,8 +330,13 @@ import { TableSampleContext } from "./HiveSqlParser";
|
||||
import { TableSourceContext } from "./HiveSqlParser";
|
||||
import { AsOfClauseContext } from "./HiveSqlParser";
|
||||
import { UniqueJoinTableSourceContext } from "./HiveSqlParser";
|
||||
import { DbSchemaNameContext } from "./HiveSqlParser";
|
||||
import { DbSchemaNameCreateContext } from "./HiveSqlParser";
|
||||
import { TableOrViewContext } from "./HiveSqlParser";
|
||||
import { TableNameContext } from "./HiveSqlParser";
|
||||
import { TableNameCreateContext } from "./HiveSqlParser";
|
||||
import { ViewNameContext } from "./HiveSqlParser";
|
||||
import { ViewNameCreateContext } from "./HiveSqlParser";
|
||||
import { SubQuerySourceContext } from "./HiveSqlParser";
|
||||
import { PartitioningSpecContext } from "./HiveSqlParser";
|
||||
import { PartitionTableFunctionSourceContext } from "./HiveSqlParser";
|
||||
@ -389,7 +393,10 @@ import { SortByClauseContext } from "./HiveSqlParser";
|
||||
import { TrimFunctionContext } from "./HiveSqlParser";
|
||||
import { Function_Context } from "./HiveSqlParser";
|
||||
import { Null_treatmentContext } from "./HiveSqlParser";
|
||||
import { FunctionNameContext } from "./HiveSqlParser";
|
||||
import { FunctionNameForDDLContext } from "./HiveSqlParser";
|
||||
import { FunctionNameForInvokeContext } from "./HiveSqlParser";
|
||||
import { UserDefinedFuncNameContext } from "./HiveSqlParser";
|
||||
import { FunctionNameCreateContext } from "./HiveSqlParser";
|
||||
import { CastExpressionContext } from "./HiveSqlParser";
|
||||
import { CaseExpressionContext } from "./HiveSqlParser";
|
||||
import { WhenExpressionContext } from "./HiveSqlParser";
|
||||
@ -458,7 +465,6 @@ import { PartitionSelectorValContext } from "./HiveSqlParser";
|
||||
import { PartitionSelectorOperatorContext } from "./HiveSqlParser";
|
||||
import { SubQuerySelectorOperatorContext } from "./HiveSqlParser";
|
||||
import { SysFuncNamesContext } from "./HiveSqlParser";
|
||||
import { DescFuncNamesContext } from "./HiveSqlParser";
|
||||
import { Id_Context } from "./HiveSqlParser";
|
||||
import { FunctionIdentifierContext } from "./HiveSqlParser";
|
||||
import { PrincipalIdentifierContext } from "./HiveSqlParser";
|
||||
@ -1283,13 +1289,6 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitDefinedAsSpec?: (ctx: DefinedAsSpecContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.showFunctionIdentifier`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitShowFunctionIdentifier?: (ctx: ShowFunctionIdentifierContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.showStmtIdentifier`.
|
||||
* @param ctx the parse tree
|
||||
@ -2823,6 +2822,27 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitUniqueJoinTableSource?: (ctx: UniqueJoinTableSourceContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.dbSchemaName`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitDbSchemaName?: (ctx: DbSchemaNameContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.dbSchemaNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitDbSchemaNameCreate?: (ctx: DbSchemaNameCreateContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.tableOrView`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitTableOrView?: (ctx: TableOrViewContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.tableName`.
|
||||
* @param ctx the parse tree
|
||||
@ -2830,6 +2850,13 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitTableName?: (ctx: TableNameContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.tableNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitTableNameCreate?: (ctx: TableNameCreateContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.viewName`.
|
||||
* @param ctx the parse tree
|
||||
@ -2837,6 +2864,13 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitViewName?: (ctx: ViewNameContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.viewNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitViewNameCreate?: (ctx: ViewNameCreateContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.subQuerySource`.
|
||||
* @param ctx the parse tree
|
||||
@ -3230,11 +3264,32 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
visitNull_treatment?: (ctx: Null_treatmentContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.functionName`.
|
||||
* Visit a parse tree produced by `HiveSqlParser.functionNameForDDL`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitFunctionName?: (ctx: FunctionNameContext) => Result;
|
||||
visitFunctionNameForDDL?: (ctx: FunctionNameForDDLContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.functionNameForInvoke`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitFunctionNameForInvoke?: (ctx: FunctionNameForInvokeContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.userDefinedFuncName`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitUserDefinedFuncName?: (ctx: UserDefinedFuncNameContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.functionNameCreate`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitFunctionNameCreate?: (ctx: FunctionNameCreateContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.castExpression`.
|
||||
@ -3712,13 +3767,6 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitSysFuncNames?: (ctx: SysFuncNamesContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.descFuncNames`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitDescFuncNames?: (ctx: DescFuncNamesContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.id_`.
|
||||
* @param ctx the parse tree
|
||||
|
Reference in New Issue
Block a user