lava-oushudb-dt-sql-parser/lib/core/parse/hive/hiveAutocompleteParser.js

5706 lines
1.7 MiB
JavaScript
Raw Normal View History

2019-12-31 18:47:24 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Cloudera, Inc. licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* parser generated by jison 0.4.18 */
/*
Returns a Parser object of the following structure:
Parser: {
yy: {}
}
Parser.prototype: {
yy: {},
trace: function(),
symbols_: {associative list: name ==> number},
terminals_: {associative list: number ==> name},
productions_: [...],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
table: [...],
defaultActions: {...},
parseError: function(str, hash),
parse: function(input),
lexer: {
EOF: 1,
parseError: function(str, hash),
setInput: function(input),
input: function(),
unput: function(str),
more: function(),
less: function(n),
pastInput: function(),
upcomingInput: function(),
showPosition: function(),
test_match: function(regex_match_array, rule_index),
next: function(),
lex: function(),
begin: function(condition),
popState: function(),
_currentRules: function(),
topState: function(),
pushState: function(condition),
options: {
ranges: boolean (optional: true ==> token location info will include a .range[] member)
flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
},
performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
rules: [...],
conditions: {associative list: name ==> set},
}
}
token location info (@$, _$, etc.): {
first_line: n,
last_line: n,
first_column: n,
last_column: n,
range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
}
the parseError function receives a 'hash' object with these members for lexer and parser errors: {
text: (matched text)
token: (the produced terminal token, if any)
line: (yylineno)
}
while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
loc: (yylloc)
expected: (string describing the set of expected tokens)
recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
}
*/
const sqlParseSupport_1 = require("./sqlParseSupport");
var hiveAutocompleteParser = (function () {
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v)
2020-03-26 13:06:16 +08:00
; return o; }, $V0 = [2, 26, 27, 44, 47, 50, 54, 55, 58, 62, 71, 78, 79, 85, 88, 89, 107, 108, 116, 118, 123, 126, 129, 130, 132, 150, 151, 152, 153, 154, 158, 161, 166, 198, 202, 205, 206, 208, 216, 217, 218, 219, 227, 228, 229, 230, 231, 233, 235, 238, 239, 240, 266, 277, 279, 280, 307, 317, 318, 333, 347, 348, 349, 351, 352, 359, 371, 372, 373, 374, 376, 381, 382, 384, 385, 386, 396, 397, 409, 410, 417, 418, 419, 420, 421, 422, 423, 424, 425, 428, 439, 440, 442, 443, 444, 445, 446, 447, 460, 464, 468, 469, 473, 486, 487, 488, 491, 532, 533, 534, 535, 538, 539, 544, 547, 561, 563, 568, 569, 570, 571, 572, 573, 574, 575, 596, 610, 615, 616, 617, 618, 619, 620, 621, 622, 623, 626, 637, 639, 640, 656, 663, 665, 667, 673, 674, 676, 681, 686, 687, 688, 690, 694, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 850], $V1 = [2, 1295], $V2 = [544, 690], $V3 = [2, 915], $V4 = [1, 5], $V5 = [1, 200], $V6 = [1, 281], $V7 = [1, 368], $V8 = [1, 69], $V9 = [1, 164], $Va = [1, 112], $Vb = [1, 154], $Vc = [1, 179], $Vd = [1, 240], $Ve = [1, 55], $Vf = [1, 204], $Vg = [1, 39], $Vh = [1, 168], $Vi = [1, 148], $Vj = [1, 211], $Vk = [1, 210], $Vl = [1, 27], $Vm = [1, 10], $Vn = [1, 11], $Vo = [1, 13], $Vp = [1, 17], $Vq = [1, 218], $Vr = [1, 198], $Vs = [1, 199], $Vt = [1, 24], $Vu = [1, 242], $Vv = [1, 283], $Vw = [1, 163], $Vx = [1, 49], $Vy = [1, 215], $Vz = [1, 166], $VA = [1, 385], $VB = [1, 406], $VC = [1, 184], $VD = [1, 407], $VE = [1, 100], $VF = [1, 151], $VG = [1, 259], $VH = [1, 311], $VI = [1, 53], $VJ = [1, 207], $VK = [1, 94], $VL = [1, 40], $VM = [1, 141], $VN = [1, 147], $VO = [1, 260], $VP = [1, 97], $VQ = [1, 29], $VR = [1, 74], $VS = [1, 87], $VT = [1, 136], $VU = [1, 376], $VV = [1, 50], $VW = [1, 203], $VX = [1, 82], $VY = [1, 130], $VZ = [1, 173], $V_ = [1, 125], $V$ = [1, 149], $V01 = [1, 26], $V11 = [1, 16], $V21 = [1, 18], $V31 = [1, 138], $V41 = [1, 213], $V51 = [1, 229], $V61 = [1, 95], $V71 = [1, 180], $V81 = [1, 183], $V91 = [1, 146], $Va1 = [1, 167], $Vb1 = [1, 52], $Vc1 = [1, 45], $Vd1 = [1, 119], $Ve1 = [1, 230], $Vf1 = [1, 38], $Vg1 = [1, 79], $Vh1 = [1, 206], $Vi1 = [1, 191], $Vj1 = [1, 96], $Vk1 = [1, 31], $Vl1 = [1, 116], $Vm1 = [1, 161], $Vn1 = [1, 124], $Vo1 = [1, 157], $Vp1 = [1, 165], $Vq1 = [1, 178], $Vr1 = [1, 197], $Vs1 = [1, 221], $Vt1 = [1, 73], $Vu1 = [1, 90], $Vv1 = [1, 220], $Vw1 = [1, 85], $Vx1 = [1, 48], $Vy1 = [1, 121], $Vz1 = [1, 126], $VA1 = [1, 132], $VB1 = [1, 72], $VC1 = [1, 219], $VD1 = [1, 233], $VE1 = [1, 91], $VF1 = [1, 122], $VG1 = [1, 188], $VH1 = [1, 71], $VI1 = [1, 109], $VJ1 = [1, 111], $VK1 = [1, 137], $VL1 = [1, 175], $VM1 = [1, 409], $VN1 = [1, 352], $VO1 = [1, 98], $VP1 = [1, 329], $VQ1 = [1, 226], $VR1 = [1, 360], $VS1 = [1, 22], $VT1 = [1, 128], $VU1 = [1, 99], $VV1 = [1, 129], $VW1 = [1, 186], $VX1 = [1, 60], $VY1 = [1, 123], $VZ1 = [1, 160], $V_1 = [1, 114], $V$1 = [1, 196], $V02 = [1, 102], $V12 = [1, 64], $V22 = [1, 410], $V32 = [1, 135], $V42 = [1, 202], $V52 = [1, 359], $V62 = [1, 232], $V72 = [1, 103], $V82 = [1, 155], $V92 = [1, 21], $Va2 = [1, 330], $Vb2 = [1, 174], $Vc2 = [1, 234], $Vd2 = [1, 133], $Ve2 = [1, 76], $Vf2 = [1, 411], $Vg2 = [1, 244], $Vh2 = [1, 139], $Vi2 = [1, 222], $Vj2 = [1, 356], $Vk2 = [1, 63], $Vl2 = [1, 115], $Vm2 = [1, 357], $Vn2 = [1, 88], $Vo2 = [1, 358], $Vp2 = [1, 185], $Vq2 = [1, 37], $Vr2 = [1, 51], $Vs2 = [1, 65], $Vt2 = [1, 67], $Vu2 = [1, 68], $Vv2 = [1, 81], $Vw2 = [1, 101], $Vx2 = [1, 108], $Vy2 = [1, 127], $Vz2 = [1, 134], $VA2 = [1, 143], $VB2 = [1, 144], $VC2 = [1, 169], $VD2 = [1, 176], $VE2 = [1, 189]
2019-12-31 18:47:24 +08:00
var parser = { trace: function trace() { },
yy: {},
2020-03-26 11:47:47 +08:00
symbols_: { "error": 2, "DataDefinition": 3, "AlterStatement": 4, "AnalyzeStatement": 5, "CreateStatement": 6, "DropStatement": 7, "AbortStatement": 8, "GrantStatement": 9, "RevokeStatement": 10, "DescribeStatement": 11, "SetRoleStatement": 12, "SetSpecification": 13, "ShowStatement": 14, "UseStatement": 15, "DataDefinition_EDIT": 16, "AlterStatement_EDIT": 17, "AnalyzeStatement_EDIT": 18, "CreateStatement_EDIT": 19, "DropStatement_EDIT": 20, "AbortStatement_EDIT": 21, "GrantStatement_EDIT": 22, "RevokeStatement_EDIT": 23, "DescribeStatement_EDIT": 24, "SetRoleStatement_EDIT": 25, "SET": 26, "CURSOR": 27, "ShowStatement_EDIT": 28, "UseStatement_EDIT": 29, "AlterDatabase": 30, "AlterIndex": 31, "AlterMaterializedView": 32, "AlterTable": 33, "AlterView": 34, "Msck": 35, "ReloadFunction": 36, "AlterDatabase_EDIT": 37, "AlterIndex_EDIT": 38, "AlterMaterializedView_EDIT": 39, "AlterTable_EDIT": 40, "AlterView_EDIT": 41, "Msck_EDIT": 42, "ReloadFunction_EDIT": 43, "ALTER": 44, "DatabaseOrSchema": 45, "RegularOrBacktickedIdentifier": 46, "DBPROPERTIES": 47, "ParenthesizedPropertyAssignmentList": 48, "HdfsLocation": 49, "OWNER": 50, "PrincipalSpecification": 51, "HdfsLocation_EDIT": 52, "PrincipalSpecification_EDIT": 53, "INDEX": 54, "ON": 55, "SchemaQualifiedTableIdentifier": 56, "OptionalPartitionSpec": 57, "REBUILD": 58, "SchemaQualifiedTableIdentifier_EDIT": 59, "OptionalPartitionSpec_EDIT": 60, "MATERIALIZED": 61, "VIEW": 62, "EnableOrDisable": 63, "REWRITE": 64, "AlterTableLeftSide": 65, "ADD": 66, "OptionalIfNotExists": 67, "PartitionSpec": 68, "OptionalHdfsLocation": 69, "OptionalPartitionSpecs": 70, "CONSTRAINT": 71, "PrimaryKeySpecification": 72, "TableConstraint": 73, "RENAME": 74, "TO": 75, "RegularOrBackTickedSchemaQualifiedName": 76, "ClusteredBy": 77, "SKEWED": 78, "BY": 79, "ParenthesizedColumnList": 80, "ParenthesizedSkewedValueList": 81, "OptionalStoredAsDirectories": 82, "ExchangeSpecification": 83, "RECOVER": 84, "PARTITIONS": 85, "TOUCH": 86, "ArchiveOrUnArchive": 87, "NOT": 88, "STORED_AS_DIRECTORIES": 89, "SKEWED_LOCATION": 90, "ParenthesizedSkewedLocationList": 91, "CHANGE": 92, "COLUMN": 93, "ParenthesizedColumnSpecificationList": 94, "OptionalCascadeOrRestrict": 95, "DropOperations": 96, "OptionalPartitionOperations": 97, "AlterTableLeftSide_EDIT": 98, "REPLACE": 99, "OptionalIfNotExists_EDIT": 100, "OptionalPartitionSpecs_EDIT": 101, "PartitionSpec_EDIT": 102, "PrimaryKeySpecification_EDIT": 103, "ForeignKeySpecification_EDIT": 104, "ClusteredBy_EDIT": 105, "ExchangeSpecification_EDIT": 106, "STORED": 107, "AS": 108, "ParenthesizedSkewedLocationList_EDIT": 109, "ParenthesizedColumnList_EDIT": 110, "OptionalStoredAsDirectories_EDIT": 111, "OptionalPartitionOperations_EDIT": 112, "DropOperations_EDIT": 113, "AddOrReplace": 114, "ParenthesizedStatsList": 115, "(": 116, "StatsList": 117, ")": 118, "ParenthesizedStatsList_EDIT": 119, "StatsList_EDIT": 120, "RightParenthesisOrError": 121, "StatsAssignment": 122, ",": 123, "StatsAssignment_EDIT": 124, "QuotedValue": 125, "=": 126, "FILEFORMAT": 127, "FileFormat": 128, "TBLPROPERTIES": 129, "SERDE": 130, "OptionalWithSerdeproperties": 131, "SERDEPROPERTIES": 132, "AddReplaceColumns": 133, "CONCATENATE": 134, "COMPACT": 135, "OptionalAndWait": 136, "OptionalWithOverwriteTblProperties": 137, "NoDropOrOffline": 138, "OptionalColumn": 139, "ColumnIdentifier": 140, "ColumnSpecification": 141, "OptionalAfterOrFirst": 142, "AddReplaceColumns_EDIT": 143, "ColumnSpecification_EDIT": 144, "OptionalAfterOrFirst_EDIT": 145, "AndWait_EDIT": 146, "WithOverwriteTblProperties_EDIT": 147, "NoDropOrOffline_EDIT": 148, "WithSerdeproperties_EDIT": 149, "AND": 150, "WAIT": 151, "WITH": 152, "OVERWRITE": 153, "COLUMNS": 154, "ParenthesizedColumnSpecificationList_EDIT": 155, "EXCHANGE": 156, "ExchangePartitionSpec": 157, "TABLE": 158, "RegularOrBackTickedSchemaQualifiedName_EDIT": 159, "ExchangePartitionSpec_EDIT": 160, "PARTITION": 161, "OneOrMorePartitionSpecLists": 162, "PartitionSpecList": 163, "OneOrMorePartitionSpecLists_EDIT": 164, "PartitionSpecList_EDIT": 165, "DRO
terminals_: { 2: "error", 26: "SET", 27: "CURSOR", 44: "ALTER", 47: "DBPROPERTIES", 50: "OWNER", 54: "INDEX", 55: "ON", 58: "REBUILD", 61: "MATERIALIZED", 62: "VIEW", 64: "REWRITE", 66: "ADD", 71: "CONSTRAINT", 74: "RENAME", 75: "TO", 78: "SKEWED", 79: "BY", 84: "RECOVER", 85: "PARTITIONS", 86: "TOUCH", 88: "NOT", 89: "STORED_AS_DIRECTORIES", 90: "SKEWED_LOCATION", 92: "CHANGE", 93: "COLUMN", 99: "REPLACE", 107: "STORED", 108: "AS", 116: "(", 118: ")", 123: ",", 126: "=", 127: "FILEFORMAT", 129: "TBLPROPERTIES", 130: "SERDE", 132: "SERDEPROPERTIES", 134: "CONCATENATE", 135: "COMPACT", 150: "AND", 151: "WAIT", 152: "WITH", 153: "OVERWRITE", 154: "COLUMNS", 156: "EXCHANGE", 158: "TABLE", 161: "PARTITION", 166: "DROP", 174: "AFTER", 175: "FIRST", 176: "ENABLE", 177: "DISABLE", 178: "NO_DROP", 180: "OFFLINE", 181: "ARCHIVE", 182: "UNARCHIVE", 193: "ColumnReferences", 198: "MSCK", 202: "REPAIR", 204: "SYNC", 205: "RELOAD", 206: "FUNCTION", 208: "NULL", 216: "SetSpecification_EDIT", 217: "ANALYZE", 218: "COMPUTE", 219: "STATISTICS", 227: "FOR", 228: "CACHE", 229: "METADATA", 230: "NOSCAN", 231: "EXPLAIN", 233: "FORMATTED", 234: "AST", 235: "AUTHORIZATION", 236: "CBO", 238: "DEPENDENCY", 239: "EXTENDED", 240: "LOCKS", 241: "VECTORIZATION", 244: "COST", 245: "JOINCOST", 246: "ONLY", 247: "DETAIL", 248: "EXPRESSION", 249: "OPERATOR", 250: "SUMMARY", 266: "CREATE", 277: "COMMENT", 279: "SINGLE_QUOTE", 280: "DOUBLE_QUOTE", 281: "VALUE", 307: "LIKE", 317: "PRIMARY", 318: "KEY", 320: "UNIQUE", 321: "DEFAULT", 323: "CHECK", 328: "LITERAL", 329: "CURRENT_USER", 330: "CURRENT_DATE", 331: "CURRENT_TIMESTAMP", 333: "NOVALIDATE", 347: "ARRAY", 348: "<", 349: ">", 351: "MAP", 352: "STRUCT", 358: ":", 359: "UNIONTYPE", 371: "FOREIGN", 372: "REFERENCES", 373: "RELY", 374: "NORELY", 376: "PARTITIONED", 381: "COMPARISON_OPERATOR", 382: "CLUSTERED", 384: "INTO", 385: "UNSIGNED_INTEGER", 386: "BUCKETS", 396: "DISTRIBUTED", 397: "SORTED", 409: "ROW", 410: "FORMAT", 417: "AVRO", 418: "INPUTFORMAT", 419: "OUTPUTFORMAT", 420: "JSONFILE", 421: "ORC", 422: "PARQUET", 423: "RCFILE", 424: "SEQUENCEFILE", 425: "TEXTFILE", 428: "DELIMITED", 439: "FIELDS", 440: "TERMINATED", 442: "ESCAPED", 443: "COLLECTION", 444: "ITEMS", 445: "KEYS", 446: "LINES", 447: "DEFINED", 460: "TEMPORARY", 464: "USING", 468: "FILE", 469: "JAR", 473: "ROLE", 486: "DEFERRED", 487: "IDXPROPERTIES", 488: "IN", 491: "MACRO", 499: "LIFECYCLE", 532: "PURGE", 533: "TRUNCATE", 534: "DELETE", 535: "FROM", 538: "ABORT", 539: "TRANSACTIONS", 544: ";", 547: "SELECT", 552: "TableExpression_ERROR", 558: "Errors", 561: "ALL", 563: "LATERAL", 568: "FULL", 569: "LEFT", 570: "RIGHT", 571: "CROSS", 572: "JOIN", 573: "OUTER", 574: "INNER", 575: "SEMI", 596: "GRANT", 610: "DATABASE", 615: "INSERT", 616: "LOCK", 617: "SHOW_DATABASE", 618: "UPDATE", 619: "USER", 620: "GROUP", 621: "OPTION", 622: "ADMIN", 623: "REVOKE", 626: "PRIVILEGES", 637: "VALUES", 639: "LOCAL", 640: "DIRECTORY", 643: "OVERWRITE_DIRECTORY", 646: "OptionalStoredAs_EDIT", 656: "MERGE", 663: "WHEN", 665: "MATCHED", 667: "THEN", 673: "LOAD", 674: "DATA", 676: "INPATH", 681: "IMPORT", 686: "EXTERNAL", 687: "EXPORT", 688: "REPLICATION", 690: "EOF", 694: "BUCKET", 695: "CASCADE", 696: "COMPACTIONS", 697: "DATABASES", 698: "DAY", 699: "DAYOFWEEK", 700: "DOUBLE_PRECISION", 701: "FUNCTIONS", 702: "HOUR", 703: "LAST", 704: "LOCATION", 705: "MINUTE", 706: "MONTH", 707: "PERCENT", 708: "QUARTER", 709: "RESTRICT", 710: "ROLES", 711: "SCHEMAS", 712: "SECOND", 713: "SETS", 714: "SHOW", 715: "STRING", 716: "TABLES", 717: "TINYINT", 718: "TRANSACTIONAL", 719: "USE", 720: "WEEK", 721: "YEAR", 722: "REGULAR_IDENTIFIER", 723: "VARIABLE_REFERENCE", 724: "!", 725: "*", 726: "-", 727: ".", 728: "[", 729: "]", 730: "ANALYTIC", 731: "ARITHMETIC_OPERATOR", 732: "ASC", 733: "AVG", 734: "BACKTICK", 735: "BETWEEN", 736: "BIGINT", 737: "BINARY", 738: "BOOLEAN", 739: "CASE", 740: "CAST", 741: "CHAR", 742: "CLUSTER", 743: "COLLECT_LIST", 744: "COLLECT_SET", 745: "CONF", 746: "CORR", 747: "COUNT", 748: "COVAR_POP", 749: "COVAR_SAMP", 750: "CUBE", 751: "CURRE
productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 2], [16, 1], [16, 1], [4, 1], [4, 1], [4, 1], [4, 1], [4, 1], [4, 1], [4, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 2], [30, 6], [30, 5], [30, 6], [37, 3], [37, 4], [37, 5], [37, 5], [37, 6], [37, 6], [31, 7], [38, 4], [38, 5], [38, 5], [38, 6], [38, 7], [32, 6], [39, 3], [39, 4], [39, 4], [39, 5], [39, 6], [33, 6], [33, 5], [33, 3], [33, 4], [33, 2], [33, 7], [33, 2], [33, 3], [33, 3], [33, 3], [33, 3], [33, 3], [33, 4], [33, 4], [33, 5], [33, 6], [33, 2], [33, 2], [33, 3], [40, 1], [40, 6], [40, 2], [40, 4], [40, 2], [40, 7], [40, 2], [40, 3], [40, 3], [40, 3], [40, 3], [40, 3], [40, 4], [40, 4], [40, 5], [40, 6], [40, 2], [40, 2], [40, 3], [40, 4], [40, 3], [40, 3], [40, 6], [40, 6], [40, 7], [40, 6], [40, 4], [40, 5], [40, 5], [40, 5], [40, 3], [40, 3], [40, 2], [40, 2], [40, 3], [40, 4], [40, 5], [40, 4], [40, 5], [40, 3], [40, 4], [40, 4], [40, 3], [40, 4], [40, 4], [40, 4], [40, 7], [40, 5], [40, 8], [40, 7], [40, 3], [40, 3], [40, 2], [40, 2], [40, 2], [40, 3], [40, 4], [40, 4], [40, 3], [40, 3], [40, 3], [40, 4], [115, 3], [119, 3], [117, 1], [117, 3], [120, 1], [120, 3], [120, 5], [120, 3], [122, 3], [124, 1], [97, 3], [97, 2], [97, 3], [97, 4], [97, 3], [97, 1], [97, 1], [97, 4], [97, 2], [97, 6], [112, 1], [112, 3], [112, 6], [112, 7], [112, 6], [112, 5], [112, 4], [112, 4], [112, 2], [112, 2], [112, 3], [112, 2], [112, 5], [112, 4], [136, 0], [136, 2], [146, 2], [137, 0], [137, 4], [147, 2], [147, 3], [133, 4], [143, 4], [143, 5], [83, 5], [106, 2], [106, 3], [106, 4], [106, 5], [106, 5], [106, 2], [106, 5], [157, 4], [157, 4], [160, 4], [160, 4], [162, 3], [162, 5], [164, 3], [164, 5], [96, 4], [96, 3], [113, 3], [113, 4], [113, 5], [113, 3], [113, 2], [113, 2], [65, 3], [98, 3], [98, 3], [114, 1], [114, 1], [142, 0], [142, 2], [173, 1], [173, 1], [145, 2], [145, 2], [139, 0], [139, 1], [63, 1], [63, 1], [138, 2], [138, 1], [148, 3], [87, 1], [87, 1], [168, 1], [168, 3], [170, 1], [170, 3], [170, 5], [170, 3], [170, 3], [170, 3], [170, 5], [70, 0], [70, 1], [184, 1], [184, 2], [101, 1], [101, 2], [101, 2], [101, 3], [186, 2], [186, 2], [185, 2], [91, 3], [109, 3], [187, 1], [187, 3], [188, 1], [188, 3], [188, 5], [188, 3], [189, 3], [190, 1], [190, 1], [190, 3], [190, 3], [190, 3], [82, 0], [82, 1], [111, 2], [111, 3], [34, 4], [34, 3], [41, 1], [41, 2], [41, 3], [41, 3], [41, 3], [194, 3], [196, 3], [196, 3], [35, 5], [42, 3], [42, 4], [42, 4], [42, 5], [42, 6], [199, 0], [199, 1], [200, 0], [200, 2], [201, 2], [203, 1], [203, 1], [203, 1], [36, 2], [43, 2], [207, 1], [207, 1], [209, 2], [209, 2], [209, 2], [209, 1], [209, 1], [209, 1], [212, 1], [212, 2], [212, 2], [212, 2], [212, 2], [212, 2], [212, 2], [212, 2], [212, 1], [212, 2], [212, 1], [212, 1], [212, 1], [212, 1], [5, 9], [18, 2], [18, 3], [18, 4], [18, 4], [18, 5], [18, 6], [18, 10], [18, 10], [18, 10], [18, 4], [18, 9], [18, 9], [18, 9], [18, 9], [18, 9], [220, 0], [220, 1], [223, 2], [225, 2], [221, 0], [221, 1], [224, 2], [226, 2], [222, 0], [222, 1], [210, 2], [213, 3], [213, 3], [232, 0], [232, 1], [232, 1], [232, 3], [232, 2], [232, 1], [232, 1], [232, 1], [232, 3], [237, 0], [237, 1], [237, 1], [242, 0], [242, 1], [243, 0], [243, 1], [243, 1], [243, 1], [243, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [19, 1], [19, 1], [19, 1], [19, 1], [19, 1], [19, 1], [19, 1], [19, 5], [251, 5], [259, 4], [259, 3], [259, 5], [259, 4], [259, 6], [259, 6], [271, 3], [272, 3], [272, 3], [273, 0], [273, 1], [276, 2], [275, 1], [278, 2], [278, 2], [278, 3], [278, 3], [274, 0], [274, 1], [282, 3], [282, 2], [282, 2], [48, 3], [283, 1], [283, 3], [284, 3], [252, 8], [260, 7], [260, 7], [260, 6], [286, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [288, 11], [289, 2], [297, 2], [297, 2], [304, 0], [304, 1], [304, 2], [305, 1], [305, 2], [305, 2
2019-12-31 18:47:24 +08:00
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
/* this == yyval */
var $0 = $$.length - 1;
switch (yystate) {
case 22:
parser.suggestSetOptions();
parser.suggestKeywords(['ROLE']);
break;
case 39:
parser.suggestKeywords(['DATABASE', 'INDEX', 'MATERIALIZED VIEW', 'SCHEMA', 'TABLE', 'VIEW']);
break;
case 40:
case 42:
parser.addDatabaseLocation(_$[$0 - 3], [{ name: $$[$0 - 3] }]);
break;
case 41:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
break;
case 43:
case 1039:
case 1800:
case 2594:
case 2636:
case 2655:
case 2698:
case 2699:
case 2735:
parser.suggestDatabases();
break;
case 44:
parser.addDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
parser.suggestKeywords(['SET DBPROPERTIES', 'SET LOCATION', 'SET OWNER']);
break;
case 45:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
parser.suggestKeywords(['DBPROPERTIES', 'LOCATION', 'OWNER']);
break;
case 46:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
break;
case 47:
parser.addDatabaseLocation(_$[$0 - 3], [{ name: $$[$0 - 3] }]);
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
break;
case 48:
parser.addDatabaseLocation(_$[$0 - 3], [{ name: $$[$0 - 3] }]);
break;
case 49:
case 55:
case 1234:
case 1243:
case 1244:
case 1245:
case 1884:
case 2646:
parser.addTablePrimary($$[$0 - 2]);
break;
case 50:
case 127:
case 578:
case 600:
case 603:
case 606:
case 629:
case 879:
case 1190:
case 2614:
case 2631:
case 2633:
parser.suggestKeywords(['ON']);
break;
case 51:
case 190:
case 429:
case 558:
case 760:
case 787:
case 880:
case 898:
case 905:
case 1040:
case 1240:
case 1269:
case 1272:
case 1278:
case 1791:
case 2712:
case 2732:
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 53:
case 278:
case 282:
case 320:
case 554:
case 560:
case 868:
case 896:
case 901:
case 902:
case 903:
case 908:
case 1271:
case 1281:
case 1880:
case 2644:
case 2645:
case 2657:
parser.addTablePrimary($$[$0 - 1]);
break;
case 54:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PARTITION', 'REBUILD']);
}
else {
parser.suggestKeywords(['REBUILD']);
}
break;
case 56:
case 705:
case 887:
case 2529:
parser.suggestKeywords(['VIEW']);
break;
case 57:
case 277:
case 888:
parser.suggestTables({ onlyViews: true });
parser.suggestDatabases({ appendDot: true });
break;
case 58:
case 276:
case 281:
case 889:
case 895:
if (parser.yy.result.suggestTables) {
parser.yy.result.suggestTables.onlyViews = true;
}
break;
case 59:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['DISABLE REWRITE', 'ENABLE REWRITE']);
break;
case 60:
parser.addTablePrimary($$[$0 - 2]);
parser.suggestKeywords(['REWRITE']);
break;
case 99:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'IF NOT EXISTS', weight: 3 }, { value: 'COLUMNS', weight: 2 }, { value: 'CONSTRAINT', weight: 1 }, { value: 'PARTITION', weight: 1 }]);
}
else {
parser.suggestKeywords(['PARTITION']);
}
break;
case 100:
case 136:
case 335:
parser.suggestKeywords(['COLUMNS']);
break;
case 104:
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['LOCATION', 'PARTITION']);
}
else if ($$[$0 - 1] && $$[$0 - 1].suggestKeywords) {
var keywords = parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2);
keywords.push({ value: 'PARTITION', weight: 1 });
parser.suggestKeywords(keywords);
}
else {
parser.suggestKeywords(['PARTITION']);
}
break;
case 107:
parser.suggestKeywords(['CHECK', 'FOREIGN KEY', 'PRIMARY KEY', 'UNIQUE']);
break;
case 110:
case 118:
case 130:
case 187:
case 233:
case 234:
case 235:
case 2681:
parser.suggestKeywords(['PARTITION']);
break;
case 114:
parser.suggestKeywords(['SKEWED', 'STORED AS DIRECTORIES']);
break;
case 115:
case 266:
parser.suggestKeywords(['AS DIRECTORIES']);
break;
case 116:
case 267:
parser.suggestKeywords(['DIRECTORIES']);
break;
case 117:
parser.suggestKeywords(['TO PARTITION']);
break;
case 119:
case 288:
parser.suggestKeywords(['PARTITIONS']);
break;
case 120:
parser.suggestKeywords(['LOCATION']);
break;
case 122:
case 569:
case 570:
case 573:
case 585:
case 610:
case 628:
case 670:
case 671:
case 676:
case 681:
case 685:
case 2408:
parser.suggestKeywords(['BY']);
break;
case 123:
case 1019:
case 1024:
case 1028:
case 1067:
case 1068:
case 1069:
case 1097:
case 1105:
case 1108:
case 1111:
case 1116:
case 1119:
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
break;
case 128:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['STORED AS DIRECTORIES']);
}
break;
case 134:
parser.suggestKeywords(['ADD COLUMNS', 'ADD IF NOT EXISTS', 'ADD PARTITION', 'ARCHIVE PARTITION', 'CHANGE',
'CLUSTERED BY', 'CONCATENATE', 'COMPACT', 'DISABLE NO_DROP', 'DISABLE OFFLINE', 'DROP', 'ENABLE NO_DROP',
'ENABLE OFFLINE', 'EXCHANGE PARTITION', 'NOT SKEWED', 'NOT STORED AS DIRECTORIES', 'PARTITION',
'RECOVER PARTITIONS', 'RENAME TO', 'REPLACE COLUMNS', 'SET FILEFORMAT', 'SET LOCATION', 'SET OWNER', 'SET SERDE',
'SET SERDEPROPERTIES', 'SET SKEWED LOCATION', 'SET TBLPROPERTIES', 'SKEWED BY', 'TOUCH', 'UNARCHIVE PARTITION']);
break;
case 135:
parser.suggestKeywords(['ADD COLUMNS', 'CHANGE', 'COMPACT', 'CONCATENATE', 'DISABLE NO_DROP', 'DISABLE OFFLINE',
'ENABLE NO_DROP', 'ENABLE OFFLINE', 'RENAME TO PARTITION', 'REPLACE COLUMNS', 'SET FILEFORMAT', 'SET LOCATION',
'SET SERDE', 'SET SERDEPROPERTIES']);
break;
case 137:
parser.suggestKeywords(['FILEFORMAT', 'LOCATION', 'SERDE', 'SERDEPROPERTIES']);
break;
case 138:
parser.suggestKeywords(['FILEFORMAT', 'LOCATION', 'OWNER', 'SERDE', 'SERDEPROPERTIES', 'SKEWED LOCATION', 'TBLPROPERTIES']);
break;
case 140:
case 1023:
parser.suggestKeywords(['TO']);
break;
case 141:
case 1796:
parser.suggestDatabases({ appendDot: true });
break;
case 151:
parser.suggestIdentifiers(['\'avgSize\'', '\'maxSize\'', '\'numDVs\'', '\'numNulls\'']);
break;
case 161:
case 164:
case 166:
parser.addColumnLocation($$[$0 - 3].location, [$$[$0 - 3].identifier]);
break;
case 163:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['COLUMN']);
}
parser.suggestColumns();
break;
case 165:
if (!$$[$0 - 2] && !$$[$0 - 1]) {
if ($$[$0 - 3].suggestKeywords) {
var keywords = parser.createWeightedKeywords($$[$0 - 3].suggestKeywords, 3);
keywords = keywords.concat([{ value: 'AFTER', weight: 2 }, { value: 'FIRST', weight: 2 }, { value: 'CASCADE', weight: 1 }, { value: 'RESTRICT', weight: 1 }]);
parser.suggestKeywords(keywords);
}
else {
parser.suggestKeywords([{ value: 'AFTER', weight: 2 }, { value: 'FIRST', weight: 2 }, { value: 'CASCADE', weight: 1 }, { value: 'RESTRICT', weight: 1 }]);
}
}
else if ($$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
}
parser.addColumnLocation($$[$0 - 4].location, [$$[$0 - 4].identifier]);
break;
case 167:
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['AND WAIT', 'WITH OVERWRITE TBLPROPERTIES']);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH OVERWRITE TBLPROPERTIES']);
}
break;
case 170:
parser.suggestKeywords(['NO_DROP', 'OFFLINE']);
break;
case 172:
case 648:
parser.suggestFileFormats();
break;
case 174:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH SERDEPROPERTIES']);
}
break;
case 178:
parser.suggestKeywords(['WAIT']);
break;
case 181:
parser.suggestKeywords(['OVERWRITE TBLPROPERTIES']);
break;
case 182:
case 272:
parser.suggestKeywords(['TBLPROPERTIES']);
break;
case 185:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
}
break;
case 188:
parser.suggestKeywords(['WITH TABLE']);
break;
case 189:
case 317:
case 759:
case 786:
case 897:
case 1268:
case 1277:
case 2598:
case 2619:
parser.suggestKeywords(['TABLE']);
break;
case 204:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'CONSTRAINT', weight: 1 }, { value: 'PARTITION', weight: 1 }, { value: 'IF EXISTS', weight: 2 }]);
}
else {
parser.suggestKeywords(['PARTITION']);
}
break;
case 206:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PURGE']);
}
break;
case 210:
case 275:
case 774:
case 876:
case 886:
case 890:
case 894:
case 1037:
case 1038:
case 1207:
case 1274:
case 2597:
case 2643:
case 2656:
case 2686:
case 2715:
parser.addTablePrimary($$[$0]);
break;
case 211:
case 319:
case 871:
if (parser.yy.result.suggestTables) {
parser.yy.result.suggestTables.onlyTables = true;
}
break;
case 212:
case 280:
case 318:
parser.suggestTables({ onlyTables: true });
parser.suggestDatabases({ appendDot: true });
break;
case 219:
case 259:
case 261:
case 623:
case 790:
case 1777:
case 1781:
case 1785:
case 1811:
case 1812:
case 1845:
case 1848:
case 1977:
case 2045:
case 2726:
parser.suggestColumns();
break;
case 227:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['CASCADE']);
}
break;
case 242:
case 453:
case 455:
case 456:
case 458:
case 459:
case 937:
case 938:
case 939:
case 1226:
case 1920:
case 1949:
case 1980:
case 1993:
case 1997:
case 2034:
case 2038:
case 2058:
case 2083:
case 2084:
case 2165:
case 2167:
case 2231:
case 2241:
case 2248:
case 2260:
case 2407:
case 2731:
case 2769:
case 2770:
this.$ = $$[$0];
break;
case 249:
if (!$$[$0]) {
this.$ = { suggestKeywords: ['LOCATION'] };
}
break;
case 271:
parser.suggestKeywords(['AS', 'SET TBLPROPERTIES']);
break;
case 273:
case 701:
case 724:
case 1208:
case 1930:
case 2327:
parser.suggestKeywords(['SELECT']);
break;
case 279:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['TABLE', 'REPAIR TABLE']);
}
else {
parser.suggestKeywords(['TABLE']);
}
break;
case 283:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['ADD PARTITIONS', 'DROP PARTITIONS', 'SYNC PARTITIONS']);
}
break;
case 293:
parser.suggestKeywords(['FUNCTION']);
break;
case 309:
case 310:
parser.suggestDdlAndDmlKeywords(['EXPLAIN', 'FROM']);
break;
case 311:
parser.suggestKeywords(['INSERT', 'SELECT']);
break;
case 316:
parser.addTablePrimary($$[$0 - 6]);
break;
case 321:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'PARTITION', weight: 2 }, { value: 'COMPUTE STATISTICS', weight: 1 }]);
}
else {
parser.suggestKeywords(['COMPUTE STATISTICS']);
}
break;
case 322:
parser.addTablePrimary($$[$0 - 3]);
parser.suggestKeywords(['STATISTICS']);
break;
case 323:
parser.addTablePrimary($$[$0 - 7]);
parser.suggestKeywords(parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'FOR COLUMNS', weight: 3 }, { value: 'CACHE METADATA', weight: 2 }, { value: 'NOSCAN', weight: 1 }]));
break;
case 324:
parser.addTablePrimary($$[$0 - 7]);
parser.suggestKeywords(parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [{ value: 'CACHE METADATA', weight: 2 }, { value: 'NOSCAN', weight: 1 }]));
break;
case 325:
parser.addTablePrimary($$[$0 - 7]);
parser.suggestKeywords(parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'NOSCAN', weight: 1 }]));
break;
case 326:
parser.suggestKeywords(['TABLE']);
parser.addTablePrimary($$[$0 - 1]);
break;
case 327:
parser.suggestKeywords(['TABLE']);
parser.addTablePrimary($$[$0 - 6]);
break;
case 339:
parser.suggestKeywords(['METADATA']);
break;
case 343:
if (!$$[$0 - 1]) {
parser.suggestDdlAndDmlKeywords([
{ value: 'AST', weight: 2 },
{ value: 'AUTHORIZATION', weight: 2 },
{ value: 'CBO', weight: 2 },
{ value: 'DEPENDENCY', weight: 2 },
{ value: 'EXTENDED', weight: 2 },
{ value: 'FORMATTED CBO', weight: 2 },
{ value: 'LOCKS', weight: 2 },
{ value: 'VECTORIZATION', weight: 2 }
]);
}
else if ($$[$0 - 1] && $$[$0 - 1].suggestKeywords) {
parser.suggestDdlAndDmlKeywords($$[$0 - 1].suggestKeywords);
}
else {
parser.suggestDdlAndDmlKeywords();
}
break;
case 344:
parser.suggestKeywords(['CBO']);
break;
case 348:
case 349:
if (!$$[$0]) {
this.$ = { suggestKeywords: ['COST', 'JOINCOST'] };
}
break;
case 353:
var keywords = [];
if (!$$[$0]) {
keywords = keywords.concat([
{ weight: 1, value: 'DETAIL' },
{ weight: 1, value: 'EXPRESSION' },
{ weight: 1, value: 'OPERATOR' },
{ weight: 1, value: 'SUMMARY' }
]);
}
if (!$$[$0 - 1]) {
keywords.push({ weight: 2, value: 'ONLY' });
}
if (keywords.length) {
this.$ = { suggestKeywords: keywords };
}
break;
case 379:
if ($$[$0 - 1]) {
parser.suggestKeywords(['TABLE']);
}
else {
if ($$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestKeywords(['EXTERNAL TABLE', 'FUNCTION', 'MACRO', 'TABLE']);
}
else if (!$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestKeywords(['DATABASE', 'EXTERNAL TABLE', 'FUNCTION', 'INDEX', 'MATERIALIZED VIEW', 'ROLE', 'SCHEMA', 'TABLE', 'TEMPORARY EXTERNAL TABLE', 'TEMPORARY FUNCTION', 'TEMPORARY MACRO', 'TEMPORARY TABLE', 'TRANSACTIONAL TABLE', 'VIEW']);
}
else if ($$[$0 - 2]) {
parser.suggestKeywords(['TABLE']);
}
}
break;
case 380:
parser.addNewDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
break;
case 381:
case 409:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 383:
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 384:
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 385:
parser.addNewDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
break;
case 387:
var keywords = [];
if (!$$[$0]) {
keywords.push('WITH DBPROPERTIES');
}
if (!$$[$0 - 1] && !$$[$0]) {
keywords.push('LOCATION');
}
if (!$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
keywords.push('COMMENT');
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
break;
case 402:
parser.suggestKeywords(['DBPROPERTIES']);
break;
case 421:
var keywords = [];
if (!$$[$0 - 10] && !$$[$0 - 9] && !$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'LIKE', weight: 1 });
}
else {
if (!$$[$0 - 9] && !$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'COMMENT', weight: 10 });
}
if (!$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'PARTITIONED BY', weight: 9 });
}
if (!$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'CLUSTERED BY', weight: 8 });
}
if (!$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'SKEWED BY', weight: 7 });
}
else if ($$[$0 - 6] && $$[$0 - 6].suggestKeywords && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 6].suggestKeywords, 7)); // Get the last optional from SKEWED BY
}
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'ROW FORMAT', weight: 6 });
}
else if ($$[$0 - 5] && $$[$0 - 5].suggestKeywords && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 5].suggestKeywords, 6));
}
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'STORED AS', weight: 5 });
keywords.push({ value: 'STORED BY', weight: 5 });
}
else if ($$[$0 - 4] && $$[$0 - 4].storedBy && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'WITH SERDEPROPERTIES', weight: 4 });
}
if (!$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'LOCATION', weight: 3 });
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'TBLPROPERTIES', weight: 2 });
}
keywords.push({ value: 'AS', weight: 1 });
}
parser.suggestKeywords(keywords);
break;
case 422:
parser.addNewTableLocation(_$[$0 - 1], $$[$0 - 1], $$[$0]);
this.$ = $$[$0];
break;
case 427:
this.$ = [];
break;
case 431:
case 752:
case 754:
case 1206:
case 1700:
case 1703:
case 1818:
case 1896:
case 2065:
case 2244:
case 2324:
case 2382:
this.$ = $$[$0 - 1];
break;
case 432:
case 753:
case 755:
this.$ = $$[$0 - 3];
break;
case 435:
parser.suggestKeywords([{ value: 'PRIMARY KEY', weight: 2 }, { value: 'CONSTRAINT', weight: 1 }]);
break;
case 436:
case 1922:
this.$ = [$$[$0]];
break;
case 437:
this.$ = $$[$0 - 2].concat($$[$0]);
break;
case 442:
case 444:
case 621:
parser.checkForKeywords($$[$0 - 1]);
break;
case 443:
case 445:
parser.checkForKeywords($$[$0 - 3]);
break;
case 446:
this.$ = $$[$0 - 3];
this.$.type = $$[$0 - 2];
var keywords = [];
if (!$$[$0]) {
keywords = keywords.concat([
{ value: 'COMMENT', weight: 1 },
{ value: 'CHECK', weight: 2 },
{ value: 'PRIMARY KEY', weight: 2 },
{ value: 'UNIQUE', weight: 2 },
{ value: 'NOT NULL', weight: 2 },
{ value: 'DEFAULT', weight: 2 }
]);
if (!$$[$0 - 1] && $$[$0 - 2].toLowerCase() === 'double') {
keywords.push({ value: 'PRECISION', weight: 3 });
}
else if ($$[$0 - 1] && $$[$0 - 1].suggestKeywords) {
keywords = keywords.concat($$[$0 - 1].suggestKeywords);
}
}
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 447:
case 489:
case 495:
case 496:
case 509:
case 512:
case 524:
case 526:
case 812:
parser.suggestKeywords(parser.getColumnDataTypeKeywords());
break;
case 454:
this.$ = { suggestKeywords: [{ value: 'KEY', weight: 3 }] };
break;
case 457:
this.$ = { suggestKeywords: [{ value: 'NULL', weight: 3 }] };
break;
case 460:
this.$ = {
suggestKeywords: [
{ value: 'LITERAL', weight: 3 },
{ value: 'CURRENT_USER()', weight: 3 },
{ value: 'CURRENT_DATE()', weight: 3 },
{ value: 'CURRENT_TIMESTAMP()', weight: 3 },
{ value: 'NULL', weight: 3 }
]
};
break;
case 461:
var keywords = [];
if (!$$[$0]) {
keywords.push({ value: 'RELY', weight: 3 });
keywords.push({ value: 'NORELY', weight: 3 });
if (!$$[$0 - 1]) {
keywords.push({ value: 'NOVALIDATE', weight: 3 });
if (!$$[$0 - 2]) {
keywords.push({ value: 'RELY', weight: 3 });
keywords.push({ value: 'NORELY', weight: 3 });
}
}
}
if (keywords.length) {
this.$ = { suggestKeywords: keywords };
}
break;
case 494:
parser.suggestKeywords(parser.getTypeKeywords());
break;
case 508:
case 511:
parser.suggestKeywords(['COMMENT']);
break;
case 534:
parser.suggestKeywords(['CONSTRAINT']);
break;
case 544:
parser.suggestKeywordsForOptionalsLR([$$[$0 - 1], $$[$0 - 2], $$[$0 - 3]], [
[{ value: 'RELY', weight: 1 }, { value: 'NORELY', weight: 1 }],
{ value: 'NOVALIDATE', weight: 2 },
{ value: 'DISABLE', weight: 3 }
]);
break;
case 548:
parser.suggestKeywords(['CHECK', 'FOREIGN KEY', 'UNIQUE']);
break;
case 553:
parser.suggestKeywordsForOptionalsLR([$$[$0 - 1], $$[$0 - 2], $$[$0 - 3]], [
[{ value: 'RELY', weight: 1 }, { value: 'NORELY', weight: 1 }],
{ value: 'NOVALIDATE', weight: 2 },
{ value: 'DISABLE', weight: 1 }
]);
break;
case 555:
case 565:
parser.suggestKeywords(['KEY']);
break;
case 557:
parser.suggestKeywords(['REFERENCES']);
break;
case 574:
parser.suggestKeywords(['HASH', 'RANGE']);
break;
case 588:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'INTO', weight: 1 }, { value: 'SORTED BY', weight: 2 }]);
}
else {
parser.suggestKeywords(['INTO']);
}
break;
case 589:
parser.suggestKeywords(['BUCKETS']);
break;
case 597:
parser.suggestKeywords(['SORTED ON']);
break;
case 626:
this.$ = { suggestKeywords: ['STORED AS DIRECTORIES'] };
break;
case 635:
this.$ = $$[$0];
break;
case 636:
parser.suggestKeywords(['FORMAT']);
break;
case 637:
parser.suggestKeywords(['DELIMITED', 'SERDE']);
break;
case 642:
this.$ = { storedBy: true };
break;
case 643:
parser.suggestKeywords(['AS', 'BY']);
break;
case 645:
this.$ = { suggestKeywords: ['STORED AS'] };
break;
case 660:
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'FIELDS TERMINATED BY', weight: 5 }, { value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
}
else if ($$[$0 - 4] && $$[$0 - 4].suggestKeywords && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: parser.createWeightedKeywords($$[$0 - 4].suggestKeywords, 5).concat([{ value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }]) };
}
else if (!$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'COLLECTION ITEMS TERMINATED BY', weight: 4 }, { value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
}
else if (!$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'MAP KEYS TERMINATED BY', weight: 3 }, { value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
}
else if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'LINES TERMINATED BY', weight: 2 }, { value: 'NULL DEFINED AS', weight: 1 }] };
}
else if (!$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'NULL DEFINED AS', weight: 1 }] };
}
break;
case 667:
this.$ = { suggestKeywords: ['ESCAPED BY'] };
break;
case 669:
case 675:
case 680:
case 684:
parser.suggestKeywords(['TERMINATED BY']);
break;
case 674:
parser.suggestKeywords(['ITEMS TERMINATED BY']);
break;
case 679:
parser.suggestKeywords(['KEYS TERMINATED BY']);
break;
case 688:
parser.suggestKeywords(['DEFINED AS']);
break;
case 689:
case 730:
case 734:
case 763:
case 1929:
case 2457:
parser.suggestKeywords(['AS']);
break;
case 693:
case 694:
parser.suggestKeywords(['SERDEPROPERTIES']);
break;
case 703:
parser.commitLocations();
break;
case 706:
case 719:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
parser.suggestDatabases({ appendDot: true });
break;
case 707:
parser.suggestKeywordsForOptionalsLR([undefined, $$[$0 - 2], $$[$0 - 3], $$[$0 - 4], $$[$0 - 5], $$[$0 - 6], $$[$0 - 7], $$[$0 - 8], $$[$0 - 9]], [
{ value: 'AS SELECT', weight: 1 },
{ value: 'TBLPROPERTIES', weight: 2 },
{ value: 'LOCATION', weight: 3 },
[{ value: 'ROW FORMAT', weight: 4 }, { value: 'STORED AS', weight: 4 }, { value: 'STORED BY', weight: 4 }],
[{ value: 'CLUSTERED ON', weight: 5 }, { value: 'DISTRIBUTED ON', weight: 5 }],
{ value: 'PARTITIONED ON', weight: 6 },
{ value: 'COMMENT', weight: 7 },
{ value: 'DISABLE REWRITE', weight: 8 }
]);
break;
case 717:
parser.suggestKeywords(['REWRITE']);
break;
case 720:
if (!$$[$0 - 7]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 723:
var keywords = [{ value: 'AS', weight: 1 }];
if (!$$[$0 - 1]) {
keywords.push({ value: 'TBLPROPERTIES', weight: 2 });
if (!$$[$0 - 2]) {
keywords.push({ value: 'COMMENT', weight: 3 });
}
}
parser.suggestKeywords(keywords);
break;
case 732:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['USING']);
}
else {
parser.suggestKeywords(['ARCHIVE', 'FILE', 'JAR']);
}
break;
case 736:
parser.suggestFunctions();
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
break;
case 739:
parser.suggestKeywords(['ARCHIVE', 'FILE', 'JAR']);
break;
case 749:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['COMMENT']);
}
break;
case 758:
parser.suggestKeywords(['ON TABLE']);
break;
case 764:
case 777:
parser.suggestKeywords(['\'BITMAP\'', '\'COMPACT\'']);
break;
case 771:
if ($$[$0 - 4] && parser.yy.result.suggestKeywords && parser.yy.result.suggestKeywords.length === 2) {
parser.suggestKeywords(['AS']);
}
break;
case 773:
if (!$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'WITH DEFERRED REBUILD', weight: 7 }, { value: 'IDXPROPERTIES', weight: 6 }, { value: 'IN TABLE', weight: 5 }, { value: 'ROW FORMAT', weight: 4 }, { value: 'STORED AS', weight: 4 }, { value: 'STORED BY', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'IDXPROPERTIES', weight: 6 }, { value: 'IN TABLE', weight: 5 }, { value: 'ROW FORMAT', weight: 4 }, { value: 'STORED AS', weight: 4 }, { value: 'STORED BY', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'IN TABLE', weight: 5 }, { value: 'ROW FORMAT', weight: 4 }, { value: 'STORED AS', weight: 4 }, { value: 'STORED BY', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'ROW FORMAT', weight: 4 }, { value: 'STORED AS', weight: 4 }, { value: 'STORED BY', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if ($$[$0 - 5] && $$[$0 - 5].suggestKeywords && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestKeywords(parser.createWeightedKeywords($$[$0 - 5].suggestKeywords, 5).concat([{ value: 'STORED AS', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]));
}
else if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'STORED AS', weight: 4 }, { value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'LOCATION', weight: 3 }, { value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'TBLPROPERTIES', weight: 2 }, { value: 'COMMENT', weight: 1 }]);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'COMMENT', weight: 1 }]);
}
break;
case 780:
parser.suggestKeywords(['DEFERRED REBUILD']);
break;
case 781:
parser.suggestKeywords(['REBUILD']);
break;
case 800:
parser.suggestFunctions();
break;
case 826:
parser.addCommonTableExpressions($$[$0 - 1]);
break;
case 850:
parser.suggestKeywords(['DATABASE', 'FUNCTION', 'INDEX', 'MATERIALIZED VIEW', 'ROLE', 'SCHEMA', 'TABLE', 'TEMPORARY FUNCTION', 'TEMPORARY MACRO', 'VIEW']);
break;
case 854:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestDatabases();
break;
case 855:
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
break;
case 857:
if (!$$[$0 - 3]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 860:
case 865:
case 884:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 861:
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 870:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestTables({ onlyTables: true });
parser.suggestDatabases({
appendDot: true
});
break;
case 873:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PURGE']);
}
break;
case 877:
parser.suggestKeywords(['IF EXISTS']);
break;
case 883:
parser.suggestKeywords(['FUNCTION', 'MACRO']);
break;
case 891:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestTables({ onlyViews: true });
parser.suggestDatabases({ appendDot: true });
break;
case 892:
parser.addTablePrimary($$[$0]);
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 900:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 904:
case 1110:
case 1115:
case 1118:
case 1122:
parser.suggestKeywords(['FROM']);
break;
case 906:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0]) {
parser.suggestKeywords(['WHERE']);
}
break;
case 910:
parser.suggestKeywords(['TRANSACTIONS']);
break;
case 916:
case 1296:
case 1298:
parser.addStatementLocation(_$[$0]);
break;
case 920:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2]), _$[$0]);
this.$ = { selectList: $$[$0] };
break;
case 921:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0 - 1]);
this.$ = { selectList: $$[$0 - 1], tableExpression: $$[$0] };
break;
case 922:
parser.selectListNoTableSuggest($$[$0 - 1], $$[$0 - 2]);
break;
case 924:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2]), _$[$0]);
if ($$[$0].cursorAtStart) {
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 1]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
parser.suggestKeywords(keywords);
}
else {
parser.checkForSelectListKeywords($$[$0]);
}
if ($$[$0].suggestFunctions) {
parser.suggestFunctions();
}
if ($$[$0].suggestColumns) {
parser.suggestColumns({ identifierChain: [], source: 'select' });
}
if ($$[$0].suggestTables) {
parser.suggestTables({ prependQuestionMark: true, prependFrom: true });
}
if ($$[$0].suggestDatabases) {
parser.suggestDatabases({ prependQuestionMark: true, prependFrom: true, appendDot: true });
}
if ($$[$0].suggestAggregateFunctions && (!$$[$0 - 1] || $$[$0 - 1] === 'ALL')) {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
break;
case 925:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2]), _$[$0], true);
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 1] || $$[$0 - 1] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
parser.suggestKeywords(keywords);
parser.suggestFunctions();
parser.suggestColumns({ identifierChain: [], source: 'select' });
parser.suggestTables({ prependQuestionMark: true, prependFrom: true });
parser.suggestDatabases({ prependQuestionMark: true, prependFrom: true, appendDot: true });
break;
case 926:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0 - 1]);
break;
case 927:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0 - 1]);
parser.selectListNoTableSuggest($$[$0 - 1], $$[$0 - 2]);
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'select';
}
break;
case 928:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0 - 1], true);
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2] || $$[$0 - 2] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 2]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
parser.suggestKeywords(keywords);
parser.suggestFunctions();
parser.suggestColumns({ identifierChain: [], source: 'select' });
parser.suggestTables({ prependQuestionMark: true, prependFrom: true });
parser.suggestDatabases({ prependQuestionMark: true, prependFrom: true, appendDot: true });
break;
case 929:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 2]);
parser.checkForSelectListKeywords($$[$0 - 2]);
break;
case 930:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5]), _$[$0 - 3]);
parser.checkForSelectListKeywords($$[$0 - 3]);
break;
case 931:
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0 - 1]);
parser.checkForSelectListKeywords($$[$0 - 1]);
var keywords = ['FROM'];
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
parser.suggestKeywords(keywords);
parser.suggestTables({ prependFrom: true });
parser.suggestDatabases({ prependFrom: true, appendDot: true });
break;
case 940:
case 941:
this.$ = { cursorAtStart: false, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 942:
case 2235:
case 2236:
this.$ = { cursorAtStart: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 948:
case 949:
case 950:
case 951:
this.$ = {};
break;
case 952:
this.$ = { lateralView: { udtf: $$[$0 - 2], tableAlias: $$[$0 - 1], columnAliases: $$[$0] } };
break;
case 953:
if ($$[$0 - 1].function.toLowerCase() === 'explode') {
this.$ = { lateralView: { udtf: $$[$0 - 1], tableAlias: $$[$0], columnAliases: ['key', 'value'] }, suggestKeywords: ['AS'] };
}
else if ($$[$0 - 1].function.toLowerCase() === 'posexplode') {
this.$ = { lateralView: { udtf: $$[$0 - 1], tableAlias: $$[$0], columnAliases: ['pos', 'val'] }, suggestKeywords: ['AS'] };
}
else {
this.$ = { lateralView: { udtf: $$[$0 - 1], tableAlias: $$[$0], columnAliases: [] }, suggestKeywords: ['AS'] };
}
break;
case 954:
this.$ = { lateralView: { udtf: $$[$0 - 1], columnAliases: $$[$0] } };
break;
case 955:
case 957:
parser.suggestKeywords(['JOIN', 'OUTER JOIN']);
break;
case 956:
parser.suggestKeywords(['JOIN', 'OUTER JOIN', 'SEMI JOIN']);
break;
case 958:
case 960:
case 961:
case 963:
case 964:
case 965:
case 966:
case 968:
case 969:
case 970:
case 971:
this.$ = { suggestKeywords: ['JOIN'] };
break;
case 959:
case 967:
this.$ = { suggestKeywords: ['OUTER'] };
break;
case 962:
this.$ = { suggestKeywords: ['OUTER', 'SEMI'] };
break;
case 972:
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 5], $$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'GROUP BY', weight: 8 }, { value: 'HAVING', weight: 7 }, { value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }, { value: 'SORT BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true, true, true, true, true]),
cursorAtEnd: !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
};
break;
case 973:
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }, { value: 'SORT BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true, true, true]),
cursorAtEnd: !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
};
break;
case 974:
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }, { value: 'SORT BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true, true]),
cursorAtEnd: !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
};
break;
case 975:
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [[{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }, { value: 'SORT BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true]),
cursorAtEnd: !$$[$0 - 1] && !$$[$0]
};
break;
case 976:
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'LIMIT', weight: 3 }], [true]),
cursorAtEnd: !$$[$0]
};
break;
case 977:
this.$ = {
suggestKeywords: [],
cursorAtEnd: true
};
break;
case 998:
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'where';
}
break;
case 999:
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'group by';
}
break;
case 1002:
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'order by';
}
break;
case 1005:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 5], $$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 1], $$[$0]], [{ value: 'GROUP BY', weight: 8 }, { value: 'HAVING', weight: 7 }, { value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }], { value: 'SORT BY', weight: 4 }, { value: 'LIMIT', weight: 3 }], [true, true, true, true, true, !$$[$0 - 2], true]);
if ($$[$0 - 7].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 7].suggestKeywords, 1));
}
this.$ = parser.getValueExpressionKeywords($$[$0 - 7], keywords);
this.$.cursorAtEnd = !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0];
if ($$[$0 - 7].columnReference) {
this.$.columnReference = $$[$0 - 7].columnReference;
}
if (!$$[$0 - 5]) {
parser.suggestGroupBys({ prefix: 'GROUP BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestOrderBys({ prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5], $$[$0 - 7], _$[$0 - 7]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1006:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 1], $$[$0]], [{ value: 'HAVING', weight: 7 }, { value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }], { value: 'SORT BY', weight: 4 }, { value: 'LIMIT', weight: 3 }], [true, true, true, true, !$$[$0 - 2], true]);
if ($$[$0 - 6].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 6].suggestKeywords, 8));
}
if ($$[$0 - 6].valueExpression) {
this.$ = parser.getValueExpressionKeywords($$[$0 - 6].valueExpression, keywords);
if ($$[$0 - 6].valueExpression.columnReference) {
this.$.columnReference = $$[$0 - 6].valueExpression.columnReference;
}
}
else {
this.$ = { suggestKeywords: keywords };
}
this.$.cursorAtEnd = !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0];
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestOrderBys({ prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 6], _$[$0 - 6]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1007:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 1], $$[$0]], [{ value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }], { value: 'SORT BY', weight: 4 }, { value: 'LIMIT', weight: 3 }], [true, true, true, !$$[$0 - 2], true]);
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0] };
if (!$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestOrderBys({ prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 5], _$[$0 - 5]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1008:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }, { value: 'SORT BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true, true]);
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0] };
if (!$$[$0 - 2]) {
parser.suggestOrderBys({ prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 4], _$[$0 - 4]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1009:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [[{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }], { value: 'LIMIT', weight: 3 }], [true, true]);
if ($$[$0 - 3].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 3].suggestKeywords, 5));
}
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0 - 1] && !$$[$0] };
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 3], _$[$0 - 3]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1010:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'LIMIT', weight: 3 }], [true]);
if ($$[$0 - 2].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 4));
}
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0] };
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = _$[$0 - 2];
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
break;
case 1011:
this.$ = { suggestKeywords: [], cursorAtEnd: true };
this.$.whereClauseLocation = $$[$0 - 7] ? _$[$0 - 7] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5], $$[$0 - 6], _$[$0 - 6], $$[$0 - 7], _$[$0 - 7]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
break;
case 1015:
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
break;
case 1018:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['ON', 'TO']);
}
else {
parser.suggestKeywords(['TO']);
}
break;
case 1021:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH GRANT OPTION']);
}
break;
case 1026:
case 1030:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH ADMIN OPTION']);
}
break;
case 1034:
parser.suggestKeywords(['DATABASE', 'TABLE']);
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1043:
if ($$[$0].toUpperCase() === 'ALL') {
this.$ = { singleAll: true };
}
break;
case 1049:
case 1050:
case 1051:
case 1101:
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'INDEX', 'INSERT', 'LOCK', 'SELECT', 'SHOW_DATABASE', 'UPDATE']);
break;
case 1080:
parser.suggestKeywords(['GRANT OPTION']);
break;
case 1081:
case 1085:
case 1125:
parser.suggestKeywords(['OPTION']);
break;
case 1084:
parser.suggestKeywords(['ADMIN OPTION']);
break;
case 1093:
parser.suggestKeywords(['ADMIN OPTION FOR', 'ALL', 'ALL GRANT OPTION FROM', 'ALL PRIVILEGES FROM', 'ALTER', 'CREATE', 'DELETE', 'DROP', 'GRANT OPTION FOR', 'INDEX', 'INSERT', 'LOCK', 'ROLE', 'SELECT', 'UPDATE']);
break;
case 1096:
if (!$$[$0 - 1]) {
if ($$[$0 - 2].singleAll) {
parser.suggestKeywords(['FROM', 'GRANT OPTION', 'ON', 'PRIVILEGES FROM']);
}
else {
parser.suggestKeywords(['FROM', 'ON']);
}
}
else {
parser.suggestKeywords(['FROM']);
}
break;
case 1099:
parser.suggestKeywords(['OPTION FOR']);
break;
case 1100:
case 1113:
parser.suggestKeywords(['FOR']);
break;
case 1104:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['FROM', 'ON']);
}
else {
parser.suggestKeywords(['FROM']);
}
break;
case 1107:
if ($$[$0 - 1].toUpperCase() === 'ADMIN') {
parser.suggestKeywords(['FROM', 'OPTION FOR']);
}
else {
parser.suggestKeywords(['FROM']);
}
break;
case 1114:
parser.suggestKeywords(['ROLE']);
break;
case 1131:
var keywords = [];
if ($$[$0 - 1].suggestKeywords) {
keywords = parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2).concat([{ value: 'SELECT', weight: 1 }]);
}
else {
keywords = ['SELECT'];
}
if ($$[$0 - 1].addValues) {
keywords.push({ weight: 1.1, value: 'VALUES' });
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
break;
case 1134:
if (!$$[$0].keepTables) {
delete parser.yy.result.suggestTables;
delete parser.yy.result.suggestDatabases;
}
break;
case 1138:
parser.suggestKeywords(['INSERT INTO', 'INSERT OVERWRITE', 'SELECT']);
break;
case 1139:
if ($$[$0 - 1].cursorAtEnd) {
parser.checkForSelectListKeywords($$[$0 - 1]);
var keywords = parser.yy.result.suggestKeywords || [];
if ($$[$0].suggestKeywords) {
keywords = keywords.concat($$[$0].suggestKeywords);
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
}
delete parser.yy.result.suggestTables;
delete parser.yy.result.suggestDatabases;
break;
case 1140:
if ($$[$0].cursorAtStart) {
parser.checkForSelectListKeywords($$[$0 - 1].tableExpression);
}
break;
case 1141:
$$[$0 - 3].owner = 'insert';
parser.addTablePrimary($$[$0 - 3]);
break;
case 1142:
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: ['PARTITION'] };
}
else if (!$$[$0]) {
this.$ = { suggestKeywords: ['IF NOT EXISTS'] };
}
break;
case 1143:
if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'ROW FORMAT', weight: 2 }, { value: 'STORED AS', weight: 1 }] };
}
else if (!$$[$0]) {
this.$ = { suggestKeywords: ['STORED AS'] };
}
break;
case 1144:
if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'ROW FORMAT', weight: 2 }, { value: 'STORED AS', weight: 1 }] };
}
else if (!$$[$0]) {
this.$ = { suggestKeywords: ['STORED AS'] };
}
break;
case 1145:
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: ['PARTITION'], addValues: true };
}
else if (!$$[$0]) {
this.$ = { addValues: true };
}
break;
case 1146:
parser.suggestKeywords(['OVERWRITE', 'INTO']);
break;
case 1147:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['DIRECTORY', 'LOCAL DIRECTORY', 'TABLE']);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
this.$ = { keepTables: true };
break;
case 1148:
case 1159:
this.$ = { keepTables: true };
break;
case 1149:
case 1160:
case 1161:
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.owner = 'insert';
}
break;
case 1150:
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
break;
case 1151:
parser.suggestKeywords(['DIRECTORY']);
break;
case 1158:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['TABLE']);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
this.$ = { keepTables: true };
break;
case 1171:
if ($$[$0 - 1].suggestKeywords) {
parser.suggestKeywords(parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2).concat([{ value: 'SELECT', weight: 1 }]));
}
else {
parser.suggestKeywords(['SELECT']);
}
break;
case 1172:
if ($$[$0 - 1].cursorAtEnd) {
parser.checkForSelectListKeywords($$[$0 - 1]);
var keywords = parser.yy.result.suggestKeywords || [];
if ($$[$0].suggestKeywords) {
keywords = keywords.concat($$[$0].suggestKeywords);
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
}
break;
case 1181:
parser.suggestKeywords(['FORMAT DELIMITED']);
break;
case 1182:
parser.suggestKeywords(['DELIMITED']);
break;
case 1184:
this.$ = { selectList: $$[$0] };
break;
case 1185:
this.$ = $$[$0 - 1];
this.$.cursorAtEnd = true;
break;
case 1186:
parser.selectListNoTableSuggest($$[$0], $$[$0 - 1]);
break;
case 1187:
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 1] || $$[$0 - 1] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
parser.suggestKeywords(keywords);
parser.suggestFunctions();
parser.suggestColumns();
break;
case 1191:
case 1227:
case 1810:
case 1982:
case 1983:
case 1989:
case 1990:
case 2320:
case 2409:
parser.valueExpressionSuggest();
break;
case 1193:
parser.suggestValueExpressionKeywords($$[$0 - 1], [{ value: 'WHEN', weight: 2 }]);
break;
case 1195:
$$[$0 - 6].alias = $$[$0 - 4];
parser.addTablePrimary($$[$0 - 6]);
if ($$[$0 - 2].subQuery) {
parser.addTablePrimary({ subQueryAlias: $$[$0] });
}
else {
$$[$0 - 2].alias = $$[$0];
}
break;
case 1196:
parser.suggestKeywords(['INTO']);
break;
case 1197:
parser.suggestDatabases({ appendDot: true });
parser.suggestTables();
break;
case 1199:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['AS T USING']);
break;
case 1200:
parser.addTablePrimary($$[$0 - 2]);
parser.suggestKeywords(['T USING']);
break;
case 1201:
$$[$0 - 3].alias = $$[$0 - 1];
parser.addTablePrimary($$[$0 - 3]);
parser.suggestKeywords(['USING']);
break;
case 1202:
$$[$0 - 4].alias = $$[$0 - 2];
parser.addTablePrimary($$[$0 - 4]);
parser.suggestDatabases({ appendDot: true });
parser.suggestTables();
break;
case 1203:
$$[$0 - 4].alias = $$[$0 - 2];
parser.addTablePrimary($$[$0 - 4]);
break;
case 1204:
$$[$0 - 5].alias = $$[$0 - 3];
parser.addTablePrimary($$[$0 - 5]);
parser.suggestKeywords(['AS S ON']);
break;
case 1205:
$$[$0 - 6].alias = $$[$0 - 4];
parser.addTablePrimary($$[$0 - 6]);
parser.suggestKeywords(['S ON']);
break;
case 1214:
if ($$[$0].suggestThenKeywords) {
parser.suggestKeywords(['DELETE', 'INSERT VALUES', 'UPDATE SET']);
}
break;
case 1215:
case 1217:
if (!$$[$0 - 1].notPresent) {
parser.suggestKeywords(['WHEN']);
}
break;
case 1216:
if (!$$[$0 - 1].notPresent && $$[$0].suggestThenKeywords) {
var keywords = [];
if (!$$[$0 - 1].isDelete) {
keywords.push('DELETE');
}
if (!$$[$0 - 1].isInsert) {
keywords.push('INSERT VALUES');
}
if (!$$[$0 - 1].isUpdate) {
keywords.push('UPDATE SET');
}
parser.suggestKeywords(keywords);
}
break;
case 1218:
if (!$$[$0 - 1].notPresent && $$[$0].suggestThenKeywords) {
var keywords = [];
if (!$$[$0 - 2].isDelete && !$$[$0 - 1].isDelete) {
keywords.push('DELETE');
}
if (!$$[$0 - 2].isInsert && !$$[$0 - 1].isInsert) {
keywords.push('INSERT VALUES');
}
if (!$$[$0 - 2].isUpdate && !$$[$0 - 1].isUpdate) {
keywords.push('UPDATE SET');
}
parser.suggestKeywords(keywords);
}
break;
case 1219:
this.$ = { notPresent: !!$$[$0 - 4], isDelete: $$[$0].isDelete, isInsert: $$[$0].isInsert, isUpdate: $$[$0].isUpdate };
break;
case 1220:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['NOT MATCHED', 'MATCHED']);
}
else {
parser.suggestKeywords(['MATCHED']);
}
break;
case 1221:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['AND', 'THEN']);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 1], [{ value: 'THEN', weight: 2 }]);
}
break;
case 1223:
this.$ = { suggestThenKeywords: true };
break;
case 1228:
this.$ = { isUpdate: true };
break;
case 1229:
this.$ = { isDelete: true };
break;
case 1230:
this.$ = { isInsert: true };
break;
case 1231:
parser.suggestKeywords(['SET']);
break;
case 1233:
case 1750:
case 1753:
parser.suggestKeywords(['VALUES']);
break;
case 1235:
parser.suggestKeywords(['DATA LOCAL INPATH', 'DATA INPATH']);
break;
case 1236:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['INPATH', 'LOCAL INPATH']);
}
else {
parser.suggestKeywords(['INPATH']);
}
break;
case 1238:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
}
else {
parser.suggestKeywords(['INTO TABLE']);
}
break;
case 1239:
parser.suggestKeywords(['TABLE']);
break;
case 1242:
parser.addTablePrimary($$[$0 - 3]);
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['INPUTFORMAT', 'PARTITION']);
}
else if ($$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['INPUTFORMAT']);
}
break;
case 1253:
parser.suggestKeywords(['SERDE']);
break;
case 1255:
if (!$$[$0]) {
parser.suggestKeywords(['EXTERNAL TABLE', 'FROM', 'TABLE']);
}
else if (!$$[$0].hasExternal) {
parser.suggestKeywords(['EXTERNAL']);
}
break;
case 1256:
if ($$[$0 - 1].suggestKeywords) {
parser.suggestKeywords(parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2).concat(['FROM']));
}
else {
parser.suggestKeywords(['FROM']);
}
break;
case 1260:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['LOCATION']);
}
break;
case 1261:
if (!$$[$0 - 4]) {
parser.suggestKeywords(['EXTERNAL TABLE', 'TABLE']);
}
else if (!$$[$0 - 4].hasExternal) {
parser.suggestKeywords(['EXTERNAL']);
}
break;
case 1263:
if ($$[$0 - 5].suggestKeywords) {
parser.suggestKeywords(parser.createWeightedKeywords($$[$0 - 5].suggestKeywords, 2).concat(['FROM']));
}
break;
case 1266:
parser.addTablePrimary($$[$0 - 1]);
if (!$$[$0]) {
this.$ = { hasExternal: true, suggestKeywords: ['PARTITION'] };
}
else {
this.$ = { hasExternal: true };
}
break;
case 1267:
parser.addTablePrimary($$[$0 - 1]);
if (!$$[$0]) {
this.$ = { suggestKeywords: ['PARTITION'] };
}
break;
case 1275:
case 1282:
case 1289:
parser.addTablePrimary($$[$0 - 4]);
break;
case 1276:
case 1290:
case 1291:
parser.addTablePrimary($$[$0 - 9]);
break;
case 1280:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ weight: 2, value: 'PARTITION' }, { weight: 1, value: 'TO' }]);
}
else {
parser.suggestKeywords(['TO']);
}
break;
case 1283:
parser.addTablePrimary($$[$0 - 5]);
parser.suggestKeywords(['FOR replication()']);
break;
case 1284:
parser.addTablePrimary($$[$0 - 6]);
parser.suggestKeywords(['replication()']);
break;
case 1287:
parser.addTablePrimary($$[$0 - 5]);
if (!$$[$0 - 4]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 1288:
parser.addTablePrimary($$[$0 - 10]);
if (!$$[$0 - 9]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 1293:
case 1294:
return parser.yy.result;
break;
case 1295:
parser.prepareNewStatement();
break;
case 1297:
case 1299:
parser.addStatementLocation(_$[$0 - 3]);
break;
case 1701:
case 1704:
case 1819:
this.$ = '';
break;
case 1719:
parser.suggestKeywords(['INDEX', 'INDEXES']);
break;
case 1720:
parser.suggestKeywords(['FORMATTED']);
break;
case 1734:
case 1737:
parser.yy.correlatedSubQuery = false;
break;
case 1735:
case 1739:
parser.suggestKeywords(['EXISTS']);
break;
case 1738:
parser.suggestKeywords(['NOT EXISTS']);
break;
case 1749:
case 1751:
case 1752:
case 1754:
parser.suggestKeywords(['<', '<=', '<>', '=', '>', '>=']);
break;
case 1789:
case 1820:
parser.addTableLocation(_$[$0], [{ name: $$[$0] }]);
this.$ = { identifierChain: [{ name: $$[$0] }] };
break;
case 1790:
case 1821:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
parser.addTableLocation(_$[$0], [{ name: $$[$0 - 2] }, { name: $$[$0] }]);
this.$ = { identifierChain: [{ name: $$[$0 - 2] }, { name: $$[$0] }] };
break;
case 1792:
case 1797:
parser.suggestDatabases();
this.$ = { identifierChain: [{ name: $$[$0 - 2] }] };
break;
case 1793:
case 1823:
parser.suggestTablesOrColumns($$[$0 - 2]);
break;
case 1794:
this.$ = [{ name: $$[$0] }];
break;
case 1795:
this.$ = [{ name: $$[$0 - 2] }, { name: $$[$0 - 1] }];
break;
case 1822:
case 2689:
parser.suggestTables();
parser.suggestDatabases({ prependDot: true });
break;
case 1825:
this.$ = { identifierChain: $$[$0 - 1].identifierChain, alias: $$[$0] };
break;
case 1828:
parser.yy.locations[parser.yy.locations.length - 1].type = 'column';
break;
case 1829:
case 2199:
parser.addAsteriskLocation(_$[$0], $$[$0 - 2].concat({ asterisk: true }));
break;
case 1831:
this.$ = [$$[$0].identifier];
parser.yy.firstChainLocation = parser.addUnknownLocation($$[$0].location, [$$[$0].identifier]);
break;
case 1832:
if (parser.yy.firstChainLocation) {
parser.yy.firstChainLocation.firstInChain = true;
delete parser.yy.firstChainLocation;
}
$$[$0 - 2].push($$[$0].identifier);
parser.addUnknownLocation($$[$0].location, $$[$0 - 2].concat());
break;
case 1833:
case 1841:
if ($$[$0].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1834:
case 1842:
if ($$[$0].insideKey) {
parser.suggestKeyValues({ identifierChain: $$[$0 - 2].concat([$$[$0].identifier]) });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1837:
parser.suggestColumns({
identifierChain: $$[$0 - 2]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1838:
parser.suggestColumns({
identifierChain: $$[$0 - 4]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1839:
this.$ = [$$[$0].identifier];
break;
case 1840:
$$[$0 - 2].push($$[$0].identifier);
break;
case 1843:
if ($$[$0 - 2].insideKey) {
parser.suggestKeyValues({ identifierChain: $$[$0 - 4].concat([$$[$0 - 2].identifier]) });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1844:
if ($$[$0 - 2].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0 - 2].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1846:
parser.suggestColumns({ identifierChain: $$[$0 - 2] });
break;
case 1847:
parser.suggestColumns({ identifierChain: $$[$0 - 4] });
break;
case 1849:
this.$ = { identifier: { name: $$[$0] }, location: _$[$0] };
break;
case 1850:
this.$ = { identifier: { name: $$[$0 - 3], keySet: true }, location: _$[$0 - 3] };
break;
case 1851:
this.$ = { identifier: { name: $$[$0 - 2], keySet: true }, location: _$[$0 - 2] };
break;
case 1852:
this.$ = { identifier: { name: $$[$0 - 3] }, insideKey: true };
break;
case 1853:
this.$ = { identifier: { name: $$[$0 - 3] } };
break;
case 1879:
parser.addTablePrimary($$[$0 - 2]);
parser.addColumnLocation(_$[$0 - 1], $$[$0 - 1]);
break;
case 1881:
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 1885:
if (!$$[$0 - 4]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
break;
case 1886:
if (!$$[$0 - 3]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
break;
case 1887:
parser.addTablePrimary($$[$0 - 2]);
parser.suggestColumns();
if (!$$[$0]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 1888:
if (!$$[$0]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 1891:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['DATABASE', 'EXTENDED', 'FORMATTED', 'FUNCTION', 'SCHEMA']);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1892:
case 1894:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['EXTENDED']);
}
break;
case 1893:
case 1895:
if (!$$[$0 - 2]) {
parser.suggestKeywords(['EXTENDED']);
}
break;
case 1898:
case 2246:
this.$ = $$[$0 - 2];
break;
case 1901:
parser.addCommonTableExpressions($$[$0 - 3]);
break;
case 1902:
case 1903:
case 1925:
parser.addCommonTableExpressions($$[$0 - 2]);
break;
case 1917:
parser.suggestKeywords(['ALL', 'DISTINCT', 'SELECT']);
break;
case 1918:
parser.suggestKeywords(['ALL', 'DISTINCT']);
break;
case 1923:
this.$ = $$[$0 - 2].concat([$$[$0]]);
break;
case 1927:
parser.addCommonTableExpressions($$[$0 - 4]);
break;
case 1928:
parser.addCteAliasLocation(_$[$0 - 4], $$[$0 - 4]);
$$[$0 - 1].alias = $$[$0 - 4];
this.$ = $$[$0 - 1];
break;
case 1935:
case 1936:
parser.addClauseLocation('whereClause', _$[$0 - 1], $$[$0].whereClauseLocation);
parser.addClauseLocation('limitClause', $$[$0].limitClausePreceding || _$[$0 - 1], $$[$0].limitClauseLocation);
break;
case 1937:
var keywords = [];
parser.addClauseLocation('whereClause', _$[$0 - 3], $$[$0 - 1].whereClauseLocation);
parser.addClauseLocation('limitClause', $$[$0 - 2].limitClausePreceding || _$[$0 - 3], $$[$0 - 2].limitClauseLocation);
if ($$[$0 - 3]) {
if (!$$[$0 - 3].hasLateralViews && typeof $$[$0 - 3].tableReferenceList.hasJoinCondition !== 'undefined' && !$$[$0 - 3].tableReferenceList.hasJoinCondition) {
keywords.push({ value: 'ON', weight: 3 });
}
if ($$[$0 - 3].suggestKeywords) {
keywords = parser.createWeightedKeywords($$[$0 - 3].suggestKeywords, 3);
}
if ($$[$0 - 3].tableReferenceList.suggestJoinConditions) {
parser.suggestJoinConditions($$[$0 - 3].tableReferenceList.suggestJoinConditions);
}
if ($$[$0 - 3].tableReferenceList.suggestJoins) {
parser.suggestJoins($$[$0 - 3].tableReferenceList.suggestJoins);
}
if (!$$[$0 - 3].hasLateralViews && $$[$0 - 3].tableReferenceList.suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 3].tableReferenceList.suggestKeywords, 3));
}
// Lower the weights for 'TABLESAMPLE' and 'LATERAL VIEW'
keywords.forEach(function (keyword) {
if (keyword.value === 'TABLESAMPLE' || keyword.value === 'LATERAL VIEW') {
keyword.weight = 1.1;
}
});
if (!$$[$0 - 3].hasLateralViews && $$[$0 - 3].tableReferenceList.types) {
var veKeywords = parser.getValueExpressionKeywords($$[$0 - 3].tableReferenceList);
keywords = keywords.concat(veKeywords.suggestKeywords);
if (veKeywords.suggestColRefKeywords) {
parser.suggestColRefKeywords(veKeywords.suggestColRefKeywords);
parser.addColRefIfExists($$[$0 - 3].tableReferenceList);
}
}
}
if ($$[$0 - 1].empty && $$[$0] && $$[$0].joinType.toUpperCase() === 'JOIN') {
keywords = keywords.concat(['CROSS', 'FULL', 'FULL OUTER', 'INNER', 'LEFT', 'LEFT OUTER', 'LEFT SEMI', 'RIGHT', 'RIGHT OUTER']);
parser.suggestKeywords(keywords);
return;
}
if ($$[$0 - 1].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2));
}
if ($$[$0 - 1].suggestFilters) {
parser.suggestFilters($$[$0 - 1].suggestFilters);
}
if ($$[$0 - 1].suggestGroupBys) {
parser.suggestGroupBys($$[$0 - 1].suggestGroupBys);
}
if ($$[$0 - 1].suggestOrderBys) {
parser.suggestOrderBys($$[$0 - 1].suggestOrderBys);
}
if ($$[$0 - 1].empty) {
keywords.push({ value: 'UNION', weight: 2.11 });
}
keywords = keywords.concat([
{ value: 'CROSS JOIN', weight: 1 },
{ value: 'FULL JOIN', weight: 1 },
{ value: 'FULL OUTER JOIN', weight: 1 },
{ value: 'INNER JOIN', weight: 1 },
{ value: 'JOIN', weight: 1 },
{ value: 'LEFT JOIN', weight: 1 },
{ value: 'LEFT OUTER JOIN', weight: 1 },
{ value: 'LEFT SEMI JOIN', weight: 1 },
{ value: 'RIGHT JOIN', weight: 1 },
{ value: 'RIGHT OUTER JOIN', weight: 1 }
]);
parser.suggestKeywords(keywords);
break;
case 1938:
// A couple of things are going on here:
// - If there are no SelectConditions (WHERE, GROUP BY, etc.) we should suggest complete join options
// - If there's an OptionalJoin at the end, i.e. 'SELECT * FROM foo | JOIN ...' we should suggest
// different join types
// - The FromClause could end with a valueExpression, in which case we should suggest keywords like '='
// or 'AND' based on type
if (!$$[$0 - 1]) {
parser.addClauseLocation('whereClause', _$[$0 - 2]);
parser.addClauseLocation('limitClause', _$[$0 - 2]);
return;
}
parser.addClauseLocation('whereClause', _$[$0 - 2], $$[$0 - 1].whereClauseLocation);
parser.addClauseLocation('limitClause', $$[$0 - 1].limitClausePreceding || _$[$0 - 2], $$[$0 - 1].limitClauseLocation);
var keywords = [];
if ($$[$0 - 1].suggestColRefKeywords) {
parser.suggestColRefKeywords($$[$0 - 1].suggestColRefKeywords);
parser.addColRefIfExists($$[$0 - 1]);
}
if ($$[$0 - 1].suggestKeywords && $$[$0 - 1].suggestKeywords.length) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2));
}
if ($$[$0 - 1].cursorAtEnd) {
keywords.push({ value: 'UNION', weight: 2.11 });
}
parser.suggestKeywords(keywords);
break;
case 1942:
this.$ = { tableReferenceList: $$[$0 - 1], suggestKeywords: ['LATERAL VIEW'] };
if ($$[$0]) {
parser.yy.lateralViews = $$[$0].lateralViews;
this.$.hasLateralViews = true;
if ($$[$0].suggestKeywords) {
this.$.suggestKeywords = this.$.suggestKeywords.concat($$[$0].suggestKeywords);
}
}
break;
case 1943:
case 2253:
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1944:
if ($$[$0]) {
parser.yy.lateralViews = $$[$0].lateralViews;
}
break;
case 1946:
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 6], $$[$0 - 5], $$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 1], $$[$0]], [{ value: 'WHERE', weight: 9 }, { value: 'GROUP BY', weight: 8 }, { value: 'HAVING', weight: 7 }, { value: 'WINDOW', weight: 6 }, { value: 'ORDER BY', weight: 5 }, [{ value: 'CLUSTER BY', weight: 4 }, { value: 'DISTRIBUTE BY', weight: 4 }], { value: 'SORT BY', weight: 4 }, { value: 'LIMIT', weight: 3 }], [true, true, true, true, true, true, !$$[$0 - 2], true]);
if (keywords.length > 0) {
this.$ = { suggestKeywords: keywords, empty: !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0] };
}
else {
this.$ = {};
}
this.$.whereClauseLocation = $$[$0 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5], $$[$0 - 6], _$[$0 - 6]);
this.$.limitClauseLocation = $$[$0] ? _$[$0] : undefined;
if (!$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$.suggestFilters = { prefix: 'WHERE', tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$.suggestGroupBys = { prefix: 'GROUP BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
if (!$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$.suggestOrderBys = { prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
break;
case 1950:
if ($$[$0].suggestFilters) {
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1951:
parser.suggestFunctions();
parser.suggestColumns();
parser.suggestKeywords(['EXISTS', 'NOT EXISTS']);
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1954:
this.$ = { valueExpression: $$[$0] ? false : $$[$0 - 1] };
if (!$$[$0]) {
this.$.suggestKeywords = ['GROUPING SETS', 'WITH CUBE', 'WITH ROLLUP'];
}
break;
case 1955:
case 2004:
case 2029:
case 2033:
case 2036:
parser.suggestSelectListAliases();
break;
case 1956:
parser.valueExpressionSuggest();
parser.suggestSelectListAliases();
parser.suggestGroupBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1957:
parser.suggestKeywords(['BY']);
parser.suggestGroupBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1964:
parser.suggestKeywords(['CUBE', 'ROLLUP']);
break;
case 1966:
parser.suggestKeywords(['SETS']);
break;
case 1994:
if ($$[$0].emptyOrderBy) {
parser.suggestOrderBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1995:
parser.suggestKeywords(['BY']);
parser.suggestOrderBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1999:
this.$ = { emptyOrderBy: false };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 2000:
case 2001:
case 2002:
this.$ = { emptyOrderBy: false };
break;
case 2003:
if ($$[$0 - 1].suggestKeywords && $$[$0].suggestKeywords) {
this.$ = parser.mergeSuggestKeywords($$[$0 - 1], $$[$0]);
}
else {
this.$ = parser.mergeSuggestKeywords($$[$0]);
}
break;
case 2005:
this.$ = { emptyOrderBy: true };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 2007:
this.$ = { suggestKeywords: ['ASC', 'DESC'] };
;
break;
case 2010:
this.$ = { suggestKeywords: ['NULLS FIRST', 'NULLS LAST'] };
break;
case 2014:
parser.suggestKeywords(['FIRST', 'LAST']);
break;
case 2018:
this.$ = { suggestKeywords: ['SORT BY'] };
break;
case 2027:
case 2031:
case 2035:
suggestKeywords: ['BY'];
break;
case 2028:
case 2032:
parser.suggestColumns();
parser.suggestSelectListAliases();
break;
case 2043:
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
this.$ = $$[$0];
break;
case 2056:
case 2057:
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 2059:
// verifyType($$[$0], 'NUMBER');
this.$ = $$[$0];
$$[$0].types = ['NUMBER'];
break;
case 2060:
case 2061:
case 2062:
case 2063:
case 2070:
case 2071:
case 2072:
case 2073:
case 2074:
case 2075:
case 2081:
case 2082:
case 2103:
case 2161:
case 2162:
case 2220:
this.$ = { types: ['BOOLEAN'] };
break;
case 2064:
this.$ = { types: ['BOOLEAN'] };
// clear correlated flag after completed sub-query (set by lexer)
parser.yy.correlatedSubQuery = false;
break;
case 2066:
case 2067:
case 2068:
case 2069:
parser.addColRefToVariableIfExists($$[$0 - 2], $$[$0]);
this.$ = { types: ['BOOLEAN'] };
break;
case 2076:
case 2077:
// verifyType($$[$0-2], 'BOOLEAN');
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 2078:
case 2079:
case 2080:
// verifyType($$[$0-2], 'NUMBER');
// verifyType($$[$0], 'NUMBER');
this.$ = { types: ['NUMBER'] };
break;
case 2086:
parser.suggestKeywords(['BETWEEN', 'EXISTS', 'IN', 'LIKE', 'REGEXP', 'RLIKE']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2087:
case 2089:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2088:
parser.suggestFunctions();
parser.suggestColumns();
parser.suggestKeywords(['EXISTS']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2090:
parser.suggestFunctions({ types: ['BOOLEAN'] });
parser.suggestColumns({ types: ['BOOLEAN'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 2091:
this.$ = { types: ['T'], suggestFilters: $$[$0].suggestFilters };
break;
case 2092:
parser.suggestFunctions();
parser.suggestColumns();
this.$ = { types: ['T'] };
break;
case 2093:
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions('NUMBER');
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
break;
case 2094:
parser.suggestFunctions({ types: ['NUMBER'] });
parser.suggestColumns({ types: ['NUMBER'] });
this.$ = { types: ['NUMBER'] };
break;
case 2095:
parser.suggestKeywords(['FALSE', 'NOT NULL', 'NOT TRUE', 'NOT FALSE', 'NULL', 'TRUE']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2096:
parser.suggestKeywords(['FALSE', 'NULL', 'TRUE']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2097:
this.$ = { types: ['BOOLEAN'] };
break;
case 2098:
case 2099:
case 2100:
parser.suggestKeywords(['NOT']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2101:
parser.valueExpressionSuggest($$[$0 - 5], $$[$0 - 3] ? 'IS NOT DISTINCT FROM' : 'IS DISTINCT FROM');
this.$ = { types: ['BOOLEAN'] };
break;
case 2102:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2104:
this.$ = $$[$0 - 1];
break;
case 2105:
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 2106:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2107:
case 2108:
case 2109:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2110:
case 2111:
case 2112:
case 2113:
if (!$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions($$[$0].types);
parser.addColRefIfExists($$[$0]);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2114:
case 2116:
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2115:
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: true };
break;
case 2117:
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: $$[$0 - 1] === '<=' };
break;
case 2118:
case 2119:
case 2120:
case 2121:
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 2].types);
parser.addColRefIfExists($$[$0 - 2]);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2122:
if ($$[$0].inValueEdit) {
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 3].types);
}
if ($$[$0].cursorAtStart) {
parser.suggestKeywords(['SELECT']);
}
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2123:
if ($$[$0].inValueEdit) {
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
}
if ($$[$0].cursorAtStart) {
parser.suggestKeywords(['SELECT']);
}
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2124:
case 2125:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
break;
case 2126:
case 2127:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
break;
case 2128:
if ($$[$0 - 2].types[0] === $$[$0].types[0] && !$$[$0 - 5].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 2].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
break;
case 2129:
if ($$[$0 - 5].types[0] === $$[$0].types[0] && !$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 5].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2130:
if ($$[$0 - 5].types[0] === $$[$0 - 2].types[0] && !$$[$0].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 5].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2131:
parser.valueExpressionSuggest($$[$0 - 5], $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2132:
case 2138:
parser.suggestValueExpressionKeywords($$[$0 - 1], ['AND']);
this.$ = { types: ['BOOLEAN'] };
break;
case 2133:
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2134:
if ($$[$0 - 4].types[0] === $$[$0 - 2].types[0] && !$$[$0 - 4].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 4].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
break;
case 2135:
if ($$[$0 - 4].types[0] === $$[$0 - 2].types[0] && !$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 4].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2136:
if ($$[$0 - 4].types[0] === $$[$0 - 2].types[0] && !$$[$0].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 4].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2137:
parser.valueExpressionSuggest($$[$0 - 4], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 4].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2139:
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2140:
case 2142:
case 2144:
case 2146:
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true, suggestFilters: true };
break;
case 2141:
case 2145:
parser.addColRefIfExists($$[$0]);
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2143:
case 2147:
parser.addColRefIfExists($$[$0 - 2]);
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 2148:
case 2149:
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 2150:
case 2151:
case 2152:
if (!$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions(['NUMBER']);
parser.addColRefIfExists($$[$0]);
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2153:
case 2154:
case 2155:
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 2156:
case 2157:
case 2158:
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions(['NUMBER']);
parser.addColRefIfExists($$[$0 - 2]);
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
break;
case 2159:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 2160:
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2163:
parser.valueExpressionSuggest(undefined, $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2164:
parser.valueExpressionSuggest(undefined, $$[$0 - 1] + ' ' + $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 2166:
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 2168:
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 2169:
this.$ = $$[$0];
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
break;
case 2170:
this.$ = { types: ['T'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 2171:
case 2460:
case 2465:
case 2466:
this.$ = { types: ['T'] };
break;
case 2172:
case 2174:
$$[$0].position = 1;
break;
case 2173:
$$[$0].position = $$[$0 - 2].position + 1;
this.$ = $$[$0];
break;
case 2175:
$$[$0 - 2].position += 1;
break;
case 2176:
$$[$0 - 2].position = 1;
break;
case 2177:
$$[$0 - 4].position += 1;
break;
case 2178:
parser.valueExpressionSuggest();
$$[$0 - 2].position += 1;
break;
case 2179:
parser.valueExpressionSuggest();
$$[$0 - 4].position += 1;
break;
case 2180:
parser.suggestValueExpressionKeywords($$[$0 - 3]);
break;
case 2181:
case 2182:
parser.valueExpressionSuggest();
this.$ = { cursorAtStart: true, position: 1 };
break;
case 2183:
case 2184:
parser.valueExpressionSuggest();
this.$ = { position: 2 };
break;
case 2188:
this.$ = { types: ['COLREF'], columnReference: $$[$0].chain };
break;
case 2189:
// We need to handle arbitrary UDFs here instead of inside UserDefinedFunction or there will be a conflict
// with columnReference for functions like: db.udf(foo)
var fn = $$[$0 - 1].chain[$$[$0 - 1].chain.length - 1].name.toLowerCase();
$$[$0 - 1].lastLoc.type = 'function';
$$[$0 - 1].lastLoc.function = fn;
$$[$0 - 1].lastLoc.location = {
first_line: $$[$0 - 1].lastLoc.location.first_line,
last_line: $$[$0 - 1].lastLoc.location.last_line,
first_column: $$[$0 - 1].lastLoc.location.first_column,
last_column: $$[$0 - 1].lastLoc.location.last_column - 1
};
if ($$[$0 - 1].lastLoc !== $$[$0 - 1].firstLoc) {
$$[$0 - 1].firstLoc.type = 'database';
}
else {
delete $$[$0 - 1].lastLoc.identifierChain;
}
if ($$[$0].expression) {
this.$ = { function: fn, expression: $$[$0].expression, types: parser.findReturnTypes(fn) };
}
else {
this.$ = { function: fn, types: parser.findReturnTypes(fn) };
}
break;
case 2190:
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
if ($$[$0].expression) {
this.$ = { function: $$[$0 - 1], expression: $$[$0].expression, types: parser.findReturnTypes($$[$0 - 1]) };
}
else {
this.$ = { function: $$[$0 - 1], types: parser.findReturnTypes($$[$0 - 1]) };
}
break;
case 2192:
this.$ = { types: ['NULL'] };
break;
case 2194:
if ($$[$0].suggestKeywords) {
this.$ = { types: ['COLREF'], columnReference: $$[$0], suggestKeywords: $$[$0].suggestKeywords };
}
else {
this.$ = { types: ['COLREF'], columnReference: $$[$0] };
}
break;
case 2195:
var fn = $$[$0 - 1].chain[$$[$0 - 1].chain.length - 1].name.toLowerCase();
$$[$0 - 1].lastLoc.type = 'function';
$$[$0 - 1].lastLoc.function = fn;
$$[$0 - 1].lastLoc.location = {
first_line: $$[$0 - 1].lastLoc.location.first_line,
last_line: $$[$0 - 1].lastLoc.location.last_line,
first_column: $$[$0 - 1].lastLoc.location.first_column,
last_column: $$[$0 - 1].lastLoc.location.last_column - 1
};
if ($$[$0 - 1].lastLoc !== $$[$0 - 1].firstLoc) {
$$[$0 - 1].firstLoc.type = 'database';
}
else {
delete $$[$0 - 1].lastLoc.identifierChain;
}
if ($$[$0].position) {
parser.applyArgumentTypesToSuggestions(fn, $$[$0].position);
}
this.$ = { types: parser.findReturnTypes(fn) };
break;
case 2196:
case 2371:
case 2372:
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
if ($$[$0].position) {
parser.applyArgumentTypesToSuggestions($$[$0 - 1], $$[$0].position);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 1]) };
break;
case 2198:
var lastLoc = parser.yy.locations[parser.yy.locations.length - 1];
if (lastLoc.type !== 'variable') {
lastLoc.type = 'column';
}
// used for function references with db prefix
var firstLoc = parser.yy.locations[parser.yy.locations.length - $$[$0].length];
this.$ = { chain: $$[$0], firstLoc: firstLoc, lastLoc: lastLoc };
break;
case 2205:
parser.suggestValues($$[$0]);
break;
case 2206:
this.$ = { types: ['NUMBER'] };
break;
case 2212:
case 2214:
this.$ = $$[$0 - 1] + $$[$0];
break;
case 2213:
this.$ = $$[$0 - 2] + $$[$0 - 1] + $$[$0];
break;
case 2218:
case 2219:
if (/\$\{[^}]*\}/.test($$[$0])) {
parser.addVariableLocation(_$[$0], $$[$0]);
this.$ = { types: ['STRING'], columnReference: [{ name: $$[$0] }] };
}
else {
this.$ = { types: ['STRING'] };
}
break;
case 2221:
this.$ = { partialQuote: '\'', missingEndQuote: parser.yy.missingEndQuote };
break;
case 2222:
this.$ = { partialQuote: '"', missingEndQuote: parser.yy.missingEndQuote };
break;
case 2227:
if ($$[$0]) {
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
this.$ = { valueExpression: $$[$0 - 1], alias: $$[$0].alias };
if (!parser.yy.selectListAliases) {
parser.yy.selectListAliases = [];
}
parser.yy.selectListAliases.push({ name: $$[$0].alias, types: $$[$0 - 1].types || ['T'] });
}
else {
this.$ = { valueExpression: $$[$0 - 1] };
}
break;
case 2228:
parser.addAsteriskLocation(_$[$0], [{ asterisk: true }]);
this.$ = { asterisk: true };
break;
case 2229:
if ($$[$0]) {
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
}
break;
case 2230:
parser.suggestFunctions();
parser.suggestColumns();
parser.addColumnAliasLocation(_$[$0], $$[$0], _$[$0 - 2]);
this.$ = { suggestAggregateFunctions: true };
break;
case 2232:
case 2532:
this.$ = [$$[$0]];
break;
case 2233:
$$[$0 - 2].push($$[$0]);
break;
case 2238:
parser.checkForSelectListKeywords($$[$0 - 2]);
break;
case 2239:
parser.checkForSelectListKeywords($$[$0 - 3]);
break;
case 2240:
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestTables: true, suggestDatabases: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 2242:
case 2243:
case 2245:
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true, };
break;
case 2256:
this.$ = $$[$0];
if (parser.yy.latestTablePrimaries.length > 0) {
var idx = parser.yy.latestTablePrimaries.length - 1;
var tables = [];
do {
var tablePrimary = parser.yy.latestTablePrimaries[idx];
if (!tablePrimary.subQueryAlias) {
tables.unshift(tablePrimary.alias ? { identifierChain: tablePrimary.identifierChain, alias: tablePrimary.alias } : { identifierChain: tablePrimary.identifierChain });
}
idx--;
} while (idx >= 0 && tablePrimary.join && !tablePrimary.subQueryAlias);
if (tables.length > 0) {
this.$.suggestJoins = {
prependJoin: true,
tables: tables
};
}
}
break;
case 2263:
if ($$[$0] && $$[$0].valueExpression) {
this.$ = $$[$0].valueExpression;
}
else {
this.$ = {};
}
this.$.joinType = $$[$0 - 2];
if ($$[$0].noJoinCondition) {
this.$.suggestJoinConditions = { prependOn: true, tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
if ($$[$0].suggestKeywords) {
this.$.suggestKeywords = $$[$0].suggestKeywords;
}
if (parser.yy.latestTablePrimaries.length > 0) {
parser.yy.latestTablePrimaries[parser.yy.latestTablePrimaries.length - 1].join = true;
}
break;
case 2264:
if ($$[$0] && $$[$0].valueExpression) {
this.$ = $$[$0].valueExpression;
}
else {
this.$ = {};
}
this.$.joinType = $$[$0 - 3];
if ($$[$0].noJoinCondition) {
this.$.suggestJoinConditions = { prependOn: true, tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
if ($$[$0].suggestKeywords) {
this.$.suggestKeywords = $$[$0].suggestKeywords;
}
if (parser.yy.latestTablePrimaries.length > 0) {
parser.yy.latestTablePrimaries[parser.yy.latestTablePrimaries.length - 1].join = true;
}
break;
case 2265:
this.$ = { joinType: $$[$0] };
break;
case 2266:
this.$ = { joinType: $$[$0 - 1] };
break;
case 2267:
if ($$[$0 - 2].suggestKeywords) {
parser.suggestKeywords($$[$0 - 2].suggestKeywords);
}
break;
case 2268:
if ($$[$0].suggestKeywords) {
parser.suggestKeywords($$[$0].suggestKeywords);
}
break;
case 2271:
if (parser.yy.latestTablePrimaries.length > 0) {
var idx = parser.yy.latestTablePrimaries.length - 1;
var tables = [];
do {
var tablePrimary = parser.yy.latestTablePrimaries[idx];
if (!tablePrimary.subQueryAlias) {
tables.unshift(tablePrimary.alias ? { identifierChain: tablePrimary.identifierChain, alias: tablePrimary.alias } : { identifierChain: tablePrimary.identifierChain });
}
idx--;
} while (idx >= 0 && tablePrimary.join && !tablePrimary.subQueryAlias);
if (tables.length > 0) {
parser.suggestJoins({
prependJoin: false,
joinType: $$[$0 - 2],
tables: tables
});
}
}
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
break;
case 2276:
this.$ = 'CROSS JOIN';
break;
case 2277:
this.$ = 'FULL JOIN';
break;
case 2278:
this.$ = 'FULL OUTER JOIN';
break;
case 2279:
this.$ = 'INNER JOIN';
break;
case 2280:
this.$ = 'JOIN';
break;
case 2281:
this.$ = 'LEFT INNER JOIN';
break;
case 2282:
this.$ = 'LEFT JOIN';
break;
case 2283:
this.$ = 'LEFT OUTER JOIN';
break;
case 2284:
this.$ = 'LEFT SEMI JOIN';
break;
case 2285:
this.$ = 'OUTER JOIN';
break;
case 2286:
case 2288:
this.$ = 'RIGHT OUTER JOIN';
break;
case 2287:
this.$ = 'RIGHT JOIN';
break;
case 2289:
this.$ = 'RIGHT SEMI JOIN';
break;
case 2290:
this.$ = 'SEMI JOIN';
break;
case 2291:
this.$ = { noJoinCondition: true, suggestKeywords: ['ON'] };
break;
case 2292:
this.$ = { valueExpression: $$[$0] };
break;
case 2296:
parser.valueExpressionSuggest();
parser.suggestJoinConditions({ prependOn: false });
break;
case 2297:
this.$ = {
primary: $$[$0 - 2]
};
if ($$[$0 - 2].identifierChain) {
if ($$[$0]) {
$$[$0 - 2].alias = $$[$0].alias;
parser.addTableAliasLocation($$[$0].location, $$[$0].alias, $$[$0 - 2].identifierChain);
}
parser.addTablePrimary($$[$0 - 2]);
}
var keywords = [];
// Right-to-left for cursor after TablePrimary
keywords = parser.getKeywordsForOptionalsLR([$$[$0], $$[$0 - 1]], [{ value: 'AS', weight: 2 }, { value: 'TABLESAMPLE', weight: 3 }], [true, true]);
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 2298:
this.$ = {
primary: $$[$0 - 1]
};
if ($$[$0]) {
this.$.primary.alias = $$[$0].alias;
parser.addTablePrimary({ subQueryAlias: $$[$0].alias });
parser.addSubqueryAliasLocation($$[$0].location, $$[$0].alias, $$[$0 - 1].identifierChain);
}
var keywords = [];
keywords = parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'AS', weight: 2 }], [true]);
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 2299:
if ($$[$0]) {
parser.addTableAliasLocation($$[$0].location, $$[$0].alias, $$[$0 - 2].identifierChain);
}
break;
case 2300:
if ($$[$0]) {
$$[$0 - 2].alias = $$[$0].alias;
parser.addTableAliasLocation($$[$0].location, $$[$0].alias, $$[$0 - 2].identifierChain);
}
parser.addTablePrimary($$[$0 - 2]);
break;
case 2301:
if ($$[$0]) {
parser.addTablePrimary({ subQueryAlias: $$[$0].alias });
parser.addSubqueryAliasLocation($$[$0].location, $$[$0].alias);
}
break;
case 2312:
parser.suggestKeywords(['BUCKET']);
break;
case 2313:
parser.suggestKeywords(['OUT OF']);
break;
case 2314:
parser.suggestKeywords(['OF']);
break;
case 2315:
if (!$$[$0 - 2]) {
parser.suggestKeywords(['ON']);
}
break;
case 2317:
if ($$[$0 - 2].indexOf('.') === -1) {
parser.suggestKeywords(['PERCENT', 'ROWS']);
}
else {
parser.suggestKeywords(['PERCENT']);
}
break;
case 2322:
parser.pushQueryState();
break;
case 2323:
parser.popQueryState();
break;
case 2325:
if ($$[$0 - 1]) {
$$[$0 - 2].alias = $$[$0 - 1].alias;
parser.addTablePrimary({ subQueryAlias: $$[$0 - 1].alias });
parser.addSubqueryAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
this.$ = $$[$0 - 2];
break;
case 2328:
var subQuery = parser.getSubQuery($$[$0]);
subQuery.columns.forEach(function (column) {
parser.expandIdentifierChain({ wrapper: column });
delete column.linked;
});
parser.popQueryState(subQuery);
this.$ = subQuery;
break;
case 2345:
case 2346:
case 2347:
case 2348:
this.$ = { alias: $$[$0], location: _$[$0] };
break;
case 2355:
if ($$[$0 - 1] && $$[$0].lateralView) {
$$[$0 - 1].lateralViews.push($$[$0].lateralView);
this.$ = $$[$0 - 1];
}
else if ($$[$0].lateralView) {
this.$ = { lateralViews: [$$[$0].lateralView] };
}
if ($$[$0].suggestKeywords) {
this.$.suggestKeywords = $$[$0].suggestKeywords;
}
break;
case 2357:
if (!$$[$0]) {
$$[$0 - 1].suggestKeywords = ['OVER'];
}
break;
case 2365:
parser.suggestKeywords(['OVER']);
break;
case 2369:
case 2370:
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
if ($$[$0].expression) {
this.$ = { function: $$[$0 - 1], expression: $$[$0].expression, types: parser.findReturnTypes($$[$0 - 1]) };
}
else {
this.$ = { function: $$[$0 - 1], types: parser.findReturnTypes($$[$0 - 1]) };
}
break;
case 2379:
this.$ = { expression: $$[$0 - 1] };
break;
case 2380:
parser.valueExpressionSuggest();
this.$ = { position: 1 };
break;
case 2381:
parser.suggestValueExpressionKeywords($$[$0 - 1]);
break;
case 2389:
case 2472:
case 2518:
this.$ = { types: parser.findReturnTypes($$[$0 - 2]) };
break;
case 2390:
this.$ = { function: $$[$0 - 3], expression: $$[$0 - 2], types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2391:
parser.valueExpressionSuggest();
parser.applyArgumentTypesToSuggestions($$[$0 - 3], 1);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2392:
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2393:
parser.applyArgumentTypesToSuggestions($$[$0 - 3], $$[$0 - 1].position);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2401:
case 2402:
if (parser.yy.result.suggestFunctions) {
parser.suggestAggregateFunctions();
}
break;
case 2403:
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'PARTITION BY', weight: 2 }, { value: 'ORDER BY', weight: 1 }]);
}
else if (!$$[$0 - 2]) {
parser.suggestKeywords(['PARTITION BY']);
}
break;
case 2404:
if (!$$[$0 - 1]) {
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'ORDER BY', weight: 2 }]);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 3]);
}
break;
case 2413:
// Only allowed in last order by
delete parser.yy.result.suggestAnalyticFunctions;
break;
case 2414:
var keywords = [];
if ($$[$0 - 2].suggestKeywords) {
keywords = parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 2);
}
if (!$$[$0]) {
keywords = keywords.concat([{ value: 'RANGE BETWEEN', weight: 1 }, { value: 'ROWS BETWEEN', weight: 1 }]);
}
parser.suggestKeywords(keywords);
break;
case 2420:
parser.suggestKeywords(['BETWEEN', 'UNBOUNDED']);
break;
case 2421:
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED PRECEDING']);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['AND']);
}
break;
case 2424:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PRECEDING']);
}
break;
case 2426:
lexer.popState();
break;
case 2427:
lexer.begin('hdfs');
break;
case 2429:
parser.suggestHdfs({ path: $$[$0 - 3] });
break;
case 2430:
parser.suggestHdfs({ path: $$[$0 - 2] });
break;
case 2431:
parser.suggestHdfs({ path: $$[$0 - 1] });
break;
case 2432:
parser.suggestHdfs({ path: '' });
break;
case 2433:
parser.suggestHdfs({ path: '' });
break;
case 2439:
parser.suggestKeywords(['PRECEDING']);
break;
case 2440:
case 2445:
parser.suggestKeywords(['ROW']);
break;
case 2444:
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED FOLLOWING']);
break;
case 2446:
parser.suggestKeywords(['FOLLOWING']);
break;
case 2452:
parser.valueExpressionSuggest();
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2453:
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2459:
case 2464:
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2461:
parser.valueExpressionSuggest();
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2462:
case 2463:
parser.valueExpressionSuggest();
this.$ = { types: ['T'] };
break;
case 2467:
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'AS', weight: 2 }]);
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2468:
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'AS', weight: 2 }]);
this.$ = { types: ['T'] };
break;
case 2469:
case 2470:
parser.suggestKeywords(parser.getTypeKeywords());
this.$ = { types: ['T'] };
break;
case 2471:
case 2493:
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2473:
case 2494:
case 2517:
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2474:
parser.valueExpressionSuggest();
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
}
parser.suggestKeywords(keywords);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2475:
case 2496:
case 2520:
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2476:
if ($$[$0 - 1].cursorAtStart) {
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
}
parser.suggestKeywords(keywords);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2477:
case 2481:
this.$ = { types: ['INT', 'INTEGER'] };
break;
case 2478:
parser.suggestKeywords(['DAY', 'DAYOFWEEK', 'HOUR', 'MINUTE', 'MONTH', 'QUARTER', 'SECOND', 'WEEK', 'YEAR']);
this.$ = { types: ['INT', 'INTEGER'] };
break;
case 2479:
case 2483:
parser.suggestKeywords(['FROM']);
this.$ = { types: ['INT', 'INTEGER'] };
break;
case 2480:
parser.valueExpressionSuggest();
this.$ = { types: ['INT', 'INTEGER'] };
break;
case 2482:
parser.suggestKeywords(['DAY', 'DAYOFWEEK', 'HOUR', 'MINUTE', 'MONTH', 'QUARTER', 'SECOND', 'WEEK', 'YEAR']);
this.$ = { types: ['INT', 'INTEGER'] };
break;
case 2495:
parser.valueExpressionSuggest();
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
if ($$[$0 - 4].toLowerCase() === 'group_concat') {
keywords.push('ALL');
}
else {
keywords.push('DISTINCT');
}
}
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
parser.suggestKeywords(keywords);
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2497:
if ($$[$0 - 1].cursorAtStart) {
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
if ($$[$0 - 4].toLowerCase() === 'group_concat') {
keywords.push('ALL');
}
else {
keywords.push('DISTINCT');
}
}
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
parser.suggestKeywords(keywords);
}
if (parser.yy.result.suggestFunctions && !parser.yy.result.suggestFunctions.types) {
parser.applyArgumentTypesToSuggestions($$[$0 - 4], $$[$0 - 1].position);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2519:
parser.valueExpressionSuggest();
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
}
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
parser.suggestKeywords(keywords);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2521:
if (parser.yy.result.suggestFunctions && !parser.yy.result.suggestFunctions.types) {
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2528:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'OUTER', weight: 2 }, { value: 'explode', weight: 1 }, { value: 'posexplode', weight: 1 }]);
}
else {
parser.suggestKeywords(['explode', 'posexplode']);
}
break;
case 2533:
this.$ = [$$[$0 - 2], $$[$0]];
break;
case 2548:
parser.suggestKeywords(['ALL', 'NONE']);
break;
case 2568:
parser.suggestKeywords(['COLUMNS', 'COMPACTIONS', 'CONF', 'CREATE TABLE', 'CURRENT ROLES', 'DATABASES', 'FORMATTED', 'FUNCTIONS', 'GRANT', 'INDEX', 'INDEXES', 'LOCKS', 'MATERIALIZED VIEWS', 'PARTITIONS', 'PRINCIPALS', 'ROLE GRANT', 'ROLES', 'SCHEMAS', 'TABLE EXTENDED', 'TABLES', 'TBLPROPERTIES', 'TRANSACTIONS', 'VIEWS']);
break;
case 2569:
// ROLES is considered a non-reserved keywords so we can't match it in ShowCurrentRolesStatement_EDIT
if ($$[$0].identifierChain && $$[$0].identifierChain.length === 1 && $$[$0].identifierChain[0].name.toLowerCase() === 'roles') {
parser.suggestKeywords(['CURRENT']);
parser.yy.locations.pop();
}
else {
parser.addTablePrimary($$[$0]);
}
break;
case 2570:
parser.suggestKeywords(['DATABASES', 'SCHEMAS', 'TABLE EXTENDED']);
break;
case 2587:
case 2588:
case 2592:
case 2593:
case 2634:
case 2635:
parser.suggestKeywords(['FROM', 'IN']);
break;
case 2589:
case 2590:
case 2591:
case 2618:
case 2632:
parser.suggestTables();
break;
case 2599:
case 2658:
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
break;
case 2600:
if (parser.yy.result.suggestTables && $$[$0 - 1].isView) {
parser.yy.result.suggestTables.onlyViews = true;
}
break;
case 2601:
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['TABLE']);
break;
case 2603:
this.$ = { isView: true };
break;
case 2605:
parser.suggestKeywords(['ROLES']);
break;
case 2607:
case 2680:
parser.suggestKeywords(['LIKE']);
break;
case 2616:
parser.suggestKeywords(['ALL', 'TABLE']);
parser.suggestTables();
break;
case 2637:
parser.suggestTables({ identifierChain: [{ name: $$[$0] }] });
break;
case 2639:
parser.suggestKeywords(['VIEWS']);
break;
case 2640:
case 2692:
if (!$$[$0 - 1] && !$$[$0 - 2]) {
parser.suggestKeywords([{ value: 'IN', weight: 2 }, { value: 'FROM', weight: 2 }, { value: 'LIKE', weight: 1 }]);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['LIKE']);
}
break;
case 2648:
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
parser.suggestKeywords(['DATABASE', 'SCHEMA']);
break;
case 2650:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['EXTENDED', 'PARTITION']);
break;
case 2653:
parser.addTablePrimary($$[$0 - 2]);
parser.suggestKeywords(['EXTENDED']);
break;
case 2660:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['PARTITION']);
break;
case 2663:
case 2664:
parser.suggestKeywords(['GRANT']);
break;
case 2665:
case 2666:
parser.suggestKeywords(['ROLE', 'USER']);
break;
case 2670:
case 2679:
parser.suggestKeywords(['EXTENDED']);
break;
case 2673:
if ($$[$0 - 1]) {
parser.suggestKeywords(['LIKE']);
}
else {
parser.suggestKeywords(['FROM', 'IN', 'LIKE']);
}
break;
case 2675:
parser.suggestKeywords(['EXTENDED']);
break;
case 2676:
parser.suggestKeywords(['LIKE']);
break;
case 2677:
parser.suggestKeywords(['PARTITION']);
break;
case 2685:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IN', 'LIKE']);
}
else {
parser.suggestKeywords(['LIKE']);
}
break;
case 2687:
parser.addTablePrimary($$[$0 - 3]);
break;
case 2696:
case 2697:
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 2708:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WHERE']);
}
break;
case 2709:
parser.suggestKeywords(['SET']);
break;
case 2725:
parser.suggestKeywords(['=']);
break;
case 2734:
if (!parser.yy.cursorFound) {
parser.yy.result.useDatabase = $$[$0];
}
break;
case 2737:
this.$ = { inValueEdit: true };
break;
case 2738:
this.$ = { inValueEdit: true, cursorAtStart: true };
break;
case 2739:
case 2740:
case 2741:
this.$ = { suggestKeywords: ['NOT'] };
break;
case 2745:
case 2746:
case 2747:
parser.suggestFunctions({ types: ['STRING'] });
parser.suggestColumns({ types: ['STRING'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 2748:
case 2750:
this.$ = parser.findCaseType($$[$0 - 1]);
break;
case 2749:
case 2752:
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2751:
parser.suggestValueExpressionKeywords($$[$0 - 1], ['END']);
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2753:
this.$ = parser.findCaseType($$[$0 - 2]);
break;
case 2754:
if ($$[$0].toLowerCase() !== 'end') {
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'END', weight: 3 }, { value: 'ELSE', weight: 2 }, { value: 'WHEN', weight: 1 }]);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'ELSE', weight: 2 }, { value: 'WHEN', weight: 1 }]);
}
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2755:
if ($$[$0].toLowerCase() !== 'end') {
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'END', weight: 3 }, { value: 'ELSE', weight: 2 }, { value: 'WHEN', weight: 1 }]);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'ELSE', weight: 2 }, { value: 'WHEN', weight: 1 }]);
}
this.$ = parser.findCaseType($$[$0 - 2]);
break;
case 2756:
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
break;
case 2757:
parser.valueExpressionSuggest();
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2758:
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 2759:
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = $$[$0 - 1];
break;
case 2760:
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'] };
break;
case 2763:
this.$ = { caseTypes: [$$[$0]], lastType: $$[$0] };
break;
case 2764:
$$[$0 - 1].caseTypes.push($$[$0]);
this.$ = { caseTypes: $$[$0 - 1].caseTypes, lastType: $$[$0] };
break;
case 2768:
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
break;
case 2771:
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0].suggestFilters };
break;
case 2772:
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 2773:
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2774:
case 2775:
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0].suggestFilters };
break;
case 2776:
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2777:
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [$$[$0]] };
break;
case 2778:
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2779:
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2780:
case 2782:
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2781:
parser.valueExpressionSuggest();
parser.suggestKeywords(['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2783:
parser.valueExpressionSuggest();
this.$ = { caseTypes: [$$[$0]], suggestFilters: true };
break;
case 2784:
parser.suggestValueExpressionKeywords($$[$0 - 1], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2785:
parser.suggestValueExpressionKeywords($$[$0 - 2], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2786:
case 2787:
case 2788:
case 2789:
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
}
},
2020-03-26 13:06:16 +08:00
table: [o($V0, $V1, { 691: 1, 545: 2 }), { 1: [3] }, o($V2, $V3, { 542: 3, 692: 4, 543: 6, 209: 7, 212: 8, 210: 249, 3: 250, 211: 251, 195: 252, 213: 253, 183: 254, 215: 255, 16: 256, 214: 257, 197: 258, 4: 261, 5: 262, 6: 263, 7: 264, 8: 265, 9: 266, 10: 267, 11: 268, 12: 269, 13: 270, 14: 271, 15: 272, 500: 273, 501: 274, 502: 275, 503: 276, 504: 277, 505: 278, 506: 279, 546: 280, 17: 284, 18: 285, 19: 286, 20: 287, 21: 288, 22: 289, 23: 290, 24: 291, 25: 292, 28: 293, 29: 294, 507: 295, 508: 296, 509: 297, 510: 298, 511: 299, 512: 300, 513: 301, 514: 302, 553: 303, 30: 304, 31: 305, 32: 306, 33: 307, 34: 308, 35: 309, 36: 310, 251: 312, 252: 313, 253: 314, 254: 315, 255: 316, 256: 317, 257: 318, 258: 319, 515: 320, 516: 321, 517: 322, 518: 323, 519: 324, 520: 325, 521: 326, 522: 327, 523: 328, 1015: 332, 1016: 333, 1017: 334, 1018: 335, 1019: 336, 1020: 337, 1021: 338, 1022: 339, 1023: 340, 1024: 341, 1025: 342, 1026: 343, 1027: 344, 1028: 345, 1029: 346, 1030: 347, 1031: 348, 1032: 349, 1033: 350, 627: 353, 628: 354, 652: 355, 37: 361, 38: 362, 39: 363, 40: 364, 41: 365, 42: 366, 43: 367, 259: 369, 260: 370, 261: 371, 262: 372, 263: 373, 264: 374, 265: 375, 524: 377, 525: 378, 526: 379, 527: 380, 528: 381, 529: 382, 530: 383, 531: 384, 1034: 387, 1035: 388, 1036: 389, 1037: 390, 1038: 391, 1039: 392, 1040: 393, 1041: 394, 1042: 395, 1043: 396, 1044: 397, 1045: 398, 1046: 399, 1047: 400, 632: 401, 634: 402, 654: 403, 65: 404, 194: 405, 456: 408, 98: 412, 196: 413, 458: 414, 2: $V4, 26: $V5, 27: $V6, 44: $V7, 47: $V8, 50: $V9, 54: $Va, 55: $Vb, 58: $Vc, 62: $Vd, 71: $Ve, 78: $Vf, 79: $Vg, 85: $Vh, 88: $Vi, 89: $Vj, 107: $Vk, 108: $Vl, 116: $Vm, 118: $Vn, 123: $Vo, 126: $Vp, 129: $Vq, 130: $Vr, 132: $Vs, 150: $Vt, 151: $Vu, 152: $Vv, 153: $Vw, 154: $Vx, 158: $Vy, 161: $Vz, 166: $VA, 198: $VB, 202: $VC, 205: $VD, 206: $VE, 208: $VF, 216: $VG, 217: $VH, 218: $VI, 219: $VJ, 227: $VK, 228: $VL, 229: $VM, 230: $VN, 231: $VO, 233: $VP, 235: $VQ, 238: $VR, 239: $VS, 240: $VT, 266: $VU, 277: $VV, 279: $VW, 280: $VX, 307: $VY, 317: $VZ, 318: $V_, 333: $V$, 347: $V01, 348: $V11, 349: $V21, 351: $V31, 352: $V41, 359: $V51, 371: $V61, 372: $V71, 373: $V81, 374: $V91, 376: $Va1, 381: $Vb1, 382: $Vc1, 384: $Vd1, 385: $Ve1, 386: $Vf1, 396: $Vg1, 397: $Vh1, 409: $Vi1, 410: $Vj1, 417: $Vk1, 418: $Vl1, 419: $Vm1, 420: $Vn1, 421: $Vo1, 422: $Vp1, 423: $Vq1, 424: $Vr1, 425: $Vs1, 428: $Vt1, 439: $Vu1, 440: $Vv1, 442: $Vw1, 443: $Vx1, 444: $Vy1, 445: $Vz1, 446: $VA1, 447: $VB1, 460: $VC1, 464: $VD1, 468: $VE1, 469: $VF1, 473: $VG1, 486: $VH1, 487: $VI1, 488: $VJ1, 491: $VK1, 532: $VL1, 533: $VM1, 534: $VN1, 535: $VO1, 538: $VP1, 539: $VQ1, 547: $VR1, 561: $VS1, 563: $VT1, 568: $VU1, 569: $VV1, 570: $VW1, 571: $VX1, 572: $VY1, 573: $VZ1, 574: $V_1, 575: $V$1, 596: $V02, 610: $V12, 615: $V22, 616: $V32, 617: $V42, 618: $V52, 619: $V62, 620: $V72, 621: $V82, 622: $V92, 623: $Va2, 626: $Vb2, 637: $Vc2, 639: $Vd2, 640: $Ve2, 656: $Vf2, 663: $Vg2, 665: $Vh2, 667: $Vi2, 673: $Vj2, 674: $Vk2, 676: $Vl2, 681: $Vm2, 686: $Vn2, 687: $Vo2, 688: $Vp2, 694: $Vq2, 696: $Vr2, 697: $Vs2, 698: $Vt2, 699: $Vu2, 700: $Vv2, 701: $Vw2, 702: $Vx2, 703: $Vy2, 704: $Vz2, 705: $VA2, 706: $VB2, 707: $VC2, 708: $VD2, 710: $VE2, 711: $VF2, 712: $VG2, 713: $VH2, 714: $VI2, 715: $VJ2, 716: $VK2, 717: $VL2, 718: $VM2, 719: $VN2, 720: $VO2, 721: $VP2, 722: $VQ2, 723: $VR2, 724: $VS2, 725: $VT2, 726: $VU2, 727: $VV2, 728: $VW2, 729: $VX2, 730: $VY2, 731: $VZ2, 732: $V_2, 733: $V$2, 734: $V03, 735: $V13, 736: $V23, 737: $V33, 738: $V43, 739: $V53, 740: $V63, 741: $V73, 742: $V83, 743: $V93, 744: $Va3, 745: $Vb3, 746: $Vc3, 747: $Vd3, 748: $Ve3, 749: $Vf3, 750: $Vg3, 751: $Vh3, 752: $Vi3, 753: $Vj3, 754: $Vk3, 755: $Vl3, 756: $Vm3, 757: $Vn3, 758: $Vo3, 759: $Vp3, 760: $Vq3, 761: $Vr3, 762: $Vs3, 763: $Vt3, 764: $Vu3, 765: $Vv3, 766: $Vw3, 767: $Vx3, 768: $Vy3, 769: $Vz3, 770: $VA3, 771: $VB3, 772: $VC3, 773: $VD3, 774: $VE3, 775: $VF3, 776: $VG3, 777: $VH3, 778: $VI3, 779: $VJ3, 780: $VK3, 781: $VL3, 782: $VM3, 783: $VN3, 784: $VO3, 785: $VP3, 786: $VQ3, 787: $VR3,
2020-03-26 11:47:47 +08:00
defaultActions: { 9: [2, 1446], 10: [2, 1447], 11: [2, 1448], 12: [2, 1449], 13: [2, 1450], 14: [2, 1451], 15: [2, 1452], 16: [2, 1453], 17: [2, 1454], 18: [2, 1455], 19: [2, 1456], 20: [2, 1457], 21: [2, 1458], 22: [2, 1459], 23: [2, 1460], 24: [2, 1461], 25: [2, 1462], 26: [2, 1463], 27: [2, 1464], 28: [2, 1465], 29: [2, 1466], 30: [2, 1467], 31: [2, 1468], 32: [2, 1469], 33: [2, 1470], 34: [2, 1471], 35: [2, 1472], 36: [2, 1473], 37: [2, 1474], 38: [2, 1475], 39: [2, 1476], 40: [2, 1477], 41: [2, 1478], 42: [2, 1479], 43: [2, 1480], 44: [2, 1481], 45: [2, 1482], 46: [2, 1483], 47: [2, 1484], 48: [2, 1485], 49: [2, 1486], 50: [2, 1487], 51: [2, 1488], 52: [2, 1489], 53: [2, 1490], 54: [2, 1491], 55: [2, 1492], 56: [2, 1493], 57: [2, 1494], 58: [2, 1495], 59: [2, 1496], 60: [2, 1497], 61: [2, 1498], 62: [2, 1499], 63: [2, 1500], 64: [2, 1501], 65: [2, 1502], 66: [2, 1503], 67: [2, 1504], 68: [2, 1505], 69: [2, 1506], 70: [2, 1507], 71: [2, 1508], 72: [2, 1509], 73: [2, 1510], 74: [2, 1511], 75: [2, 1512], 76: [2, 1513], 77: [2, 1514], 78: [2, 1515], 79: [2, 1516], 80: [2, 1517], 81: [2, 1518], 82: [2, 1519], 83: [2, 1520], 84: [2, 1521], 85: [2, 1522], 86: [2, 1523], 87: [2, 1524], 88: [2, 1525], 89: [2, 1526], 90: [2, 1527], 91: [2, 1528], 92: [2, 1529], 93: [2, 1530], 94: [2, 1531], 95: [2, 1532], 96: [2, 1533], 97: [2, 1534], 99: [2, 1536], 100: [2, 1537], 101: [2, 1538], 103: [2, 1540], 104: [2, 1541], 105: [2, 1542], 106: [2, 1543], 107: [2, 1544], 108: [2, 1545], 109: [2, 1546], 110: [2, 1547], 111: [2, 1548], 112: [2, 1549], 113: [2, 1550], 114: [2, 1551], 115: [2, 1552], 116: [2, 1553], 117: [2, 1554], 118: [2, 1555], 119: [2, 1556], 120: [2, 1557], 121: [2, 1558], 122: [2, 1559], 123: [2, 1560], 124: [2, 1561], 125: [2, 1562], 126: [2, 1563], 127: [2, 1564], 128: [2, 1565], 129: [2, 1566], 130: [2, 1567], 131: [2, 1568], 132: [2, 1569], 133: [2, 1570], 134: [2, 1571], 135: [2, 1572], 136: [2, 1573], 137: [2, 1574], 138: [2, 1575], 139: [2, 1576], 140: [2, 1577], 141: [2, 1578], 142: [2, 1579], 143: [2, 1580], 144: [2, 1581], 145: [2, 1582], 146: [2, 1583], 147: [2, 1584], 148: [2, 1585], 149: [2, 1586], 150: [2, 1587], 151: [2, 1588], 152: [2, 1589], 153: [2, 1590], 154: [2, 1591], 155: [2, 1592], 156: [2, 1593], 157: [2, 1594], 158: [2, 1595], 159: [2, 1596], 160: [2, 1597], 161: [2, 1598], 162: [2, 1599], 163: [2, 1600], 164: [2, 1601], 165: [2, 1602], 166: [2, 1603], 167: [2, 1604], 168: [2, 1605], 169: [2, 1606], 170: [2, 1607], 171: [2, 1608], 172: [2, 1609], 173: [2, 1610], 174: [2, 1611], 175: [2, 1612], 176: [2, 1613], 177: [2, 1614], 178: [2, 1615], 179: [2, 1616], 180: [2, 1617], 181: [2, 1618], 182: [2, 1619], 183: [2, 1620], 184: [2, 1621], 185: [2, 1622], 186: [2, 1623], 187: [2, 1624], 188: [2, 1625], 189: [2, 1626], 190: [2, 1627], 191: [2, 1628], 192: [2, 1629], 193: [2, 1630], 194: [2, 1631], 195: [2, 1632], 196: [2, 1633], 197: [2, 1634], 198: [2, 1635], 199: [2, 1636], 201: [2, 1638], 202: [2, 1639], 203: [2, 1640], 204: [2, 1641], 205: [2, 1642], 206: [2, 1643], 207: [2, 1644], 208: [2, 1645], 209: [2, 1646], 210: [2, 1647], 211: [2, 1648], 212: [2, 1649], 213: [2, 1650], 214: [2, 1651], 215: [2, 1652], 216: [2, 1653], 217: [2, 1654], 218: [2, 1655], 219: [2, 1656], 220: [2, 1657], 221: [2, 1658], 222: [2, 1659], 223: [2, 1660], 224: [2, 1661], 225: [2, 1662], 226: [2, 1663], 227: [2, 1664], 228: [2, 1665], 229: [2, 1666], 230: [2, 1667], 231: [2, 1668], 232: [2, 1669], 233: [2, 1670], 234: [2, 1671], 235: [2, 1672], 236: [2, 1673], 237: [2, 1674], 238: [2, 1675], 239: [2, 1676], 240: [2, 1677], 241: [2, 1678], 242: [2, 1679], 243: [2, 1680], 244: [2, 1681], 245: [2, 1682], 246: [2, 1683], 247: [2, 1684], 248: [2, 1685], 415: [2, 1293], 417: [2, 1294], 1155: [2, 2373], 1156: [2, 2374], 1157: [2, 2375], 1158: [2, 2376], 1159: [2, 2377], 1195: [2, 2498], 1196: [2, 2499], 1197: [2, 2500], 1198: [2, 2501], 1199: [2, 2502], 1200: [2, 2503], 1201: [2, 2504], 1202: [2, 2505], 1203: [2, 2506], 1204: [2, 2507], 1205: [2, 2508], 1206: [2, 2509], 1207: [2, 2510], 1208: [2, 2511], 1209: [2, 251
2019-12-31 18:47:24 +08:00
parseError: function parseError(str, hash) {
if (hash.recoverable) {
this.trace(str);
}
else {
var error = new Error(str);
error.hash = hash;
throw error;
}
},
parse: function parse(input) {
var self = this, stack = [0], tstack = [], // token stack
vstack = [null], // semantic value stack
lstack = [], // location stack
table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
var args = lstack.slice.call(arguments, 1);
//this.reductionCount = this.shiftCount = 0;
var lexer = Object.create(this.lexer);
var sharedState = { yy: {} };
// copy state
for (var k in this.yy) {
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
sharedState.yy[k] = this.yy[k];
}
}
lexer.setInput(input, sharedState.yy);
sharedState.yy.lexer = lexer;
sharedState.yy.parser = this;
if (typeof lexer.yylloc == 'undefined') {
lexer.yylloc = {};
}
var yyloc = lexer.yylloc;
lstack.push(yyloc);
var ranges = lexer.options && lexer.options.ranges;
if (typeof sharedState.yy.parseError === 'function') {
this.parseError = sharedState.yy.parseError;
}
else {
this.parseError = Object.getPrototypeOf(this).parseError;
}
function popStack(n) {
stack.length = stack.length - 2 * n;
vstack.length = vstack.length - n;
lstack.length = lstack.length - n;
}
_token_stack: var lex = function () {
var token;
token = lexer.lex() || EOF;
// if token isn't its numeric value, convert
if (typeof token !== 'number') {
token = self.symbols_[token] || token;
}
return token;
};
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
while (true) {
// retreive state number from top of stack
state = stack[stack.length - 1];
// use default actions if available
if (this.defaultActions[state]) {
action = this.defaultActions[state];
}
else {
if (symbol === null || typeof symbol == 'undefined') {
symbol = lex();
}
// read action for current state and first input
action = table[state] && table[state][symbol];
}
_handle_error:
// handle parse error
if (typeof action === 'undefined' || !action.length || !action[0]) {
var error_rule_depth;
var errStr = '';
// Return the rule stack depth where the nearest error rule can be found.
// Return FALSE when no error recovery rule was found.
function locateNearestErrorRecoveryRule(state) {
var stack_probe = stack.length - 1;
var depth = 0;
// try to recover from error
for (;;) {
// check for error recovery rule in this state
if ((TERROR.toString()) in table[state]) {
return depth;
}
if (state === 0 || stack_probe < 2) {
return false; // No suitable error recovery rule available.
}
stack_probe -= 2; // popStack(1): [symbol, action]
state = stack[stack_probe];
++depth;
}
}
if (!recovering) {
// first see if there's any chance at hitting an error recovery rule:
error_rule_depth = locateNearestErrorRecoveryRule(state);
// Report error
expected = [];
for (p in table[state]) {
if (this.terminals_[p] && p > TERROR) {
expected.push("'" + this.terminals_[p] + "'");
}
}
if (lexer.showPosition) {
errStr = 'Parse error on line ' + (yylineno + 1) + ":\n" + lexer.showPosition() + "\nExpecting " + expected.join(', ') + ", got '" + (this.terminals_[symbol] || symbol) + "'";
}
else {
errStr = 'Parse error on line ' + (yylineno + 1) + ": Unexpected " +
(symbol == EOF ? "end of input" :
("'" + (this.terminals_[symbol] || symbol) + "'"));
}
this.parseError(errStr, {
text: lexer.match,
token: this.terminals_[symbol] || symbol,
line: lexer.yylineno,
loc: lexer.yylloc, ruleId: stack.slice(stack.length - 2, stack.length).join(''),
expected: expected,
recoverable: (error_rule_depth !== false)
});
}
else if (preErrorSymbol !== EOF) {
error_rule_depth = locateNearestErrorRecoveryRule(state);
}
// just recovered from another error
if (recovering == 3) {
if (symbol === EOF || preErrorSymbol === EOF) {
throw new Error(errStr || 'Parsing halted while starting to recover from another error.');
}
// discard current lookahead and grab another
yyleng = lexer.yyleng;
yytext = lexer.yytext;
yylineno = lexer.yylineno;
yyloc = lexer.yylloc;
symbol = lex();
}
// try to recover from error
if (error_rule_depth === false) {
throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');
}
popStack(error_rule_depth);
preErrorSymbol = (symbol == TERROR ? null : symbol); // save the lookahead token
symbol = TERROR; // insert generic error symbol as new lookahead
state = stack[stack.length - 1];
action = table[state] && table[state][TERROR];
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
}
// this shouldn't happen, unless resolve defaults are off
if (action[0] instanceof Array && action.length > 1) {
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
}
switch (action[0]) {
case 1: // shift
//this.shiftCount++;
stack.push(symbol);
vstack.push(lexer.yytext);
lstack.push(lexer.yylloc);
stack.push(action[1]); // push state
symbol = null;
if (!preErrorSymbol) { // normal execution/no error
yyleng = lexer.yyleng;
yytext = lexer.yytext;
yylineno = lexer.yylineno;
yyloc = lexer.yylloc;
if (recovering > 0) {
recovering--;
}
}
else {
// error just occurred, resume old lookahead f/ before error
symbol = preErrorSymbol;
preErrorSymbol = null;
}
break;
case 2:
// reduce
//this.reductionCount++;
len = this.productions_[action[1]][1];
// perform semantic action
yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
// default location, uses first token for firsts, last for lasts
yyval._$ = {
first_line: lstack[lstack.length - (len || 1)].first_line,
last_line: lstack[lstack.length - 1].last_line,
first_column: lstack[lstack.length - (len || 1)].first_column,
last_column: lstack[lstack.length - 1].last_column
};
if (ranges) {
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
}
r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
if (typeof r !== 'undefined') {
return r;
}
// pop off stack
if (len) {
stack = stack.slice(0, -1 * len * 2);
vstack = vstack.slice(0, -1 * len);
lstack = lstack.slice(0, -1 * len);
}
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
vstack.push(yyval.$);
lstack.push(yyval._$);
// goto new state = table[STATE][NONTERMINAL]
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
stack.push(newState);
break;
case 3:
// accept
return true;
}
}
return true;
} };
sqlParseSupport_1.default.initSqlParser(parser); /* generated by jison-lex 0.3.4 */
var lexer = (function () {
var lexer = ({
EOF: 1,
parseError: function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
}
else {
throw new Error(str);
}
},
// resets the lexer, sets new input
setInput: function (input, yy) {
this.yy = yy || this.yy || {};
this._input = input;
this._more = this._backtrack = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
};
if (this.options.ranges) {
this.yylloc.range = [0, 0];
}
this.offset = 0;
return this;
},
// consumes and returns one char from the input
input: function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
}
else {
this.yylloc.last_column++;
}
if (this.options.ranges) {
this.yylloc.range[1]++;
}
this._input = this._input.slice(1);
return ch;
},
// unshifts one char (or a string) into the input
unput: function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length - len);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1);
this.matched = this.matched.substr(0, this.matched.length - 1);
if (lines.length - 1) {
this.yylineno -= lines.length - 1;
}
var r = this.yylloc.range;
this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
this.yyleng = this.yytext.length;
return this;
},
// When called from action, caches matched text and appends it on next action
more: function () {
this._more = true;
return this;
},
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
reject: function () {
if (this.options.backtrack_lexer) {
this._backtrack = true;
}
else {
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}
return this;
},
// retain first n characters of the match
less: function (n) {
this.unput(this.match.slice(n));
},
// displays already matched input, i.e. for error messages
pastInput: function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
},
// displays upcoming input, i.e. for error messages
upcomingInput: function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20 - next.length);
}
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
},
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition: function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c + "^";
},
// test the lexed token: return FALSE when not a match, otherwise return token
test_match: function (match, indexed_rule) {
var token, lines, backup;
if (this.options.backtrack_lexer) {
// save context
backup = {
yylineno: this.yylineno,
yylloc: {
first_line: this.yylloc.first_line,
last_line: this.last_line,
first_column: this.yylloc.first_column,
last_column: this.yylloc.last_column
},
yytext: this.yytext,
match: this.match,
matches: this.matches,
matched: this.matched,
yyleng: this.yyleng,
offset: this.offset,
_more: this._more,
_input: this._input,
yy: this.yy,
conditionStack: this.conditionStack.slice(0),
done: this.done
};
if (this.options.ranges) {
backup.yylloc.range = this.yylloc.range.slice(0);
}
}
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno += lines.length;
}
this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: lines ?
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
this.yylloc.last_column + match[0].length
};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._backtrack = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
if (this.done && this._input) {
this.done = false;
}
if (token) {
return token;
}
else if (this._backtrack) {
// recover context
for (var k in backup) {
this[k] = backup[k];
}
return false; // rule action called reject() implying the next rule should be tested instead.
}
return false;
},
// return next match in input
next: function () {
if (this.done) {
return this.EOF;
}
if (!this._input) {
this.done = true;
}
var token, match, tempMatch, index;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i = 0; i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (this.options.backtrack_lexer) {
token = this.test_match(tempMatch, rules[i]);
if (token !== false) {
return token;
}
else if (this._backtrack) {
match = false;
continue; // rule action called reject() implying a rule MISmatch.
}
else {
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
}
else if (!this.options.flex) {
break;
}
}
}
if (match) {
token = this.test_match(match, rules[index]);
if (token !== false) {
return token;
}
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
if (this._input === "") {
return this.EOF;
}
else {
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}
},
// return next match that has a token
lex: function lex() {
var r = this.next();
if (r) {
return r;
}
else {
return this.lex();
}
},
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin: function begin(condition) {
this.conditionStack.push(condition);
},
// pop the previously active lexer condition state off the condition stack
popState: function popState() {
var n = this.conditionStack.length - 1;
if (n > 0) {
return this.conditionStack.pop();
}
else {
return this.conditionStack[0];
}
},
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules: function _currentRules() {
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
}
else {
return this.conditions["INITIAL"].rules;
}
},
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState: function topState(n) {
n = this.conditionStack.length - 1 - Math.abs(n || 0);
if (n >= 0) {
return this.conditionStack[n];
}
else {
return "INITIAL";
}
},
// alias for begin(condition)
pushState: function pushState(condition) {
this.begin(condition);
},
// return the number of states currently on the stack
stateStackSize: function stateStackSize() {
return this.conditionStack.length;
},
options: { "case-insensitive": true, "flex": true },
performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
var YYSTATE = YY_START;
switch ($avoiding_name_collisions) {
case 0: /* skip whitespace */
break;
case 1: /* skip comments */
break;
case 2: /* skip comments */
break;
case 3:
parser.yy.partialCursor = false;
parser.yy.cursorFound = yy_.yylloc;
return 27;
break;
case 4:
parser.yy.partialCursor = true;
parser.yy.cursorFound = yy_.yylloc;
2020-03-26 11:47:47 +08:00
return 810;
2019-12-31 18:47:24 +08:00
break;
case 5:
return 561;
break;
case 6:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('ALTER', yy_.yylloc, yy.lexer.upcomingInput());
return 44;
break;
case 7:
return 150;
break;
case 8:
return 347;
break;
case 9:
return 108;
break;
case 10:
return 235;
break;
case 11:
this.begin('between');
2020-03-26 11:47:47 +08:00
return 735;
2019-12-31 18:47:24 +08:00
break;
case 12:
2020-03-26 11:47:47 +08:00
return 736;
2019-12-31 18:47:24 +08:00
break;
case 13:
2020-03-26 11:47:47 +08:00
return 737;
2019-12-31 18:47:24 +08:00
break;
case 14:
2020-03-26 11:47:47 +08:00
return 738;
2019-12-31 18:47:24 +08:00
break;
case 15:
return 79;
break;
case 16:
return 228;
break;
case 17:
2020-03-26 11:47:47 +08:00
return 739;
2019-12-31 18:47:24 +08:00
break;
case 18:
2020-03-26 11:47:47 +08:00
return 741;
2019-12-31 18:47:24 +08:00
break;
case 19:
return 93;
break;
case 20:
2020-03-26 11:47:47 +08:00
return 745;
2019-12-31 18:47:24 +08:00
break;
case 21:
return 71;
break;
case 22:
parser.determineCase(yy_.yytext);
return 266;
break;
case 23:
return 571;
break;
case 24:
2020-03-26 11:47:47 +08:00
return 750;
2019-12-31 18:47:24 +08:00
break;
case 25:
2020-03-26 11:47:47 +08:00
return 751;
2019-12-31 18:47:24 +08:00
break;
case 26:
return 610;
break;
case 27:
2020-03-26 11:47:47 +08:00
return 752;
2019-12-31 18:47:24 +08:00
break;
case 28:
2020-03-26 11:47:47 +08:00
return 753;
2019-12-31 18:47:24 +08:00
break;
case 29:
parser.determineCase(yy_.yytext);
return 534;
break;
case 30:
parser.determineCase(yy_.yytext);
2020-03-26 11:47:47 +08:00
return 850;
2019-12-31 18:47:24 +08:00
break;
case 31:
2020-03-26 11:47:47 +08:00
return 755;
2019-12-31 18:47:24 +08:00
break;
case 32:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 33:
2020-03-26 11:47:47 +08:00
return 757;
2019-12-31 18:47:24 +08:00
break;
case 34:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('DROP', yy_.yylloc, yy.lexer.upcomingInput());
return 166;
break;
case 35:
2020-03-26 11:47:47 +08:00
return 758;
2019-12-31 18:47:24 +08:00
break;
case 36:
2020-03-26 11:47:47 +08:00
return 759;
2019-12-31 18:47:24 +08:00
break;
case 37:
parser.yy.correlatedSubQuery = true;
2020-03-26 11:47:47 +08:00
return 760;
2019-12-31 18:47:24 +08:00
break;
case 38:
return 239;
break;
case 39:
2020-03-26 11:47:47 +08:00
return 686;
2019-12-31 18:47:24 +08:00
break;
case 40:
2020-03-26 11:47:47 +08:00
return 761;
2019-12-31 18:47:24 +08:00
break;
case 41:
2020-03-26 11:47:47 +08:00
return 762;
2019-12-31 18:47:24 +08:00
break;
case 42:
2020-03-26 11:47:47 +08:00
return 763;
2019-12-31 18:47:24 +08:00
break;
case 43:
return 227;
break;
case 44:
return 371;
break;
case 45:
parser.determineCase(yy_.yytext);
return 535;
break;
case 46:
return 568;
break;
case 47:
return 206;
break;
case 48:
return 596;
break;
case 49:
return 620;
break;
case 50:
2020-03-26 11:47:47 +08:00
return 764;
2019-12-31 18:47:24 +08:00
break;
case 51:
2020-03-26 11:47:47 +08:00
return 765;
2019-12-31 18:47:24 +08:00
break;
case 52:
2020-03-26 11:47:47 +08:00
return 768;
2019-12-31 18:47:24 +08:00
break;
case 53:
parser.determineCase(yy_.yytext);
2020-03-26 11:47:47 +08:00
return 681;
2019-12-31 18:47:24 +08:00
break;
case 54:
return 488;
break;
case 55:
return 574;
break;
case 56:
parser.determineCase(yy_.yytext);
return 615;
break;
case 57:
2020-03-26 11:47:47 +08:00
return 770;
2019-12-31 18:47:24 +08:00
break;
case 58:
2020-03-26 11:47:47 +08:00
return 771;
2019-12-31 18:47:24 +08:00
break;
case 59:
return 384;
break;
case 60:
2020-03-26 11:47:47 +08:00
return 772;
2019-12-31 18:47:24 +08:00
break;
case 61:
return 572;
break;
case 62:
return 563;
break;
case 63:
return 569;
break;
case 64:
return 307;
break;
case 65:
2020-03-26 11:47:47 +08:00
return 773;
2019-12-31 18:47:24 +08:00
break;
case 66:
return 639;
break;
case 67:
return 499;
break;
case 68:
return 491;
break;
case 69:
return 351;
break;
case 70:
2020-03-26 11:47:47 +08:00
return 776;
2019-12-31 18:47:24 +08:00
break;
case 71:
return 88;
break;
case 72:
return 208;
break;
case 73:
2020-03-26 11:47:47 +08:00
return 778;
2019-12-31 18:47:24 +08:00
break;
case 74:
2020-03-26 11:47:47 +08:00
return 779;
2019-12-31 18:47:24 +08:00
break;
case 75:
return 55;
break;
case 76:
2020-03-26 11:47:47 +08:00
return 780;
2019-12-31 18:47:24 +08:00
break;
case 77:
2020-03-26 11:47:47 +08:00
return 781;
2019-12-31 18:47:24 +08:00
break;
case 78:
2020-03-26 11:47:47 +08:00
return 782;
2019-12-31 18:47:24 +08:00
break;
case 79:
return 573;
break;
case 80:
return 161;
break;
case 81:
2020-03-26 11:47:47 +08:00
return 786;
2019-12-31 18:47:24 +08:00
break;
case 82:
return 'PRECISION';
break;
case 83:
return 317;
break;
case 84:
2020-03-26 11:47:47 +08:00
return 787;
2019-12-31 18:47:24 +08:00
break;
case 85:
return 372;
break;
case 86:
2020-03-26 11:47:47 +08:00
return 788;
2019-12-31 18:47:24 +08:00
break;
case 87:
return 623;
break;
case 88:
return 570;
break;
case 89:
2020-03-26 11:47:47 +08:00
return 789;
2019-12-31 18:47:24 +08:00
break;
case 90:
2020-03-26 11:47:47 +08:00
return 790;
2019-12-31 18:47:24 +08:00
break;
case 91:
return 409;
break;
case 92:
2020-03-26 11:47:47 +08:00
return 791;
2019-12-31 18:47:24 +08:00
break;
case 93:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SELECT', yy_.yylloc);
return 547;
break;
case 94:
return 575;
break;
case 95:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SET', yy_.yylloc);
return 26;
break;
case 96:
2020-03-26 11:47:47 +08:00
return 793;
2019-12-31 18:47:24 +08:00
break;
case 97:
return 204;
break;
case 98:
return 158;
break;
case 99:
2020-03-26 11:47:47 +08:00
return 667;
2019-12-31 18:47:24 +08:00
break;
case 100:
2020-03-26 11:47:47 +08:00
return 798;
2019-12-31 18:47:24 +08:00
break;
case 101:
return 75;
break;
case 102:
2020-03-26 11:47:47 +08:00
return 799;
2019-12-31 18:47:24 +08:00
break;
case 103:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('TRUNCATE', yy_.yylloc, yy.lexer.upcomingInput());
return 533;
break;
case 104:
2020-03-26 11:47:47 +08:00
return 1004;
2019-12-31 18:47:24 +08:00
break;
case 105:
2020-03-26 11:47:47 +08:00
return 800;
2019-12-31 18:47:24 +08:00
break;
case 106:
parser.determineCase(yy_.yytext);
return 618;
break;
case 107:
return 619;
break;
case 108:
return 464;
break;
case 109:
return 'UTC_TIMESTAMP';
break;
case 110:
return 637;
break;
case 111:
2020-03-26 11:47:47 +08:00
return 804;
2019-12-31 18:47:24 +08:00
break;
case 112:
2020-03-26 11:47:47 +08:00
return 806;
2019-12-31 18:47:24 +08:00
break;
case 113:
2020-03-26 11:47:47 +08:00
return 663;
2019-12-31 18:47:24 +08:00
break;
case 114:
2020-03-26 11:47:47 +08:00
return 807;
2019-12-31 18:47:24 +08:00
break;
case 115:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('WITH', yy_.yylloc);
return 152;
break;
case 116:
parser.determineCase(yy_.yytext);
return 538;
break;
case 117:
return 66;
break;
case 118:
return 622;
break;
case 119:
return 174;
break;
case 120:
parser.determineCase(yy_.yytext);
return 217;
break;
case 121:
return 181;
break;
case 122:
2020-03-26 11:47:47 +08:00
return 732;
2019-12-31 18:47:24 +08:00
break;
case 123:
return 234;
break;
case 124:
return 417;
break;
case 125:
2020-03-26 11:47:47 +08:00
return 694;
2019-12-31 18:47:24 +08:00
break;
case 126:
return 386;
break;
case 127:
2020-03-26 11:47:47 +08:00
return 695;
2019-12-31 18:47:24 +08:00
break;
case 128:
return 236;
break;
case 129:
return 92;
break;
case 130:
return 323;
break;
case 131:
2020-03-26 11:47:47 +08:00
return 742;
2019-12-31 18:47:24 +08:00
break;
case 132:
return 382;
break;
case 133:
return 443;
break;
case 134:
return 154;
break;
case 135:
return 277;
break;
case 136:
return 135;
break;
case 137:
2020-03-26 11:47:47 +08:00
return 696;
2019-12-31 18:47:24 +08:00
break;
case 138:
return 218;
break;
case 139:
return 134;
break;
case 140:
return 244;
break;
case 141:
return 330;
break;
case 142:
return 331;
break;
case 143:
return 329;
break;
case 144:
2020-03-26 11:47:47 +08:00
return 674;
2019-12-31 18:47:24 +08:00
break;
case 145:
2020-03-26 11:47:47 +08:00
return 697;
2019-12-31 18:47:24 +08:00
break;
case 146:
2020-03-26 11:47:47 +08:00
return 698;
2019-12-31 18:47:24 +08:00
break;
case 147:
2020-03-26 11:47:47 +08:00
return 699;
2019-12-31 18:47:24 +08:00
break;
case 148:
return 47;
break;
case 149:
return 321;
break;
case 150:
return 486;
break;
case 151:
return 447;
break;
case 152:
return 428;
break;
case 153:
return 238;
break;
case 154:
2020-03-26 11:47:47 +08:00
return 754;
2019-12-31 18:47:24 +08:00
break;
case 155:
return 247;
break;
case 156:
this.begin('hdfs');
return 640;
break;
case 157:
return 177;
break;
case 158:
2020-03-26 11:47:47 +08:00
return 756;
2019-12-31 18:47:24 +08:00
break;
case 159:
return 396;
break;
case 160:
2020-03-26 11:47:47 +08:00
return 700;
2019-12-31 18:47:24 +08:00
break;
case 161:
return 176;
break;
case 162:
return 442;
break;
case 163:
return 156;
break;
case 164:
parser.determineCase(yy_.yytext);
return 231;
break;
case 165:
parser.determineCase(yy_.yytext);
2020-03-26 11:47:47 +08:00
return 687;
2019-12-31 18:47:24 +08:00
break;
case 166:
return 248;
break;
case 167:
return 439;
break;
case 168:
return 468;
break;
case 169:
return 127;
break;
case 170:
return 175;
break;
case 171:
return 410;
break;
case 172:
return 233;
break;
case 173:
2020-03-26 11:47:47 +08:00
return 701;
2019-12-31 18:47:24 +08:00
break;
case 174:
2020-03-26 11:47:47 +08:00
return 702;
2019-12-31 18:47:24 +08:00
break;
case 175:
return 487;
break;
case 176:
return 54;
break;
case 177:
2020-03-26 11:47:47 +08:00
return 769;
2019-12-31 18:47:24 +08:00
break;
case 178:
this.begin('hdfs');
2020-03-26 11:47:47 +08:00
return 676;
2019-12-31 18:47:24 +08:00
break;
case 179:
return 418;
break;
case 180:
return 444;
break;
case 181:
return 469;
break;
case 182:
return 245;
break;
case 183:
return 420;
break;
case 184:
return 318;
break;
case 185:
return 445;
break;
case 186:
2020-03-26 11:47:47 +08:00
return 703;
2019-12-31 18:47:24 +08:00
break;
case 187:
return 446;
break;
case 188:
return 328;
break;
case 189:
parser.determineCase(yy_.yytext);
2020-03-26 11:47:47 +08:00
return 673;
2019-12-31 18:47:24 +08:00
break;
case 190:
this.begin('hdfs');
2020-03-26 11:47:47 +08:00
return 704;
2019-12-31 18:47:24 +08:00
break;
case 191:
return 616;
break;
case 192:
return 240;
break;
case 193:
2020-03-26 11:47:47 +08:00
return 665;
2019-12-31 18:47:24 +08:00
break;
case 194:
return 61;
break;
case 195:
2020-03-26 11:47:47 +08:00
return 656;
2019-12-31 18:47:24 +08:00
break;
case 196:
return 229;
break;
case 197:
2020-03-26 11:47:47 +08:00
return 705;
2019-12-31 18:47:24 +08:00
break;
case 198:
2020-03-26 11:47:47 +08:00
return 706;
2019-12-31 18:47:24 +08:00
break;
case 199:
return 198;
break;
case 200:
return 178;
break;
case 201:
return 374;
break;
case 202:
return 230;
break;
case 203:
return 333;
break;
case 204:
return 180;
break;
case 205:
return 246;
break;
case 206:
return 249;
break;
case 207:
return 621;
break;
case 208:
return 421;
break;
case 209:
return 419;
break;
case 210:
2020-03-26 11:47:47 +08:00
return 783;
2019-12-31 18:47:24 +08:00
break;
case 211:
return 153;
break;
case 212:
this.begin('hdfs');
return 643;
break;
case 213:
return 50;
break;
case 214:
return 422;
break;
case 215:
return 376;
break;
case 216:
return 85;
break;
case 217:
2020-03-26 11:47:47 +08:00
return 707;
2019-12-31 18:47:24 +08:00
break;
case 218:
return 626;
break;
case 219:
return 532;
break;
case 220:
2020-03-26 11:47:47 +08:00
return 708;
2019-12-31 18:47:24 +08:00
break;
case 221:
return 423;
break;
case 222:
return 58;
break;
case 223:
return 84;
break;
case 224:
parser.determineCase(yy_.yytext);
return 205;
break;
case 225:
return 373;
break;
case 226:
return 74;
break;
case 227:
return 202;
break;
case 228:
return 99;
break;
case 229:
2020-03-26 11:47:47 +08:00
return 688;
2019-12-31 18:47:24 +08:00
break;
case 230:
2020-03-26 11:47:47 +08:00
return 709;
2019-12-31 18:47:24 +08:00
break;
case 231:
return 64;
break;
case 232:
return 473;
break;
case 233:
2020-03-26 11:47:47 +08:00
return 710;
2019-12-31 18:47:24 +08:00
break;
case 234:
2020-03-26 11:47:47 +08:00
return 792;
2019-12-31 18:47:24 +08:00
break;
case 235:
2020-03-26 11:47:47 +08:00
return 711;
2019-12-31 18:47:24 +08:00
break;
case 236:
2020-03-26 11:47:47 +08:00
return 712;
2019-12-31 18:47:24 +08:00
break;
case 237:
return 424;
break;
case 238:
return 130;
break;
case 239:
return 132;
break;
case 240:
2020-03-26 11:47:47 +08:00
return 713;
2019-12-31 18:47:24 +08:00
break;
case 241:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SHOW', yy_.yylloc);
2020-03-26 11:47:47 +08:00
return 714;
2019-12-31 18:47:24 +08:00
break;
case 242:
return 617;
break;
case 243:
return 90;
break;
case 244:
return 78;
break;
case 245:
2020-03-26 11:47:47 +08:00
return 893;
2019-12-31 18:47:24 +08:00
break;
case 246:
return 397;
break;
case 247:
return 219;
break;
case 248:
return 107;
break;
case 249:
return 89;
break;
case 250:
2020-03-26 11:47:47 +08:00
return 715;
2019-12-31 18:47:24 +08:00
break;
case 251:
return 352;
break;
case 252:
return 250;
break;
case 253:
2020-03-26 11:47:47 +08:00
return 716;
2019-12-31 18:47:24 +08:00
break;
case 254:
2020-03-26 11:47:47 +08:00
return 797;
2019-12-31 18:47:24 +08:00
break;
case 255:
return 129;
break;
case 256:
return 460;
break;
case 257:
return 440;
break;
case 258:
return 425;
break;
case 259:
2020-03-26 11:47:47 +08:00
return 717;
2019-12-31 18:47:24 +08:00
break;
case 260:
return 86;
break;
case 261:
2020-03-26 11:47:47 +08:00
return 718;
2019-12-31 18:47:24 +08:00
break;
case 262:
return 539;
break;
case 263:
return 182;
break;
case 264:
return 359;
break;
case 265:
return 320;
break;
case 266:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('USE', yy_.yylloc);
2020-03-26 11:47:47 +08:00
return 719;
2019-12-31 18:47:24 +08:00
break;
case 267:
return 241;
break;
case 268:
return 62;
break;
case 269:
return 151;
break;
case 270:
2020-03-26 11:47:47 +08:00
return 720;
2019-12-31 18:47:24 +08:00
break;
case 271:
2020-03-26 11:47:47 +08:00
return 808;
2019-12-31 18:47:24 +08:00
break;
case 272:
2020-03-26 11:47:47 +08:00
return 721;
2019-12-31 18:47:24 +08:00
break;
case 273:
2020-03-26 11:47:47 +08:00
return 727;
2019-12-31 18:47:24 +08:00
break;
case 274:
2020-03-26 11:47:47 +08:00
return 728;
2019-12-31 18:47:24 +08:00
break;
case 275:
2020-03-26 11:47:47 +08:00
return 729;
2019-12-31 18:47:24 +08:00
break;
case 276:
this.popState();
2020-03-26 11:47:47 +08:00
return 901;
2019-12-31 18:47:24 +08:00
break;
case 277:
yy.lexer.unput('(');
yy_.yytext = 'avg';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 733;
2019-12-31 18:47:24 +08:00
break;
case 278:
yy.lexer.unput('(');
yy_.yytext = 'cast';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 740;
2019-12-31 18:47:24 +08:00
break;
case 279:
yy.lexer.unput('(');
yy_.yytext = 'collect_list';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 743;
2019-12-31 18:47:24 +08:00
break;
case 280:
yy.lexer.unput('(');
yy_.yytext = 'collect_set';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 744;
2019-12-31 18:47:24 +08:00
break;
case 281:
yy.lexer.unput('(');
yy_.yytext = 'corr';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 746;
2019-12-31 18:47:24 +08:00
break;
case 282:
yy.lexer.unput('(');
yy_.yytext = 'count';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 747;
2019-12-31 18:47:24 +08:00
break;
case 283:
yy.lexer.unput('(');
yy_.yytext = 'covar_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 748;
2019-12-31 18:47:24 +08:00
break;
case 284:
yy.lexer.unput('(');
yy_.yytext = 'covar_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 749;
2019-12-31 18:47:24 +08:00
break;
case 285:
yy.lexer.unput('(');
yy_.yytext = 'extract';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 1010;
2019-12-31 18:47:24 +08:00
break;
case 286:
yy.lexer.unput('(');
yy_.yytext = 'histogram_numeric';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 767;
2019-12-31 18:47:24 +08:00
break;
case 287:
yy.lexer.unput('(');
yy_.yytext = 'max';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 774;
2019-12-31 18:47:24 +08:00
break;
case 288:
yy.lexer.unput('(');
yy_.yytext = 'min';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 775;
2019-12-31 18:47:24 +08:00
break;
case 289:
yy.lexer.unput('(');
yy_.yytext = 'ntile';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 777;
2019-12-31 18:47:24 +08:00
break;
case 290:
yy.lexer.unput('(');
yy_.yytext = 'percentile';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 784;
2019-12-31 18:47:24 +08:00
break;
case 291:
yy.lexer.unput('(');
yy_.yytext = 'percentile_approx';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 785;
2019-12-31 18:47:24 +08:00
break;
case 292:
yy.lexer.unput('(');
yy_.yytext = 'stddev_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 794;
2019-12-31 18:47:24 +08:00
break;
case 293:
yy.lexer.unput('(');
yy_.yytext = 'stddev_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 795;
2019-12-31 18:47:24 +08:00
break;
case 294:
yy.lexer.unput('(');
yy_.yytext = 'sum';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 796;
2019-12-31 18:47:24 +08:00
break;
case 295:
yy.lexer.unput('(');
yy_.yytext = 'var_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 802;
2019-12-31 18:47:24 +08:00
break;
case 296:
yy.lexer.unput('(');
yy_.yytext = 'var_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 803;
2019-12-31 18:47:24 +08:00
break;
case 297:
yy.lexer.unput('(');
yy_.yytext = 'variance';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 805;
2019-12-31 18:47:24 +08:00
break;
case 298:
yy.lexer.unput('(');
yy_.yytext = 'cume_dist';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 299:
yy.lexer.unput('(');
yy_.yytext = 'cume_dist';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 300:
yy.lexer.unput('(');
yy_.yytext = 'dense_rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 301:
yy.lexer.unput('(');
yy_.yytext = 'first_value';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 302:
yy.lexer.unput('(');
yy_.yytext = 'lag';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 303:
yy.lexer.unput('(');
yy_.yytext = 'last_value';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 304:
yy.lexer.unput('(');
yy_.yytext = 'lead';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 305:
yy.lexer.unput('(');
yy_.yytext = 'percent_rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 306:
yy.lexer.unput('(');
yy_.yytext = 'rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 307:
yy.lexer.unput('(');
yy_.yytext = 'row_number';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 730;
2019-12-31 18:47:24 +08:00
break;
case 308:
return 385;
break;
case 309:
return 385;
break;
case 310:
2020-03-26 11:47:47 +08:00
return 801;
2019-12-31 18:47:24 +08:00
break;
case 311:
2020-03-26 11:47:47 +08:00
return 722;
2019-12-31 18:47:24 +08:00
break;
case 312:
parser.yy.cursorFound = true;
return 27;
break;
case 313:
parser.yy.cursorFound = true;
2020-03-26 11:47:47 +08:00
return 810;
2019-12-31 18:47:24 +08:00
break;
case 314:
2020-03-26 11:47:47 +08:00
return 766;
2019-12-31 18:47:24 +08:00
break;
case 315:
parser.addFileLocation(yy_.yylloc, yy_.yytext);
2020-03-26 11:47:47 +08:00
return 1007;
2019-12-31 18:47:24 +08:00
break;
case 316:
this.popState();
2020-03-26 11:47:47 +08:00
return 1008;
2019-12-31 18:47:24 +08:00
break;
case 317:
2020-03-26 11:47:47 +08:00
return 690;
2019-12-31 18:47:24 +08:00
break;
case 318:
return 150;
break;
case 319:
2020-03-26 11:47:47 +08:00
return 780;
2019-12-31 18:47:24 +08:00
break;
case 320:
return 126;
break;
case 321:
return 348;
break;
case 322:
return 349;
break;
case 323:
return 381;
break;
case 324:
return 381;
break;
case 325:
return 381;
break;
case 326:
return 381;
break;
case 327:
return 381;
break;
case 328:
2020-03-26 11:47:47 +08:00
return 726;
2019-12-31 18:47:24 +08:00
break;
case 329:
2020-03-26 11:47:47 +08:00
return 725;
2019-12-31 18:47:24 +08:00
break;
case 330:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 331:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 332:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 333:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 334:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 335:
2020-03-26 11:47:47 +08:00
return 731;
2019-12-31 18:47:24 +08:00
break;
case 336:
return 123;
break;
case 337:
2020-03-26 11:47:47 +08:00
return 727;
2019-12-31 18:47:24 +08:00
break;
case 338:
return 358;
break;
case 339:
return 544;
break;
case 340:
2020-03-26 11:47:47 +08:00
return 809;
2019-12-31 18:47:24 +08:00
break;
case 341:
2020-03-26 11:47:47 +08:00
return 724;
2019-12-31 18:47:24 +08:00
break;
case 342:
return 116;
break;
case 343:
return 118;
break;
case 344:
2020-03-26 11:47:47 +08:00
return 728;
2019-12-31 18:47:24 +08:00
break;
case 345:
2020-03-26 11:47:47 +08:00
return 729;
2019-12-31 18:47:24 +08:00
break;
case 346:
2020-03-26 11:47:47 +08:00
return 723;
2019-12-31 18:47:24 +08:00
break;
case 347:
this.begin('backtickedValue');
2020-03-26 11:47:47 +08:00
return 734;
2019-12-31 18:47:24 +08:00
break;
case 348:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '`')) {
2020-03-26 11:47:47 +08:00
return 815;
2019-12-31 18:47:24 +08:00
}
return 281;
break;
case 349:
this.popState();
2020-03-26 11:47:47 +08:00
return 734;
2019-12-31 18:47:24 +08:00
break;
case 350:
this.begin('singleQuotedValue');
return 279;
break;
case 351:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '\'')) {
2020-03-26 11:47:47 +08:00
return 815;
2019-12-31 18:47:24 +08:00
}
return 281;
break;
case 352:
this.popState();
return 279;
break;
case 353:
this.begin('doubleQuotedValue');
return 280;
break;
case 354:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '"')) {
2020-03-26 11:47:47 +08:00
return 815;
2019-12-31 18:47:24 +08:00
}
return 281;
break;
case 355:
this.popState();
return 280;
break;
case 356:
2020-03-26 11:47:47 +08:00
return 690;
2019-12-31 18:47:24 +08:00
break;
case 357: /* To prevent console logging of unknown chars */
break;
case 358:
break;
case 359:
break;
case 360:
break;
case 361:
break;
case 362:
break;
case 363:
console.log(yy_.yytext);
break;
}
},
rules: [/^(?:\s)/i, /^(?:--.*)/i, /^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/i, /^(?:\u2020)/i, /^(?:\u2021)/i, /^(?:ALL)/i, /^(?:ALTER)/i, /^(?:AND)/i, /^(?:ARRAY)/i, /^(?:AS)/i, /^(?:AUTHORIZATION)/i, /^(?:BETWEEN)/i, /^(?:BIGINT)/i, /^(?:BINARY)/i, /^(?:BOOLEAN)/i, /^(?:BY)/i, /^(?:CACHE)/i, /^(?:CASE)/i, /^(?:CHAR)/i, /^(?:COLUMN)/i, /^(?:CONF)/i, /^(?:CONSTRAINT)/i, /^(?:CREATE)/i, /^(?:CROSS)/i, /^(?:CUBE)/i, /^(?:CURRENT)/i, /^(?:DATABASE)/i, /^(?:DATE)/i, /^(?:DECIMAL)/i, /^(?:DELETE)/i, /^(?:DESCRIBE)/i, /^(?:DISTINCT)/i, /^(?:DIV)/i, /^(?:DOUBLE)/i, /^(?:DROP)/i, /^(?:ELSE)/i, /^(?:END)/i, /^(?:EXISTS)/i, /^(?:EXTENDED)/i, /^(?:EXTERNAL)/i, /^(?:FALSE)/i, /^(?:FLOAT)/i, /^(?:FOLLOWING)/i, /^(?:FOR)/i, /^(?:FOREIGN)/i, /^(?:FROM)/i, /^(?:FULL)/i, /^(?:FUNCTION)/i, /^(?:GRANT)/i, /^(?:GROUP)/i, /^(?:GROUPING)/i, /^(?:HAVING)/i, /^(?:IF)/i, /^(?:IMPORT)/i, /^(?:IN)/i, /^(?:INNER)/i, /^(?:INSERT)/i, /^(?:INT)/i, /^(?:INTEGER)/i, /^(?:INTO)/i, /^(?:IS)/i, /^(?:JOIN)/i, /^(?:LATERAL)/i, /^(?:LEFT)/i, /^(?:LIKE)/i, /^(?:LIMIT)/i, /^(?:LOCAL)/i, /^(?:LIFECYCLE)/i, /^(?:MACRO)/i, /^(?:MAP)/i, /^(?:NONE)/i, /^(?:NOT)/i, /^(?:NULL)/i, /^(?:NULLS)/i, /^(?:OF)/i, /^(?:ON)/i, /^(?:OR)/i, /^(?:ORDER)/i, /^(?:OUT)/i, /^(?:OUTER)/i, /^(?:PARTITION)/i, /^(?:PRECEDING)/i, /^(?:PRECISION)/i, /^(?:PRIMARY)/i, /^(?:RANGE)/i, /^(?:REFERENCES)/i, /^(?:REGEXP)/i, /^(?:REVOKE)/i, /^(?:RIGHT)/i, /^(?:RLIKE)/i, /^(?:ROLLUP)/i, /^(?:ROW)/i, /^(?:ROWS)/i, /^(?:SELECT)/i, /^(?:SEMI)/i, /^(?:SET)/i, /^(?:SMALLINT)/i, /^(?:SYNC)/i, /^(?:TABLE)/i, /^(?:THEN)/i, /^(?:TIMESTAMP)/i, /^(?:TO)/i, /^(?:TRUE)/i, /^(?:TRUNCATE)/i, /^(?:UNBOUNDED)/i, /^(?:UNION)/i, /^(?:UPDATE)/i, /^(?:USER)/i, /^(?:USING)/i, /^(?:UTC_TIMESTAMP)/i, /^(?:VALUES)/i, /^(?:VARCHAR)/i, /^(?:VIEWS)/i, /^(?:WHEN)/i, /^(?:WHERE)/i, /^(?:WITH)/i, /^(?:ABORT)/i, /^(?:ADD)/i, /^(?:ADMIN)/i, /^(?:AFTER)/i, /^(?:ANALYZE)/i, /^(?:ARCHIVE)/i, /^(?:ASC)/i, /^(?:AST)/i, /^(?:AVRO)/i, /^(?:BUCKET)/i, /^(?:BUCKETS)/i, /^(?:CASCADE)/i, /^(?:CBO)/i, /^(?:CHANGE)/i, /^(?:CHECK)/i, /^(?:CLUSTER)/i, /^(?:CLUSTERED)/i, /^(?:COLLECTION)/i, /^(?:COLUMNS)/i, /^(?:COMMENT)/i, /^(?:COMPACT)/i, /^(?:COMPACTIONS)/i, /^(?:COMPUTE)/i, /^(?:CONCATENATE)/i, /^(?:COST)/i, /^(?:CURRENT_DATE)/i, /^(?:CURRENT_TIMESTAMP)/i, /^(?:CURRENT_USER)/i, /^(?:DATA)/i, /^(?:DATABASES)/i, /^(?:DAY)/i, /^(?:DAYOFWEEK)/i, /^(?:DBPROPERTIES)/i, /^(?:DEFAULT)/i, /^(?:DEFERRED)/i, /^(?:DEFINED)/i, /^(?:DELIMITED)/i, /^(?:DEPENDENCY)/i, /^(?:DESC)/i, /^(?:DETAIL)/i, /^(?:DIRECTORY)/i, /^(?:DISABLE)/i, /^(?:DISTRIBUTE)/i, /^(?:DISTRIBUTED)/i, /^(?:DOUBLE\s+PRECISION)/i, /^(?:ENABLE)/i, /^(?:ESCAPED)/i, /^(?:EXCHANGE)/i, /^(?:EXPLAIN)/i, /^(?:EXPORT)/i, /^(?:EXPRESSION)/i, /^(?:FIELDS)/i, /^(?:FILE)/i, /^(?:FILEFORMAT)/i, /^(?:FIRST)/i, /^(?:FORMAT)/i, /^(?:FORMATTED)/i, /^(?:FUNCTIONS)/i, /^(?:HOUR)/i, /^(?:IDXPROPERTIES)/i, /^(?:INDEX)/i, /^(?:INDEXES)/i, /^(?:INPATH)/i, /^(?:INPUTFORMAT)/i, /^(?:ITEMS)/i, /^(?:JAR)/i, /^(?:JOINCOST)/i, /^(?:JSONFILE)/i, /^(?:KEY)/i, /^(?:KEYS)/i, /^(?:LAST)/i, /^(?:LINES)/i, /^(?:LITERAL)/i, /^(?:LOAD)/i, /^(?:LOCATION)/i, /^(?:LOCK)/i, /^(?:LOCKS)/i, /^(?:MATCHED)/i, /^(?:MATERIALIZED)/i, /^(?:MERGE)/i, /^(?:METADATA)/i, /^(?:MINUTE)/i, /^(?:MONTH)/i, /^(?:MSCK)/i, /^(?:NO_DROP)/i, /^(?:NORELY)/i, /^(?:NOSCAN)/i, /^(?:NOVALIDATE)/i, /^(?:OFFLINE)/i, /^(?:ONLY)/i, /^(?:OPERATOR)/i, /^(?:OPTION)/i, /^(?:ORC)/i, /^(?:OUTPUTFORMAT)/i, /^(?:OVER)/i, /^(?:OVERWRITE)/i, /^(?:OVERWRITE\s+DIRECTORY)/i, /^(?:OWNER)/i, /^(?:PARQUET)/i, /^(?:PARTITIONED)/i, /^(?:PARTITIONS)/i, /^(?:PERCENT)/i, /^(?:PRIVILEGES)/i, /^(?:PURGE)/i, /^(?:QUARTER)/i, /^(?:RCFILE)/i, /^(?:REBUILD)/i, /^(?:RECOVER)/i, /^(?:RELOAD)/i, /^(?:RELY)/i, /^(?:RENAME)/i, /^(?:REPAIR)/i, /^(?:REPLACE)/i, /^(?:REPLICATION)/i, /^(?:RESTRICT)/i, /^(?:REWRITE)/i, /^(?:ROLE)/i, /^(?:ROLES)/i, /^(?:SCHEMA)/i, /^(?:SCHEMAS)/i, /^(?:SECOND)/i, /^(?:SEQUENCEFILE)/i, /^(?:SERDE)/i, /^(?:SERDEPROPERTIES)/i, /^(?:SETS)/i, /^(?:SHOW)/i, /^(?:SHOW_DATABASE)/i, /^(?:SKEWED LOCATION)/i, /^(?:SKEWED)/i, /^(?:SORT)/i, /^(?:SORTED)/i, /^(?:
conditions: { "hdfs": { "rules": [312, 313, 314, 315, 316, 317, 359], "inclusive": false }, "doubleQuotedValue": { "rules": [354, 355, 362], "inclusive": false }, "singleQuotedValue": { "rules": [351, 352, 361], "inclusive": false }, "backtickedValue": { "rules": [348, 349, 360], "inclusive": false }, "between": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 350, 353, 356, 357, 358, 363], "inclusive": true }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 350, 353, 356, 357, 363], "inclusive": true } }
});
return lexer;
})();
parser.lexer = lexer;
function Parser() {
this.yy = {};
}
Parser.prototype = parser;
parser.Parser = Parser;
return new Parser;
})();
exports.default = hiveAutocompleteParser;