dt-sql-parser
Version:
SQL Parsers for BigData, built with antlr4
1,332 lines (1,331 loc) • 831 kB
JavaScript
// Generated from dt-sql-parser/src/grammar/flink/FlinkSqlParser.g4 by ANTLR 4.13.1
// @ts-nocheck
import * as antlr from "antlr4ng";
import { SQLParserBase } from '../SQLParserBase';
export class FlinkSqlParser extends SQLParserBase {
get grammarFileName() { return "FlinkSqlParser.g4"; }
get literalNames() { return FlinkSqlParser.literalNames; }
get symbolicNames() { return FlinkSqlParser.symbolicNames; }
get ruleNames() { return FlinkSqlParser.ruleNames; }
get serializedATN() { return FlinkSqlParser._serializedATN; }
createFailedPredicateException(predicate, message) {
return new antlr.FailedPredicateException(this, predicate, message);
}
constructor(input) {
super(input);
this.interpreter = new antlr.ParserATNSimulator(this, FlinkSqlParser._ATN, FlinkSqlParser.decisionsToDFA, new antlr.PredictionContextCache());
}
program() {
let localContext = new ProgramContext(this.context, this.state);
this.enterRule(localContext, 0, FlinkSqlParser.RULE_program);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 389;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
while (_la === 8 || _la === 24 || _la === 72 || ((((_la - 109)) & ~0x1F) === 0 && ((1 << (_la - 109)) & 75497601) !== 0) || _la === 177 || ((((_la - 313)) & ~0x1F) === 0 && ((1 << (_la - 313)) & 822083585) !== 0) || ((((_la - 411)) & ~0x1F) === 0 && ((1 << (_la - 411)) & 142606353) !== 0) || _la === 451 || _la === 469 || ((((_la - 490)) & ~0x1F) === 0 && ((1 << (_la - 490)) & 134219777) !== 0) || _la === 522) {
{
{
this.state = 386;
this.singleStatement();
}
}
this.state = 391;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
}
this.state = 392;
this.match(FlinkSqlParser.EOF);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
singleStatement() {
let localContext = new SingleStatementContext(this.context, this.state);
this.enterRule(localContext, 2, FlinkSqlParser.RULE_singleStatement);
try {
this.state = 399;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case FlinkSqlParser.KW_ALTER:
case FlinkSqlParser.KW_BEGIN:
case FlinkSqlParser.KW_CREATE:
case FlinkSqlParser.KW_DESCRIBE:
case FlinkSqlParser.KW_DROP:
case FlinkSqlParser.KW_EXECUTE:
case FlinkSqlParser.KW_EXPLAIN:
case FlinkSqlParser.KW_INSERT:
case FlinkSqlParser.KW_RESET:
case FlinkSqlParser.KW_SELECT:
case FlinkSqlParser.KW_SET:
case FlinkSqlParser.KW_SHOW:
case FlinkSqlParser.KW_USE:
case FlinkSqlParser.KW_VALUES:
case FlinkSqlParser.KW_WITH:
case FlinkSqlParser.KW_ADD:
case FlinkSqlParser.KW_DESC:
case FlinkSqlParser.KW_LOAD:
case FlinkSqlParser.KW_REMOVE:
case FlinkSqlParser.KW_UNLOAD:
case FlinkSqlParser.LR_BRACKET:
this.enterOuterAlt(localContext, 1);
{
this.state = 394;
this.sqlStatement();
this.state = 396;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 1, this.context)) {
case 1:
{
this.state = 395;
this.match(FlinkSqlParser.SEMICOLON);
}
break;
}
}
break;
case FlinkSqlParser.SEMICOLON:
this.enterOuterAlt(localContext, 2);
{
this.state = 398;
this.emptyStatement();
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
sqlStatement() {
let localContext = new SqlStatementContext(this.context, this.state);
this.enterRule(localContext, 4, FlinkSqlParser.RULE_sqlStatement);
try {
this.state = 413;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 3, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 401;
this.ddlStatement();
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 402;
this.dmlStatement();
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 403;
this.describeStatement();
}
break;
case 4:
this.enterOuterAlt(localContext, 4);
{
this.state = 404;
this.explainStatement();
}
break;
case 5:
this.enterOuterAlt(localContext, 5);
{
this.state = 405;
this.useStatement();
}
break;
case 6:
this.enterOuterAlt(localContext, 6);
{
this.state = 406;
this.showStatement();
}
break;
case 7:
this.enterOuterAlt(localContext, 7);
{
this.state = 407;
this.loadStatement();
}
break;
case 8:
this.enterOuterAlt(localContext, 8);
{
this.state = 408;
this.unloadStatement();
}
break;
case 9:
this.enterOuterAlt(localContext, 9);
{
this.state = 409;
this.setStatement();
}
break;
case 10:
this.enterOuterAlt(localContext, 10);
{
this.state = 410;
this.resetStatement();
}
break;
case 11:
this.enterOuterAlt(localContext, 11);
{
this.state = 411;
this.jarStatement();
}
break;
case 12:
this.enterOuterAlt(localContext, 12);
{
this.state = 412;
this.dtAddStatement();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
emptyStatement() {
let localContext = new EmptyStatementContext(this.context, this.state);
this.enterRule(localContext, 6, FlinkSqlParser.RULE_emptyStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 415;
this.match(FlinkSqlParser.SEMICOLON);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
ddlStatement() {
let localContext = new DdlStatementContext(this.context, this.state);
this.enterRule(localContext, 8, FlinkSqlParser.RULE_ddlStatement);
try {
this.state = 431;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 4, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 417;
this.createTable();
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 418;
this.createDatabase();
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 419;
this.createView();
}
break;
case 4:
this.enterOuterAlt(localContext, 4);
{
this.state = 420;
this.createFunction();
}
break;
case 5:
this.enterOuterAlt(localContext, 5);
{
this.state = 421;
this.createCatalog();
}
break;
case 6:
this.enterOuterAlt(localContext, 6);
{
this.state = 422;
this.alterTable();
}
break;
case 7:
this.enterOuterAlt(localContext, 7);
{
this.state = 423;
this.alterView();
}
break;
case 8:
this.enterOuterAlt(localContext, 8);
{
this.state = 424;
this.alterDatabase();
}
break;
case 9:
this.enterOuterAlt(localContext, 9);
{
this.state = 425;
this.alterFunction();
}
break;
case 10:
this.enterOuterAlt(localContext, 10);
{
this.state = 426;
this.dropCatalog();
}
break;
case 11:
this.enterOuterAlt(localContext, 11);
{
this.state = 427;
this.dropTable();
}
break;
case 12:
this.enterOuterAlt(localContext, 12);
{
this.state = 428;
this.dropDatabase();
}
break;
case 13:
this.enterOuterAlt(localContext, 13);
{
this.state = 429;
this.dropView();
}
break;
case 14:
this.enterOuterAlt(localContext, 14);
{
this.state = 430;
this.dropFunction();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
dmlStatement() {
let localContext = new DmlStatementContext(this.context, this.state);
this.enterRule(localContext, 10, FlinkSqlParser.RULE_dmlStatement);
try {
this.state = 435;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case FlinkSqlParser.KW_SELECT:
case FlinkSqlParser.KW_VALUES:
case FlinkSqlParser.KW_WITH:
case FlinkSqlParser.LR_BRACKET:
this.enterOuterAlt(localContext, 1);
{
this.state = 433;
this.queryStatement(0);
}
break;
case FlinkSqlParser.KW_BEGIN:
case FlinkSqlParser.KW_EXECUTE:
case FlinkSqlParser.KW_INSERT:
this.enterOuterAlt(localContext, 2);
{
this.state = 434;
this.insertStatement();
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
describeStatement() {
let localContext = new DescribeStatementContext(this.context, this.state);
this.enterRule(localContext, 12, FlinkSqlParser.RULE_describeStatement);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 437;
_la = this.tokenStream.LA(1);
if (!(_la === 109 || _la === 451)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 438;
this.tablePath();
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
explainStatement() {
let localContext = new ExplainStatementContext(this.context, this.state);
this.enterRule(localContext, 14, FlinkSqlParser.RULE_explainStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 440;
this.match(FlinkSqlParser.KW_EXPLAIN);
this.state = 444;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case FlinkSqlParser.KW_CHANGELOG_MODE:
case FlinkSqlParser.KW_ESTIMATED_COST:
case FlinkSqlParser.KW_JSON_EXECUTION_PLAN:
{
this.state = 441;
this.explainDetails();
}
break;
case FlinkSqlParser.KW_PLAN:
{
this.state = 442;
this.match(FlinkSqlParser.KW_PLAN);
this.state = 443;
this.match(FlinkSqlParser.KW_FOR);
}
break;
case FlinkSqlParser.KW_BEGIN:
case FlinkSqlParser.KW_EXECUTE:
case FlinkSqlParser.KW_INSERT:
case FlinkSqlParser.KW_SELECT:
case FlinkSqlParser.KW_STATEMENT:
case FlinkSqlParser.KW_VALUES:
case FlinkSqlParser.KW_WITH:
case FlinkSqlParser.LR_BRACKET:
break;
default:
break;
}
this.state = 449;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 7, this.context)) {
case 1:
{
this.state = 446;
this.dmlStatement();
}
break;
case 2:
{
this.state = 447;
this.insertSimpleStatement();
}
break;
case 3:
{
this.state = 448;
this.insertMulStatement();
}
break;
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
explainDetails() {
let localContext = new ExplainDetailsContext(this.context, this.state);
this.enterRule(localContext, 16, FlinkSqlParser.RULE_explainDetails);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 451;
this.explainDetail();
this.state = 456;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
while (_la === 521) {
{
{
this.state = 452;
this.match(FlinkSqlParser.COMMA);
this.state = 453;
this.explainDetail();
}
}
this.state = 458;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
explainDetail() {
let localContext = new ExplainDetailContext(this.context, this.state);
this.enterRule(localContext, 18, FlinkSqlParser.RULE_explainDetail);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 459;
_la = this.tokenStream.LA(1);
if (!(_la === 45 || _la === 128 || _la === 189)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
useStatement() {
let localContext = new UseStatementContext(this.context, this.state);
this.enterRule(localContext, 20, FlinkSqlParser.RULE_useStatement);
try {
this.state = 467;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 9, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 461;
this.match(FlinkSqlParser.KW_USE);
this.state = 462;
this.match(FlinkSqlParser.KW_CATALOG);
this.state = 463;
this.catalogPath();
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 464;
this.match(FlinkSqlParser.KW_USE);
this.state = 465;
this.databasePath();
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 466;
this.useModuleStatement();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
useModuleStatement() {
let localContext = new UseModuleStatementContext(this.context, this.state);
this.enterRule(localContext, 22, FlinkSqlParser.RULE_useModuleStatement);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 469;
this.match(FlinkSqlParser.KW_USE);
this.state = 470;
this.match(FlinkSqlParser.KW_MODULES);
this.state = 471;
this.uid();
this.state = 476;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
while (_la === 521) {
{
{
this.state = 472;
this.match(FlinkSqlParser.COMMA);
this.state = 473;
this.uid();
}
}
this.state = 478;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
showStatement() {
let localContext = new ShowStatementContext(this.context, this.state);
this.enterRule(localContext, 24, FlinkSqlParser.RULE_showStatement);
let _la;
try {
this.state = 521;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 18, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 479;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 480;
_la = this.tokenStream.LA(1);
if (!(_la === 42 || _la === 90 || _la === 423 || _la === 465)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 481;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 482;
this.match(FlinkSqlParser.KW_CURRENT);
this.state = 483;
_la = this.tokenStream.LA(1);
if (!(_la === 442 || _la === 448)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 484;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 485;
this.match(FlinkSqlParser.KW_TABLES);
this.state = 488;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 151 || _la === 170) {
{
this.state = 486;
_la = this.tokenStream.LA(1);
if (!(_la === 151 || _la === 170)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 487;
this.databasePath();
}
}
this.state = 491;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 203 || _la === 242) {
{
this.state = 490;
this.likePredicate();
}
}
}
break;
case 4:
this.enterOuterAlt(localContext, 4);
{
this.state = 493;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 494;
this.match(FlinkSqlParser.KW_COLUMNS);
this.state = 495;
_la = this.tokenStream.LA(1);
if (!(_la === 151 || _la === 170)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 498;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 13, this.context)) {
case 1:
{
this.state = 496;
this.viewPath();
}
break;
case 2:
{
this.state = 497;
this.tablePath();
}
break;
}
this.state = 501;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 203 || _la === 242) {
{
this.state = 500;
this.likePredicate();
}
}
}
break;
case 5:
this.enterOuterAlt(localContext, 5);
{
this.state = 503;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 504;
this.match(FlinkSqlParser.KW_CREATE);
this.state = 509;
this.errorHandler.sync(this);
switch (this.tokenStream.LA(1)) {
case FlinkSqlParser.KW_TABLE:
{
this.state = 505;
this.match(FlinkSqlParser.KW_TABLE);
this.state = 506;
this.tablePath();
}
break;
case FlinkSqlParser.KW_VIEW:
{
this.state = 507;
this.match(FlinkSqlParser.KW_VIEW);
this.state = 508;
this.viewPath();
}
break;
default:
throw new antlr.NoViableAltException(this);
}
}
break;
case 6:
this.enterOuterAlt(localContext, 6);
{
this.state = 511;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 513;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 412) {
{
this.state = 512;
this.match(FlinkSqlParser.KW_USER);
}
}
this.state = 515;
this.match(FlinkSqlParser.KW_FUNCTIONS);
}
break;
case 7:
this.enterOuterAlt(localContext, 7);
{
this.state = 516;
this.match(FlinkSqlParser.KW_SHOW);
this.state = 518;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 152) {
{
this.state = 517;
this.match(FlinkSqlParser.KW_FULL);
}
}
this.state = 520;
this.match(FlinkSqlParser.KW_MODULES);
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
loadStatement() {
let localContext = new LoadStatementContext(this.context, this.state);
this.enterRule(localContext, 26, FlinkSqlParser.RULE_loadStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 523;
this.match(FlinkSqlParser.KW_LOAD);
this.state = 524;
this.match(FlinkSqlParser.KW_MODULE);
this.state = 525;
this.uid();
this.state = 528;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 19, this.context)) {
case 1:
{
this.state = 526;
this.match(FlinkSqlParser.KW_WITH);
this.state = 527;
this.tablePropertyList();
}
break;
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
unloadStatement() {
let localContext = new UnloadStatementContext(this.context, this.state);
this.enterRule(localContext, 28, FlinkSqlParser.RULE_unloadStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 530;
this.match(FlinkSqlParser.KW_UNLOAD);
this.state = 531;
this.match(FlinkSqlParser.KW_MODULE);
this.state = 532;
this.uid();
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
setStatement() {
let localContext = new SetStatementContext(this.context, this.state);
this.enterRule(localContext, 30, FlinkSqlParser.RULE_setStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 534;
this.match(FlinkSqlParser.KW_SET);
this.state = 536;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 20, this.context)) {
case 1:
{
this.state = 535;
this.tableProperty();
}
break;
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
resetStatement() {
let localContext = new ResetStatementContext(this.context, this.state);
this.enterRule(localContext, 32, FlinkSqlParser.RULE_resetStatement);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 538;
this.match(FlinkSqlParser.KW_RESET);
this.state = 540;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 21, this.context)) {
case 1:
{
this.state = 539;
this.tablePropertyKey();
}
break;
}
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
jarStatement() {
let localContext = new JarStatementContext(this.context, this.state);
this.enterRule(localContext, 34, FlinkSqlParser.RULE_jarStatement);
let _la;
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 542;
_la = this.tokenStream.LA(1);
if (!(_la === 438 || _la === 490)) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 543;
this.match(FlinkSqlParser.KW_JAR);
this.state = 544;
this.jarFileName();
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
dtAddStatement() {
let localContext = new DtAddStatementContext(this.context, this.state);
this.enterRule(localContext, 36, FlinkSqlParser.RULE_dtAddStatement);
let _la;
try {
this.state = 596;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 25, this.context)) {
case 1:
this.enterOuterAlt(localContext, 1);
{
this.state = 546;
this.match(FlinkSqlParser.KW_ADD);
this.state = 547;
this.match(FlinkSqlParser.KW_JAR);
this.state = 548;
this.match(FlinkSqlParser.KW_WITH);
this.state = 549;
this.dtFilePath();
this.state = 552;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 17) {
{
this.state = 550;
this.match(FlinkSqlParser.KW_AS);
this.state = 551;
this.uid();
}
}
}
break;
case 2:
this.enterOuterAlt(localContext, 2);
{
this.state = 554;
this.match(FlinkSqlParser.KW_ADD);
this.state = 555;
this.match(FlinkSqlParser.KW_FILE);
this.state = 556;
this.match(FlinkSqlParser.KW_WITH);
this.state = 557;
this.dtFilePath();
this.state = 560;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 17) {
{
this.state = 558;
this.match(FlinkSqlParser.KW_AS);
this.state = 559;
this.uid();
}
}
this.state = 564;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 312) {
{
this.state = 562;
this.match(FlinkSqlParser.KW_RENAME);
this.state = 563;
this.uid();
}
}
}
break;
case 3:
this.enterOuterAlt(localContext, 3);
{
this.state = 566;
this.match(FlinkSqlParser.KW_ADD);
this.state = 567;
_la = this.tokenStream.LA(1);
if (!(((((_la - 483)) & ~0x1F) === 0 && ((1 << (_la - 483)) & 47) !== 0))) {
this.errorHandler.recoverInline(this);
}
else {
this.errorHandler.reportMatch(this);
this.consume();
}
this.state = 568;
this.match(FlinkSqlParser.KW_WITH);
this.state = 569;
this.dtFilePath();
this.state = 570;
this.match(FlinkSqlParser.KW_RENAME);
this.state = 571;
this.uid();
}
break;
case 4:
this.enterOuterAlt(localContext, 4);
{
this.state = 573;
this.match(FlinkSqlParser.KW_ADD);
this.state = 574;
this.match(FlinkSqlParser.KW_PYTHON_PARAMETER);
this.state = 575;
this.dtFilePath();
}
break;
case 5:
this.enterOuterAlt(localContext, 5);
{
this.state = 576;
this.match(FlinkSqlParser.KW_ADD);
this.state = 577;
this.match(FlinkSqlParser.KW_ENGINE);
this.state = 578;
this.match(FlinkSqlParser.KW_FILE);
this.state = 579;
this.match(FlinkSqlParser.KW_WITH);
this.state = 580;
this.dtFilePath();
this.state = 581;
this.match(FlinkSqlParser.KW_RENAME);
this.state = 582;
this.uid();
this.state = 583;
this.match(FlinkSqlParser.KW_KEY);
this.state = 584;
this.uid();
}
break;
case 6:
this.enterOuterAlt(localContext, 6);
{
this.state = 586;
this.match(FlinkSqlParser.KW_ADD);
this.state = 587;
this.match(FlinkSqlParser.KW_CONFIG);
this.state = 588;
this.match(FlinkSqlParser.KW_FILE);
this.state = 589;
this.match(FlinkSqlParser.KW_WITH);
this.state = 590;
this.dtFilePath();
this.state = 591;
this.match(FlinkSqlParser.KW_FOR);
this.state = 592;
this.uid();
this.state = 593;
this.match(FlinkSqlParser.KW_AS);
this.state = 594;
this.uid();
}
break;
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
dtFilePath() {
let localContext = new DtFilePathContext(this.context, this.state);
this.enterRule(localContext, 38, FlinkSqlParser.RULE_dtFilePath);
let _la;
try {
let alternative;
this.enterOuterAlt(localContext, 1);
{
this.state = 602;
this.errorHandler.sync(this);
alternative = 1;
do {
switch (alternative) {
case 1:
{
{
this.state = 599;
this.errorHandler.sync(this);
_la = this.tokenStream.LA(1);
if (_la === 535) {
{
this.state = 598;
this.match(FlinkSqlParser.SLASH_SIGN);
}
}
this.state = 601;
this.uid();
}
}
break;
default:
throw new antlr.NoViableAltException(this);
}
this.state = 604;
this.errorHandler.sync(this);
alternative = this.interpreter.adaptivePredict(this.tokenStream, 27, this.context);
} while (alternative !== 2 && alternative !== antlr.ATN.INVALID_ALT_NUMBER);
}
}
catch (re) {
if (re instanceof antlr.RecognitionException) {
localContext.exception = re;
this.errorHandler.reportError(this, re);
this.errorHandler.recover(this, re);
}
else {
throw re;
}
}
finally {
this.exitRule();
}
return localContext;
}
createTable() {
let localContext = new CreateTableContext(this.context, this.state);
this.enterRule(localContext, 40, FlinkSqlParser.RULE_createTable);
try {
this.enterOuterAlt(localContext, 1);
{
this.state = 608;
this.errorHandler.sync(this);
switch (this.interpreter.adaptivePredict(this.tokenStream, 28, this.context)) {
case 1:
{
this.state = 606;
this.simpleCreateTable();
}
break;
case 2:
{
this.state = 607;