UNPKG

sql-grammar

Version:

sql grammar

816 lines 1.86 MB
/* eslint-disable */ "use strict"; // Generated from grammer1/HiveParser.g4 by ANTLR 4.7.3-SNAPSHOT Object.defineProperty(exports, "__esModule", { value: true }); exports.DropMappingStatementContext = exports.AlterMappingStatementContext = exports.CreateMappingStatementContext = exports.DropPoolStatementContext = exports.AlterPoolStatementContext = exports.CreatePoolStatementContext = exports.PoolAssignListContext = exports.PoolAssignContext = exports.DropTriggerStatementContext = exports.AlterTriggerStatementContext = exports.CreateTriggerStatementContext = exports.TriggerActionExpressionStandaloneContext = exports.TriggerActionExpressionContext = exports.ComparisionOperatorContext = exports.TriggerLiteralContext = exports.TriggerAtomExpressionContext = exports.TriggerAndExpressionContext = exports.TriggerOrExpressionContext = exports.TriggerExpressionStandaloneContext = exports.TriggerExpressionContext = exports.PoolPathContext = exports.DropResourcePlanStatementContext = exports.ReplaceResourcePlanStatementContext = exports.GlobalWmStatementContext = exports.AlterResourcePlanStatementContext = exports.UnmanagedContext = exports.DisableContext = exports.EnableContext = exports.ActivateContext = exports.WithReplaceContext = exports.CreateResourcePlanStatementContext = exports.RpUnassignListContext = exports.RpUnassignContext = exports.RpAssignListContext = exports.RpAssignContext = exports.ResourcePlanDdlStatementsContext = exports.Sql11ReservedKeywordsUsedAsFunctionNameContext = exports.NonReservedContext = exports.PrincipalIdentifierContext = exports.FunctionIdentifierContext = exports.IdentifierContext = exports.DescFuncNamesContext = exports.SysFuncNamesContext = exports.DropPartitionOperatorContext = exports.DropPartitionValContext = exports.DropPartitionSpecContext = exports.PartitionValContext = exports.PartitionSpecContext = exports.TableOrPartitionContext = exports.BooleanValueTokContext = exports.BooleanValueContext = exports.PrecedenceSimilarExpressionPartNotContext = exports.PrecedenceSimilarExpressionInContext = exports.PrecedenceSimilarExpressionAtomContext = exports.PrecedenceSimilarExpressionPartContext = exports.SubQueryExpressionContext = exports.ExpressionContext = exports.PrecedenceOrOperatorContext = exports.PrecedenceAndOperatorContext = exports.PrecedenceNotOperatorContext = exports.PrecedenceEqualOperatorContext = exports.PrecedenceDistinctOperatorContext = exports.PrecedenceSimilarOperatorContext = exports.PrecedenceRegexpOperatorContext = exports.PrecedenceBitwiseOrOperatorContext = exports.PrecedenceAmpersandOperatorContext = exports.PrecedenceConcatenateOperatorContext = exports.PrecedencePlusOperatorContext = exports.PrecedenceStarOperatorContext = exports.PrecedenceBitwiseXorOperatorContext = exports.IsConditionContext = exports.PrecedenceUnaryOperatorContext = exports.AtomExpressionContext = exports.IntervalQualifiersContext = exports.IntervalExpressionContext = exports.IntervalLiteralContext = exports.IntervalValueContext = exports.TimestampLocalTZLiteralContext = exports.TimestampLiteralContext = exports.DateLiteralContext = exports.CharSetStringLiteralContext = exports.StringLiteralSequenceContext = exports.ConstantContext = exports.TimeQualifiersContext = exports.ExtractExpressionContext = exports.FloorDateQualifiersContext = exports.FloorExpressionContext = exports.WhenExpressionContext = exports.CaseExpressionContext = exports.CastExpressionContext = exports.FunctionNameContext = exports.FunctionContext = exports.SortByClauseContext = exports.DistributeByClauseContext = exports.PartitionByClauseContext = exports.ClusterByClauseContext = exports.OrderByClauseContext = exports.ColumnRefOrderNotInParenthesisContext = exports.ColumnRefOrderInParenthesisContext = exports.ExpressionsContext = exports.ExpressionPartContext = exports.ExpressionsNotInParenthesisContext = exports.ExpressionsInParenthesisContext = exports.HavingConditionContext = exports.HavingClauseContext = exports.GroupingExpressionSingleContext = exports.GroupingSetExpressionMultipleContext = exports.GroupingSetExpressionContext = exports.RollupOldSyntaxContext = exports.RollupStandardContext = exports.GroupByEmptyContext = exports.Groupby_expressionContext = exports.GroupByClauseContext = exports.VirtualTableSourceContext = exports.ValueRowConstructorContext = exports.ValuesTableConstructorContext = exports.ValuesClauseContext = exports.SearchConditionContext = exports.WhereClauseContext = exports.PartitionedTableFunctionContext = exports.PartitionTableFunctionSourceContext = exports.PartitioningSpecContext = exports.SubQuerySourceContext = exports.ViewNameContext = exports.TableNameContext = exports.UniqueJoinTableSourceContext = exports.TableSourceContext = exports.TableSampleContext = exports.SplitSampleContext = exports.TableBucketSampleContext = exports.TableAliasContext = exports.LateralViewContext = exports.JoinTokenContext = exports.UniqueJoinTokenContext = exports.UniqueJoinExprContext = exports.UniqueJoinSourceContext = exports.JoinSourcePartContext = exports.JoinSourceContext = exports.AtomjoinSourceContext = exports.FromSourceContext = exports.FromClauseContext = exports.AliasListContext = exports.ExpressionListContext = exports.TableOrColumnContext = exports.TableAllColumnsContext = exports.Window_frame_boundaryContext = exports.Window_frame_start_boundaryContext = exports.Window_value_expressionContext = exports.Window_range_expressionContext = exports.Window_frameContext = exports.Window_specificationContext = exports.Window_defnContext = exports.Window_clauseContext = exports.SelectExpressionListContext = exports.SelectExpressionContext = exports.TrfmClauseContext = exports.SelectItemContext = exports.SelectTrfmClauseContext = exports.SelectListContext = exports.SelectClauseContext = exports.KillQueryStatementContext = exports.UpdateOrDeleteContext = exports.WhenMatchedThenClauseContext = exports.WhenMatchedAndClauseContext = exports.WhenNotMatchedClauseContext = exports.WhenClausesContext = exports.MergeStatementContext = exports.AbortTransactionStatementContext = exports.SetAutoCommitStatementContext = exports.RollbackStatementContext = exports.CommitStatementContext = exports.LevelOfIsolationContext = exports.IsolationLevelContext = exports.TransactionAccessModeContext = exports.TransactionModeContext = exports.StartTransactionStatementContext = exports.SqlTransactionStatementContext = exports.UpdateStatementContext = exports.SetColumnsClauseContext = exports.ColumnAssignmentClauseContext = exports.DeleteStatementContext = exports.LimitClauseContext = exports.DestinationContext = exports.InsertClauseContext = exports.BodyContext = exports.SelectStatementWithCTEContext = exports.SetOpSelectStatementContext = exports.SelectStatementContext = exports.AtomSelectStatementContext = exports.RegularBodyContext = exports.SingleFromStatementContext = exports.FromStatementContext = exports.CteStatementContext = exports.WithClauseContext = exports.QueryStatementExpressionBodyContext = exports.QueryStatementExpressionContext = exports.SetOperatorContext = exports.UnionTypeContext = exports.MapTypeContext = exports.StructTypeContext = exports.ListTypeContext = exports.PrimitiveTypeContext = exports.Type_db_colContext = exports.ColTypeListContext = exports.ColTypeContext = exports.ColumnNameColonTypeContext = exports.ConstraintOptsAlterContext = exports.ConstraintOptsCreateContext = exports.TableConstraintTypeContext = exports.DefaultValContext = exports.ColumnConstraintTypeContext = exports.AlterColConstraintContext = exports.AlterForeignKeyConstraintContext = exports.AlterColumnConstraintContext = exports.ColConstraintContext = exports.ForeignKeyConstraintContext = exports.ColumnConstraintContext = exports.ColumnNameTypeConstraintContext = exports.TableConstraintContext = exports.ColumnNameTypeOrConstraintContext = exports.ColumnNameTypeContext = exports.ColumnRefOrderContext = exports.ColumnNameCommentContext = exports.ColumnNameCommentListContext = exports.ColumnNameOrderContext = exports.NullOrderingContext = exports.OrderSpecificationContext = exports.SkewedValueLocationElementContext = exports.SkewedColumnValueContext = exports.SkewedColumnValuesContext = exports.SkewedColumnValuePairContext = exports.SkewedColumnValuePairListContext = exports.SkewedValueElementContext = exports.AlterForeignKeyWithNameContext = exports.CreateForeignKeyContext = exports.CheckConstraintContext = exports.PkUkConstraintContext = exports.TableLevelConstraintContext = exports.AlterConstraintWithNameContext = exports.CreateConstraintContext = exports.RelySpecificationContext = exports.EnforcedSpecificationContext = exports.ValidateSpecificationContext = exports.EnableSpecificationContext = exports.EnableValidateSpecificationContext = exports.ColumnParenthesesListContext = exports.ColumnNameOrderListContext = exports.ExtColumnNameContext = exports.ColumnNameContext = exports.ColumnNameListContext = exports.ColumnNameColonTypeListContext = exports.ColumnNameTypeOrConstraintListContext = exports.ColumnNameTypeListContext = exports.TableLocationContext = exports.TableFileFormatContext = exports.TableRowNullFormatContext = exports.TableRowFormatLinesIdentifierContext = exports.TableRowFormatMapKeysIdentifierContext = exports.TableRowFormatCollItemsIdentifierContext = exports.TableRowFormatFieldIdentifierContext = exports.KeyPropertyContext = exports.KeyValuePropertyContext = exports.TablePropertiesListContext = exports.TablePropertiesContext = exports.TablePropertiesPrefixedContext = exports.TableRowFormatContext = exports.RowFormatDelimitedContext = exports.RowFormatSerdeContext = exports.RecordWriterContext = exports.RecordReaderContext = exports.RowFormatContext = exports.TableSkewedContext = exports.TableBucketsContext = exports.TablePartitionContext = exports.TableCommentContext = exports.ShowStmtIdentifierContext = exports.ShowFunctionIdentifierContext = exports.DropMaterializedViewStatementContext = exports.DropViewStatementContext = exports.ViewPartitionContext = exports.CreateMaterializedViewStatementContext = exports.CreateViewStatementContext = exports.DropMacroStatementContext = exports.CreateMacroStatementContext = exports.ReloadFunctionStatementContext = exports.DropFunctionStatementContext = exports.CreateFunctionStatementContext = exports.ResourceTypeContext = exports.ResourceContext = exports.ResourceListContext = exports.MetastoreCheckContext = exports.WithAdminOptionContext = exports.AdminOptionForContext = exports.GrantOptionForContext = exports.WithGrantOptionContext = exports.PrincipalNameContext = exports.PrincipalSpecificationContext = exports.PrivilegeTypeContext = exports.PrivlegeDefContext = exports.PrivilegeListContext = exports.PrivObjectColsContext = exports.PrivObjectContext = exports.PrivilegeObjectContext = exports.PrivilegeIncludeColObjectContext = exports.ShowRolePrincipalsContext = exports.ShowGrantsContext = exports.SetRoleContext = exports.ShowCurrentRoleContext = exports.ShowRolesContext = exports.ShowRoleGrantsContext = exports.RevokeRoleContext = exports.GrantRoleContext = exports.RevokePrivilegesContext = exports.GrantPrivilegesContext = exports.DropRoleStatementContext = exports.CreateRoleStatementContext = exports.UnlockDatabaseContext = exports.UnlockStatementContext = exports.LockModeContext = exports.LockDatabaseContext = exports.LockStatementContext = exports.ShowStatementContext = exports.AnalyzeStatementContext = exports.DescStatementContext = exports.TabPartColTypeExprContext = exports.PartTypeExprContext = exports.TabTypeExprContext = exports.InputFileFormatContext = exports.FileFormatContext = exports.AlterStatementSuffixSetOwnerContext = exports.AlterStatementSuffixCompactContext = exports.BlockingContext = exports.AlterStatementSuffixBucketNumContext = exports.AlterStatementSuffixMergeFilesContext = exports.AlterStatementSuffixStatsPartContext = exports.AlterStatementSuffixRenamePartContext = exports.AlterStatementSuffixExchangePartitionContext = exports.AlterStatementSuffixSkewedbyContext = exports.AlterStatementSuffixLocationContext = exports.SkewedLocationMapContext = exports.SkewedLocationsListContext = exports.SkewedLocationsContext = exports.AlterTblPartitionStatementSuffixSkewedLocationContext = exports.AlterStatementSuffixClusterbySortbyContext = exports.AlterStatementSuffixFileFormatContext = exports.TablePartitionPrefixContext = exports.AlterStatementSuffixSerdePropertiesContext = exports.AlterMaterializedViewSuffixRebuildContext = exports.AlterMaterializedViewSuffixRewriteContext = exports.AlterViewSuffixPropertiesContext = exports.AlterStatementSuffixPropertiesContext = exports.AlterStatementSuffixDropPartitionsContext = exports.PartitionLocationContext = exports.AlterStatementSuffixUnArchiveContext = exports.AlterStatementSuffixArchiveContext = exports.AlterStatementSuffixTouchContext = exports.AlterStatementSuffixAddPartitionsElementContext = exports.AlterStatementSuffixAddPartitionsContext = exports.AlterStatementChangeColPositionContext = exports.AlterStatementSuffixUpdateStatsContext = exports.AlterStatementSuffixUpdateStatsColContext = exports.AlterStatementSuffixRenameColContext = exports.AlterStatementSuffixDropConstraintContext = exports.AlterStatementSuffixUpdateColumnsContext = exports.AlterStatementSuffixAddConstraintContext = exports.AlterStatementSuffixAddColContext = exports.AlterStatementSuffixRenameContext = exports.AlterDatabaseSuffixSetLocationContext = exports.AlterDatabaseSuffixSetOwnerContext = exports.AlterDatabaseSuffixPropertiesContext = exports.AlterDatabaseStatementSuffixContext = exports.AlterMaterializedViewStatementSuffixContext = exports.AlterViewStatementSuffixContext = exports.AlterStatementPartitionKeyTypeContext = exports.AlterTblPartitionStatementSuffixContext = exports.AlterTableStatementSuffixContext = exports.AlterStatementContext = exports.DropTableStatementContext = exports.TruncateTableStatementContext = exports.CreateTableStatementContext = exports.DatabaseCommentContext = exports.DropDatabaseStatementContext = exports.SwitchDatabaseStatementContext = exports.DbPropertiesListContext = exports.DbPropertiesContext = exports.DbLocationContext = exports.CreateDatabaseStatementContext = exports.OrReplaceContext = exports.StoredAsDirsContext = exports.RewriteDisabledContext = exports.RewriteEnabledContext = exports.IfNotExistsContext = exports.RestrictOrCascadeContext = exports.IfExistsContext = exports.DdlStatementContext = exports.ReplStatusStatementContext = exports.ReplConfigsListContext = exports.ReplConfigsContext = exports.ReplLoadStatementContext = exports.ReplDumpStatementContext = exports.ImportStatementContext = exports.ExportStatementContext = exports.ReplicationClauseContext = exports.LoadStatementContext = exports.ExecStatementContext = exports.VectorizatonDetailContext = exports.VectorizationOnlyContext = exports.ExplainOptionContext = exports.ExplainStatementContext = exports.StatementContext = exports.HiveParser = void 0; const ATN_1 = require("antlr4ts/atn/ATN"); const ATNDeserializer_1 = require("antlr4ts/atn/ATNDeserializer"); const FailedPredicateException_1 = require("antlr4ts/FailedPredicateException"); const NoViableAltException_1 = require("antlr4ts/NoViableAltException"); const Parser_1 = require("antlr4ts/Parser"); const ParserRuleContext_1 = require("antlr4ts/ParserRuleContext"); const ParserATNSimulator_1 = require("antlr4ts/atn/ParserATNSimulator"); const RecognitionException_1 = require("antlr4ts/RecognitionException"); const Token_1 = require("antlr4ts/Token"); const VocabularyImpl_1 = require("antlr4ts/VocabularyImpl"); const Utils = require("antlr4ts/misc/Utils"); class HiveParser extends Parser_1.Parser { constructor(input) { super(input); this._interp = new ParserATNSimulator_1.ParserATNSimulator(HiveParser._ATN, this); } // @Override // @NotNull get vocabulary() { return HiveParser.VOCABULARY; } // tslint:enable:no-trailing-whitespace // @Override get grammarFileName() { return "HiveParser.g4"; } // @Override get ruleNames() { return HiveParser.ruleNames; } // @Override get serializedATN() { return HiveParser._serializedATN; } // @RuleVersion(0) statement() { let _localctx = new StatementContext(this._ctx, this.state); this.enterRule(_localctx, 0, HiveParser.RULE_statement); try { this.state = 826; this._errHandler.sync(this); switch (this._input.LA(1)) { case HiveParser.KW_EXPLAIN: this.enterOuterAlt(_localctx, 1); { this.state = 820; this.explainStatement(); this.state = 821; this.match(HiveParser.EOF); } break; case HiveParser.KW_DESC: case HiveParser.KW_FROM: case HiveParser.KW_SELECT: case HiveParser.KW_INSERT: case HiveParser.KW_SHOW: case HiveParser.KW_MSCK: case HiveParser.KW_LOAD: case HiveParser.KW_EXPORT: case HiveParser.KW_IMPORT: case HiveParser.KW_CREATE: case HiveParser.KW_ALTER: case HiveParser.KW_DESCRIBE: case HiveParser.KW_DROP: case HiveParser.KW_MAP: case HiveParser.KW_REDUCE: case HiveParser.KW_KILL: case HiveParser.KW_ENABLE: case HiveParser.KW_DISABLE: case HiveParser.KW_REPLACE: case HiveParser.KW_WITH: case HiveParser.KW_SET: case HiveParser.KW_DELETE: case HiveParser.KW_GRANT: case HiveParser.KW_REVOKE: case HiveParser.KW_LOCK: case HiveParser.KW_UNLOCK: case HiveParser.KW_ANALYZE: case HiveParser.KW_USE: case HiveParser.KW_UPDATE: case HiveParser.KW_TRUNCATE: case HiveParser.KW_RELOAD: case HiveParser.KW_START: case HiveParser.KW_COMMIT: case HiveParser.KW_ROLLBACK: case HiveParser.KW_ABORT: case HiveParser.KW_MERGE: case HiveParser.KW_REPL: case HiveParser.LPAREN: this.enterOuterAlt(_localctx, 2); { this.state = 823; this.execStatement(); this.state = 824; this.match(HiveParser.EOF); } break; default: throw new NoViableAltException_1.NoViableAltException(this); } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) explainStatement() { let _localctx = new ExplainStatementContext(this._ctx, this.state); this.enterRule(_localctx, 2, HiveParser.RULE_explainStatement); try { let _alt; this.enterOuterAlt(_localctx, 1); { this.state = 828; this.match(HiveParser.KW_EXPLAIN); this.state = 838; this._errHandler.sync(this); switch (this._input.LA(1)) { case HiveParser.KW_DESC: case HiveParser.KW_FROM: case HiveParser.KW_SELECT: case HiveParser.KW_INSERT: case HiveParser.KW_SHOW: case HiveParser.KW_MSCK: case HiveParser.KW_LOAD: case HiveParser.KW_EXPORT: case HiveParser.KW_IMPORT: case HiveParser.KW_CREATE: case HiveParser.KW_ALTER: case HiveParser.KW_DESCRIBE: case HiveParser.KW_DROP: case HiveParser.KW_MAP: case HiveParser.KW_REDUCE: case HiveParser.KW_KILL: case HiveParser.KW_ENABLE: case HiveParser.KW_DISABLE: case HiveParser.KW_REPLACE: case HiveParser.KW_EXTENDED: case HiveParser.KW_FORMATTED: case HiveParser.KW_DEPENDENCY: case HiveParser.KW_LOGICAL: case HiveParser.KW_WITH: case HiveParser.KW_SET: case HiveParser.KW_DELETE: case HiveParser.KW_GRANT: case HiveParser.KW_REVOKE: case HiveParser.KW_LOCK: case HiveParser.KW_UNLOCK: case HiveParser.KW_ANALYZE: case HiveParser.KW_USE: case HiveParser.KW_UPDATE: case HiveParser.KW_TRUNCATE: case HiveParser.KW_AUTHORIZATION: case HiveParser.KW_REOPTIMIZATION: case HiveParser.KW_RELOAD: case HiveParser.KW_START: case HiveParser.KW_COMMIT: case HiveParser.KW_ROLLBACK: case HiveParser.KW_ABORT: case HiveParser.KW_MERGE: case HiveParser.KW_REPL: case HiveParser.KW_VECTORIZATION: case HiveParser.LPAREN: { this.state = 832; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); while (_alt !== 2 && _alt !== ATN_1.ATN.INVALID_ALT_NUMBER) { if (_alt === 1) { { { this.state = 829; this.explainOption(); } } } this.state = 834; this._errHandler.sync(this); _alt = this.interpreter.adaptivePredict(this._input, 1, this._ctx); } this.state = 835; this.execStatement(); } break; case HiveParser.KW_REWRITE: { this.state = 836; this.match(HiveParser.KW_REWRITE); this.state = 837; this.queryStatementExpression(); } break; default: throw new NoViableAltException_1.NoViableAltException(this); } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) explainOption() { let _localctx = new ExplainOptionContext(this._ctx, this.state); this.enterRule(_localctx, 4, HiveParser.RULE_explainOption); let _la; try { this.state = 854; this._errHandler.sync(this); switch (this._input.LA(1)) { case HiveParser.KW_EXTENDED: this.enterOuterAlt(_localctx, 1); { this.state = 840; this.match(HiveParser.KW_EXTENDED); } break; case HiveParser.KW_FORMATTED: this.enterOuterAlt(_localctx, 2); { this.state = 841; this.match(HiveParser.KW_FORMATTED); } break; case HiveParser.KW_DEPENDENCY: this.enterOuterAlt(_localctx, 3); { this.state = 842; this.match(HiveParser.KW_DEPENDENCY); } break; case HiveParser.KW_LOGICAL: this.enterOuterAlt(_localctx, 4); { this.state = 843; this.match(HiveParser.KW_LOGICAL); } break; case HiveParser.KW_AUTHORIZATION: this.enterOuterAlt(_localctx, 5); { this.state = 844; this.match(HiveParser.KW_AUTHORIZATION); } break; case HiveParser.KW_ANALYZE: this.enterOuterAlt(_localctx, 6); { this.state = 845; this.match(HiveParser.KW_ANALYZE); } break; case HiveParser.KW_REOPTIMIZATION: this.enterOuterAlt(_localctx, 7); { this.state = 846; this.match(HiveParser.KW_REOPTIMIZATION); } break; case HiveParser.KW_VECTORIZATION: this.enterOuterAlt(_localctx, 8); { { this.state = 847; this.match(HiveParser.KW_VECTORIZATION); this.state = 849; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_ONLY) { { this.state = 848; this.vectorizationOnly(); } } this.state = 852; this._errHandler.sync(this); _la = this._input.LA(1); if (((((_la - 307)) & ~0x1F) === 0 && ((1 << (_la - 307)) & ((1 << (HiveParser.KW_SUMMARY - 307)) | (1 << (HiveParser.KW_OPERATOR - 307)) | (1 << (HiveParser.KW_EXPRESSION - 307)) | (1 << (HiveParser.KW_DETAIL - 307)))) !== 0)) { { this.state = 851; this.vectorizatonDetail(); } } } } break; default: throw new NoViableAltException_1.NoViableAltException(this); } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) vectorizationOnly() { let _localctx = new VectorizationOnlyContext(this._ctx, this.state); this.enterRule(_localctx, 6, HiveParser.RULE_vectorizationOnly); try { this.enterOuterAlt(_localctx, 1); { this.state = 856; this.match(HiveParser.KW_ONLY); } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) vectorizatonDetail() { let _localctx = new VectorizatonDetailContext(this._ctx, this.state); this.enterRule(_localctx, 8, HiveParser.RULE_vectorizatonDetail); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 858; _la = this._input.LA(1); if (!(((((_la - 307)) & ~0x1F) === 0 && ((1 << (_la - 307)) & ((1 << (HiveParser.KW_SUMMARY - 307)) | (1 << (HiveParser.KW_OPERATOR - 307)) | (1 << (HiveParser.KW_EXPRESSION - 307)) | (1 << (HiveParser.KW_DETAIL - 307)))) !== 0))) { this._errHandler.recoverInline(this); } else { if (this._input.LA(1) === Token_1.Token.EOF) { this.matchedEOF = true; } this._errHandler.reportMatch(this); this.consume(); } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) execStatement() { let _localctx = new ExecStatementContext(this._ctx, this.state); this.enterRule(_localctx, 10, HiveParser.RULE_execStatement); try { this.state = 872; this._errHandler.sync(this); switch (this.interpreter.adaptivePredict(this._input, 6, this._ctx)) { case 1: this.enterOuterAlt(_localctx, 1); { this.state = 860; this.queryStatementExpression(); } break; case 2: this.enterOuterAlt(_localctx, 2); { this.state = 861; this.loadStatement(); } break; case 3: this.enterOuterAlt(_localctx, 3); { this.state = 862; this.exportStatement(); } break; case 4: this.enterOuterAlt(_localctx, 4); { this.state = 863; this.importStatement(); } break; case 5: this.enterOuterAlt(_localctx, 5); { this.state = 864; this.replDumpStatement(); } break; case 6: this.enterOuterAlt(_localctx, 6); { this.state = 865; this.replLoadStatement(); } break; case 7: this.enterOuterAlt(_localctx, 7); { this.state = 866; this.replStatusStatement(); } break; case 8: this.enterOuterAlt(_localctx, 8); { this.state = 867; this.ddlStatement(); } break; case 9: this.enterOuterAlt(_localctx, 9); { this.state = 868; this.deleteStatement(); } break; case 10: this.enterOuterAlt(_localctx, 10); { this.state = 869; this.updateStatement(); } break; case 11: this.enterOuterAlt(_localctx, 11); { this.state = 870; this.sqlTransactionStatement(); } break; case 12: this.enterOuterAlt(_localctx, 12); { this.state = 871; this.mergeStatement(); } break; } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) loadStatement() { let _localctx = new LoadStatementContext(this._ctx, this.state); this.enterRule(_localctx, 12, HiveParser.RULE_loadStatement); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 874; this.match(HiveParser.KW_LOAD); this.state = 875; this.match(HiveParser.KW_DATA); this.state = 877; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_LOCAL) { { this.state = 876; this.match(HiveParser.KW_LOCAL); } } this.state = 879; this.match(HiveParser.KW_INPATH); this.state = 880; this.match(HiveParser.StringLiteral); this.state = 882; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_OVERWRITE) { { this.state = 881; this.match(HiveParser.KW_OVERWRITE); } } this.state = 884; this.match(HiveParser.KW_INTO); this.state = 885; this.match(HiveParser.KW_TABLE); this.state = 886; this.tableOrPartition(); this.state = 888; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_INPUTFORMAT) { { this.state = 887; this.inputFileFormat(); } } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) replicationClause() { let _localctx = new ReplicationClauseContext(this._ctx, this.state); this.enterRule(_localctx, 14, HiveParser.RULE_replicationClause); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 890; this.match(HiveParser.KW_FOR); this.state = 892; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_METADATA) { { this.state = 891; this.match(HiveParser.KW_METADATA); } } this.state = 894; this.match(HiveParser.KW_REPLICATION); this.state = 895; this.match(HiveParser.LPAREN); this.state = 896; this.match(HiveParser.StringLiteral); this.state = 897; this.match(HiveParser.RPAREN); } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) exportStatement() { let _localctx = new ExportStatementContext(this._ctx, this.state); this.enterRule(_localctx, 16, HiveParser.RULE_exportStatement); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 899; this.match(HiveParser.KW_EXPORT); this.state = 900; this.match(HiveParser.KW_TABLE); this.state = 901; this.tableOrPartition(); this.state = 902; this.match(HiveParser.KW_TO); this.state = 903; this.match(HiveParser.StringLiteral); this.state = 905; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_FOR) { { this.state = 904; this.replicationClause(); } } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) importStatement() { let _localctx = new ImportStatementContext(this._ctx, this.state); this.enterRule(_localctx, 18, HiveParser.RULE_importStatement); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 907; this.match(HiveParser.KW_IMPORT); this.state = 913; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_TABLE || _la === HiveParser.KW_EXTERNAL) { { this.state = 909; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_EXTERNAL) { { this.state = 908; this.match(HiveParser.KW_EXTERNAL); } } this.state = 911; this.match(HiveParser.KW_TABLE); this.state = 912; this.tableOrPartition(); } } this.state = 915; this.match(HiveParser.KW_FROM); { this.state = 916; _localctx._path = this.match(HiveParser.StringLiteral); } this.state = 918; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_LOCATION) { { this.state = 917; this.tableLocation(); } } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) replDumpStatement() { let _localctx = new ReplDumpStatementContext(this._ctx, this.state); this.enterRule(_localctx, 20, HiveParser.RULE_replDumpStatement); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 920; this.match(HiveParser.KW_REPL); this.state = 921; this.match(HiveParser.KW_DUMP); this.state = 922; this.identifier(); this.state = 925; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.DOT) { { this.state = 923; this.match(HiveParser.DOT); this.state = 924; this.identifier(); } } this.state = 937; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_FROM) { { this.state = 927; this.match(HiveParser.KW_FROM); this.state = 928; this.match(HiveParser.Number); this.state = 931; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_TO) { { this.state = 929; this.match(HiveParser.KW_TO); this.state = 930; this.match(HiveParser.Number); } } this.state = 935; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_LIMIT) { { this.state = 933; this.match(HiveParser.KW_LIMIT); this.state = 934; this.match(HiveParser.Number); } } } } this.state = 941; this._errHandler.sync(this); _la = this._input.LA(1); if (_la === HiveParser.KW_WITH) { { this.state = 939; this.match(HiveParser.KW_WITH); this.state = 940; this.replConfigs(); } } } } catch (re) { if (re instanceof RecognitionException_1.RecognitionException) { _localctx.exception = re; this._errHandler.reportError(this, re); this._errHandler.recover(this, re); } else { throw re; } } finally { this.exitRule(); } return _localctx; } // @RuleVersion(0) replLoadStatement() { let _localctx = new ReplLoadStatementContext(this._ctx, this.state); this.enterRule(_localctx, 22, HiveParser.RULE_replLoadStatement); let _la; try { this.enterOuterAlt(_localctx, 1); { this.state = 943; this.match(HiveParser.KW_REPL); this.state = 944; this.match(HiveParser.KW_LOAD); this.state = 950; this._errHandler.sync(this); _la = this._input.LA(1); if ((((_la) & ~0x1F) === 0 && ((1 << _la) & ((1 << HiveParser.KW_ASC) | (1 << HiveParser.KW_DESC) | (1 << HiveParser.KW_NULLS) | (1 << HiveParser.KW_LAST) | (1 << HiveParser.KW_OVERWRITE))) !== 0) || ((((_la - 36)) & ~0x1F) === 0 && ((1 << (_la - 36)) & ((1 << (HiveParser.KW_PARTITIONS - 36)) | (1 << (HiveParser.KW_TABLES - 36)) | (1 << (HiveParser.KW_COLUMNS - 36)) | (1 << (HiveParser.KW_INDEX - 36)) | (1 << (HiveParser.KW_INDEXES - 36)) | (1 << (HiveParser.KW_REBUILD - 36)) | (1 << (HiveParser.KW_FUNCTIONS - 36)) | (1 << (HiveParser.KW_SHOW - 36)) | (1 << (HiveParser.KW_MSCK - 36)) | (1 << (HiveParser.KW_REPAIR - 36)) | (1 << (HiveParser.KW_DIRECTORY - 36)) | (1 << (HiveParser.KW_CLUSTER - 36)) | (1 << (HiveParser.KW_DISTRIBUTE - 36)) | (1 << (HiveParser.KW_SORT - 36)) | (1 << (HiveParser.KW_LOAD - 36)) | (1 << (HiveParser.KW_EXPORT - 36)) | (1 << (HiveParser.KW_REPLICATION - 36)) | (1 << (HiveParser.KW_METADATA - 36)) | (1 << (HiveParser.KW_DATA - 36)) | (1 << (HiveParser.KW_INPATH - 36)))) !== 0) || ((((_la - 68)) & ~0x1F) === 0 && ((1 << (_la - 68)) & ((1 << (HiveParser.KW_CHANGE - 68)) | (1 << (HiveParser.KW_FIRST - 68)) | (1 << (HiveParser.KW_AFTER - 68)) | (1 << (HiveParser.KW_RENAME - 68)) | (1 << (HiveParser.KW_COMMENT - 68)) | (1 << (HiveParser.KW_TINYINT - 68)) | (1 << (HiveParser.KW_DATETIME - 68)) | (1 << (HiveParser.KW_ZONE - 68)) | (1 << (HiveParser.KW_STRING - 68)) | (1 << (HiveParser.KW_STRUCT - 68)) | (1 << (HiveParser.KW_UNIONTYPE - 68)))) !== 0) || ((((_la - 101)) & ~0x1F) === 0 && ((1 << (_la - 101)) & ((1 << (HiveParser.KW_PARTITIONED - 101)) | (1 << (HiveParser.KW_CLUSTERED - 101)) | (1 << (HiveParser.KW_SORTED - 101)) | (1 << (HiveParser.KW_BUCKETS - 101)) | (1 << (HiveParser.KW_FORMAT - 101)) | (1 << (HiveParser.KW_DELIMITED - 101)) | (1 << (HiveParser.KW_FIELDS - 101)) | (1 << (HiveParser.KW_TERMINATED - 101)) | (1 << (HiveParser.KW_ESCAPED - 101)) | (1 << (HiveParser.KW_COLLECTION - 101)) | (1 << (HiveParser.KW_ITEMS - 101)) | (1 << (HiveParser.KW_KEYS - 101)) | (1 << (HiveParser.KW_KEY_TYPE - 101)) | (1 << (HiveParser.KW_KILL - 101)) | (1 << (HiveParser.KW_LINES - 101)) | (1 << (HiveParser.KW_STORED - 101)) | (1 << (HiveParser.KW_FILEFORMAT - 101)) | (1 << (HiveParser.KW_INPUTFORMAT - 101)) | (1 << (HiveParser.KW_OUTPUTFORMAT - 101)) | (1 << (HiveParser.KW_INPUTDRIVER - 101)) | (1 << (HiveParser.KW_OUTPUTDRIVER - 101)) | (1 << (HiveParser.KW_ENABLE - 101)) | (1 << (HiveParser.KW_DISABLE - 101)) | (1 << (HiveParser.KW_LOCATION - 101)) | (1 << (HiveParser.KW_BUCKET - 101)))) !== 0) || ((((_la - 134)) & ~0x1F) === 0 && ((1 << (_la - 134)) & ((1 << (HiveParser.KW_ADD - 134)) | (1 << (HiveParser.KW_REPLACE - 134)) | (1 << (HiveParser.KW_TEMPORARY - 134)) | (1 << (HiveParser.KW_FILE - 134)) | (1 << (HiveParser.KW_JAR - 134)) | (1 << (HiveParser.KW_EXPLAIN - 134)) | (1 << (HiveParser.KW_FORMATTED - 134)) | (1 << (HiveParser.KW_DEPENDENCY - 134)) | (1 << (HiveParser.KW_LOGICAL - 134)) | (1 << (HiveParser.KW_SERDE - 134)) | (1 << (HiveParser.KW_DEFERRED - 134)) | (1 << (HiveParser.KW_SERDEPROPERTIES - 134)) | (1 << (HiveParser.KW_DBPROPERTIES - 134)) | (1 << (HiveParser.KW_LIMIT - 134)) | (1 << (HiveParser.KW_OFFSET - 134)) | (1 << (HiveParser.KW_UNSET - 134)) | (1 << (HiveParser.KW_TBLPROPERTIES - 134)) | (1 << (HiveParser.KW_IDXPROPERTIES - 134)) | (1 << (HiveParser.KW_VALUE_TYPE - 134)) | (1 << (HiveParser.KW_ELEM_TYPE - 134)) | (1 << (HiveParser.KW_DEFINED - 134)))) !== 0) || ((((_la - 167)) & ~0x1F) === 0 && ((1 << (_la - 167)) & ((1 << (HiveParser.KW_MAPJOIN - 167)) | (1 << (HiveParser.KW_STREAMTABLE - 167)) | (1 << (HiveParser.KW_CLUSTERSTATUS - 167)) | (1 << (HiveParser.KW_UTC - 167)) | (1 << (HiveParser.KW_UTCTIMESTAMP - 167)) | (1 << (HiveParser.KW_LONG - 167)) | (1 << (HiveParser.KW_PLUS - 167)) | (1 << (HiveParser.KW_VIEW - 167)) | (1 << (HiveParser.KW_VIEWS - 167)) | (1 << (HiveParser.KW_DATABASES - 167)) | (1 << (HiveParser.KW_MATERIALIZED - 167)) | (1 << (HiveParser.KW_SCHEMA - 167)) | (1 << (HiveParser.KW_SCHEMAS - 167)) | (1 << (HiveParser.KW_SSL - 167)) | (1 << (HiveParser.KW_UNDO - 167)) | (1 << (HiveParser.KW_LOCK - 167)) | (1 << (HiveParser.KW_LOCKS - 167)) | (1 << (HiveParser.KW_UNLOCK - 167)) | (1 << (HiveParser.KW_SHARED - 167)) | (1 << (HiveParser.KW_EXCLUSIVE - 167)) | (1 << (HiveParser.KW_UNSIGNED - 167)) | (1 << (HiveParser.KW_WHILE - 167)) | (1 << (HiveParser.KW_READ - 167)))) !== 0) || ((((_la - 200)) & ~0x1F) === 0 && ((1 << (_la - 200)) & ((1 << (HiveParser.KW_PURGE - 200)) | (1 << (HiveParser.KW_ANALYZE - 200)) | (1 << (HiveParser.KW_BEFORE - 200))