lava-oushudb-dt-sql-parser/lib/core/parse/impala/impalaAutocompleteParser.js

5408 lines
760 KiB
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 impalaAutocompleteParser = (function () {
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v)
; return o; }, $V0 = [2, 26, 27, 38, 41, 50, 51, 54, 63, 65, 66, 70, 71, 85, 86, 89, 91, 95, 101, 103, 106, 107, 129, 136, 138, 142, 143, 144, 146, 147, 149, 151, 153, 155, 158, 170, 179, 180, 208, 224, 236, 237, 238, 241, 242, 253, 254, 256, 257, 265, 269, 276, 278, 288, 289, 290, 292, 293, 294, 295, 296, 301, 302, 304, 305, 307, 316, 322, 342, 343, 344, 345, 348, 349, 350, 351, 352, 353, 354, 360, 362, 391, 392, 393, 395, 405, 409, 412, 426, 428, 429, 430, 431, 432, 433, 434, 435, 436, 453, 454, 462, 463, 464, 466, 467, 484, 485, 489, 490, 495, 496, 497, 500, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 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, 797, 840, 1006, 1021, 1035], $V1 = [2, 924], $V2 = [405, 500], $V3 = [2, 713], $V4 = [1, 5], $V5 = [1, 315], $V6 = [1, 423], $V7 = [1, 485], $V8 = [1, 248], $V9 = [1, 269], $Va = [1, 250], $Vb = [1, 18], $Vc = [1, 497], $Vd = [1, 68], $Ve = [1, 329], $Vf = [1, 273], $Vg = [1, 252], $Vh = [1, 50], $Vi = [1, 513], $Vj = [1, 10], $Vk = [1, 11], $Vl = [1, 13], $Vm = [1, 349], $Vn = [1, 312], $Vo = [1, 299], $Vp = [1, 142], $Vq = [1, 346], $Vr = [1, 35], $Vs = [1, 15], $Vt = [1, 237], $Vu = [1, 95], $Vv = [1, 181], $Vw = [1, 230], $Vx = [1, 447], $Vy = [1, 149], $Vz = [1, 41], $VA = [1, 448], $VB = [1, 449], $VC = [1, 166], $VD = [1, 490], $VE = [1, 318], $VF = [1, 111], $VG = [1, 199], $VH = [1, 228], $VI = [1, 32], $VJ = [1, 17], $VK = [1, 19], $VL = [1, 207], $VM = [1, 336], $VN = [1, 265], $VO = [1, 192], $VP = [1, 251], $VQ = [1, 54], $VR = [1, 158], $VS = [1, 322], $VT = [1, 375], $VU = [1, 70], $VV = [1, 333], $VW = [1, 43], $VX = [1, 193], $VY = [1, 249], $VZ = [1, 270], $V_ = [1, 311], $V$ = [1, 351], $V01 = [1, 104], $V11 = [1, 133], $V21 = [1, 350], $V31 = [1, 122], $V41 = [1, 202], $V51 = [1, 425], $V61 = [1, 148], $V71 = [1, 22], $V81 = [1, 16], $V91 = [1, 292], $Va1 = [1, 342], $Vb1 = [1, 168], $Vc1 = [1, 370], $Vd1 = [1, 214], $Ve1 = [1, 264], $Vf1 = [1, 65], $Vg1 = [1, 313], $Vh1 = [1, 136], $Vi1 = [1, 175], $Vj1 = [1, 295], $Vk1 = [1, 368], $Vl1 = [1, 268], $Vm1 = [1, 516], $Vn1 = [1, 103], $Vo1 = [1, 146], $Vp1 = [1, 404], $Vq1 = [1, 480], $Vr1 = [1, 23], $Vs1 = [1, 147], $Vt1 = [1, 198], $Vu1 = [1, 293], $Vv1 = [1, 27], $Vw1 = [1, 82], $Vx1 = [1, 170], $Vy1 = [1, 244], $Vz1 = [1, 309], $VA1 = [1, 182], $VB1 = [1, 153], $VC1 = [1, 154], $VD1 = [1, 314], $VE1 = [1, 371], $VF1 = [1, 529], $VG1 = [1, 240], $VH1 = [1, 462], $VI1 = [1, 528], $VJ1 = [1, 179], $VK1 = [1, 316], $VL1 = [1, 227], $VM1 = [1, 478], $VN1 = [1, 94], $VO1 = [1, 172], $VP1 = [1, 287], $VQ1 = [1, 380], $VR1 = [1, 422], $VS1 = [1, 9], $VT1 = [1, 12], $VU1 = [1, 14], $VV1 = [1, 20], $VW1 = [1, 21], $VX1 = [1, 24], $VY1 = [1, 25], $VZ1 = [1, 26],
2019-12-31 18:47:24 +08:00
var parser = { trace: function trace() { },
yy: {},
symbols_: { "error": 2, "DataDefinition": 3, "AlterStatement": 4, "RefreshStatement": 5, "InvalidateStatement": 6, "ComputeStatsStatement": 7, "CreateStatement": 8, "DropStatement": 9, "GrantStatement": 10, "RevokeStatement": 11, "DescribeStatement": 12, "SetSpecification": 13, "ShowStatement": 14, "UseStatement": 15, "DataDefinition_EDIT": 16, "AlterStatement_EDIT": 17, "RefreshStatement_EDIT": 18, "InvalidateStatement_EDIT": 19, "ComputeStatsStatement_EDIT": 20, "CreateStatement_EDIT": 21, "DropStatement_EDIT": 22, "GrantStatement_EDIT": 23, "RevokeStatement_EDIT": 24, "DescribeStatement_EDIT": 25, "SET": 26, "CURSOR": 27, "ShowStatement_EDIT": 28, "UseStatement_EDIT": 29, "AlterDatabase": 30, "AlterTable": 31, "AlterView": 32, "CommentOn": 33, "AlterDatabase_EDIT": 34, "AlterTable_EDIT": 35, "AlterView_EDIT": 36, "CommentOn_EDIT": 37, "ALTER": 38, "DatabaseOrSchema": 39, "RegularOrBacktickedIdentifier": 40, "OWNER": 41, "RoleOrUser": 42, "AlterTableLeftSide": 43, "ADD": 44, "OptionalIfNotExists": 45, "PartitionSpec": 46, "OptionalHdfsLocation": 47, "OptionalPartitionSpecs": 48, "OptionalCachedInOrUncached": 49, "RANGE": 50, "PARTITION": 51, "RangePartitionSpec": 52, "PARTITION_VALUE": 53, "=": 54, "UnsignedValueSpecification": 55, "RENAME": 56, "TO": 57, "RegularOrBackTickedSchemaQualifiedName": 58, "OptionalColumn": 59, "ColumnIdentifier": 60, "KuduStorageAttribute": 61, "SetValue": 62, "DROP": 63, "DEFAULT": 64, "COLUMN": 65, "STATS": 66, "ParenthesizedStatsList": 67, "DropOperations": 68, "OptionalPartitionOperations": 69, "RECOVER": 70, "PARTITIONS": 71, "AlterTableLeftSide_EDIT": 72, "REPLACE": 73, "OptionalIfNotExists_EDIT": 74, "HdfsLocation_EDIT": 75, "OptionalPartitionSpecs_EDIT": 76, "CachedIn_EDIT": 77, "PartitionSpec_EDIT": 78, "OptionalCachedIn": 79, "RangePartitionSpec_EDIT": 80, "ParenthesizedStatsList_EDIT": 81, "OptionalPartitionOperations_EDIT": 82, "DropOperations_EDIT": 83, "AddOrReplace": 84, "BLOCK_SIZE": 85, "COMMENT": 86, "COMPRESSION": 87, "ENCODING": 88, "(": 89, "StatsList": 90, ")": 91, "StatsList_EDIT": 92, "RightParenthesisOrError": 93, "StatsAssignment": 94, ",": 95, "StatsAssignment_EDIT": 96, "QuotedValue": 97, "FILEFORMAT": 98, "FileFormat": 99, "HdfsLocation": 100, "TBLPROPERTIES": 101, "ParenthesizedPropertyAssignmentList": 102, "SERDEPROPERTIES": 103, "CachedIn": 104, "OptionalWithReplication": 105, "ROW": 106, "FORMAT": 107, "DelimitedRowFormat": 108, "UNCACHED": 109, "AddReplaceColumns": 110, "CHANGE": 111, "ColumnSpecification": 112, "AddReplaceColumns_EDIT": 113, "ColumnSpecification_EDIT": 114, "WithReplication_EDIT": 115, "DelimitedRowFormat_EDIT": 116, "COLUMNS": 117, "ParenthesizedColumnSpecificationList": 118, "ParenthesizedColumnSpecificationList_EDIT": 119, "ExchangePartitionSpec": 120, "OneOrMorePartitionSpecLists": 121, "PartitionSpecList": 122, "ExchangePartitionSpec_EDIT": 123, "OneOrMorePartitionSpecLists_EDIT": 124, "PartitionSpecList_EDIT": 125, "OptionalIfExists": 126, "OptionalIfExists_EDIT": 127, "ColumnIdentifier_EDIT": 128, "TABLE": 129, "SchemaQualifiedTableIdentifier": 130, "SchemaQualifiedTableIdentifier_EDIT": 131, "PartitionSpecWithLocationList": 132, "PartitionSpecWithLocation": 133, "PartitionSpecWithLocation_EDIT": 134, "AlterViewLeftSide": 135, "AS": 136, "QuerySpecification": 137, ".": 138, "AlterViewLeftSide_EDIT": 139, "QuerySpecification_EDIT": 140, "VIEW": 141, "ON": 142, "DATABASE": 143, "IS": 144, "NullableComment": 145, "NULL": 146, "REFRESH": 147, "OptionalPartitionSpec": 148, "FUNCTIONS": 149, "DatabaseIdentifier": 150, "AUTHORIZATION": 151, "OptionalPartitionSpec_EDIT": 152, "INVALIDATE": 153, "METADATA": 154, "COMPUTE": 155, "OptionalParenthesizedColumnList": 156, "OptionalTableSample": 157, "INCREMENTAL": 158, "ParenthesizedColumnList_EDIT": 159, "TableSample_EDIT": 160, "DatabaseDefinition": 161, "TableDefinition": 162, "ViewDefinition": 163, "RoleDefinition": 164, "FunctionDefinition": 165, "DatabaseDefinition_EDIT": 166, "TableDefinition_EDIT": 167, "ViewDefinition_EDIT": 168, "FunctionDefinition_EDIT": 169, "CREATE": 170, "O
terminals_: { 2: "error", 26: "SET", 27: "CURSOR", 38: "ALTER", 41: "OWNER", 44: "ADD", 50: "RANGE", 51: "PARTITION", 53: "PARTITION_VALUE", 54: "=", 56: "RENAME", 57: "TO", 63: "DROP", 64: "DEFAULT", 65: "COLUMN", 66: "STATS", 70: "RECOVER", 71: "PARTITIONS", 73: "REPLACE", 85: "BLOCK_SIZE", 86: "COMMENT", 87: "COMPRESSION", 88: "ENCODING", 89: "(", 91: ")", 95: ",", 98: "FILEFORMAT", 101: "TBLPROPERTIES", 103: "SERDEPROPERTIES", 106: "ROW", 107: "FORMAT", 109: "UNCACHED", 111: "CHANGE", 117: "COLUMNS", 129: "TABLE", 136: "AS", 138: ".", 141: "VIEW", 142: "ON", 143: "DATABASE", 144: "IS", 146: "NULL", 147: "REFRESH", 149: "FUNCTIONS", 151: "AUTHORIZATION", 153: "INVALIDATE", 154: "METADATA", 155: "COMPUTE", 158: "INCREMENTAL", 170: "CREATE", 179: "SINGLE_QUOTE", 180: "DOUBLE_QUOTE", 181: "VALUE", 206: "LIKE_PARQUET", 208: "LIKE", 224: "NOT", 236: "ARRAY", 237: "<", 238: ">", 241: "MAP", 242: "STRUCT", 248: ":", 253: "PRIMARY", 254: "KEY", 256: "PARTITIONED", 257: "BY", 265: "HASH", 269: "SORT", 276: "VALUES", 278: "COMPARISON_OPERATOR", 288: "STORED", 289: "AVRO", 290: "KUDU", 291: "ORC", 292: "PARQUET", 293: "RCFILE", 294: "SEQUENCEFILE", 295: "TEXTFILE", 296: "DELIMITED", 301: "FIELDS", 302: "TERMINATED", 304: "ESCAPED", 305: "LINES", 307: "WITH", 316: "FUNCTION", 322: "AGGREGATE", 342: "...", 343: "RETURNS", 344: "SYMBOL", 345: "INIT_FN", 348: "UPDATE_FN", 349: "MERGE_FN", 350: "PREPARE_FN", 351: "CLOSE_FN", 352: "SERIALIZE_FN", 353: "FINALIZE_FN", 354: "INTERMEDIATE", 360: "ROLE", 361: "LIFECYCLE", 362: "UNSIGNED_INTEGER", 391: "PURGE", 392: "TRUNCATE", 393: "DELETE", 395: "FROM", 405: ";", 409: "SetSpecification_EDIT", 412: "SELECT", 418: "TableExpression_ERROR", 424: "Errors", 426: "ALL", 428: "FULL", 429: "LEFT", 430: "RIGHT", 431: "ANTI", 432: "CROSS", 433: "INNER", 434: "OUTER", 435: "SEMI", 436: "JOIN", 453: "GRANT", 454: "GROUP", 462: "SERVER", 463: "URI", 464: "INSERT", 466: "OPTION", 467: "REVOKE", 484: "UPSERT", 485: "INTO", 488: "OVERWRITE", 489: "SHUFFLE", 490: "NOSHUFFLE", 495: "LOAD", 496: "DATA", 497: "INPATH", 500: "EOF", 504: "REGULAR_IDENTIFIER", 505: "VARIABLE_REFERENCE", 506: "EXPLAIN", 507: "!", 508: "*", 509: "-", 510: "[", 511: "]", 512: "ALLOCATE", 513: "ANALYTIC", 514: "AND", 515: "ANY", 516: "APPX_MEDIAN", 517: "ARE", 518: "ARITHMETIC_OPERATOR", 519: "ARRAY_AGG", 520: "ARRAY_MAX_CARDINALITY", 521: "ASC", 522: "ASENSITIVE", 523: "ASYMMETRIC", 524: "AT", 525: "ATOMIC", 526: "AVG", 527: "BACKTICK", 528: "BEGIN_FRAME", 529: "BEGIN_PARTITION", 530: "BETWEEN", 531: "BIGINT", 532: "BLOB", 533: "BOOLEAN", 534: "BOTH", 535: "BROADCAST", 536: "CACHED", 537: "CALLED", 538: "CARDINALITY", 539: "CASCADE", 540: "CASCADED", 541: "CASE", 542: "CAST", 543: "CHAR", 544: "CHARACTER", 545: "CLOB", 546: "COLLATE", 547: "COLLECT", 548: "COMMIT", 549: "CONDITION", 550: "CONNECT", 551: "CONSTRAINT", 552: "CONTAINS", 553: "CONVERT", 554: "COPY", 555: "CORR", 556: "CORRESPONDING", 557: "COUNT", 558: "COVAR_POP", 559: "COVAR_SAMP", 560: "CUBE", 561: "CURRENT", 562: "CURRENT_DATE", 563: "CURRENT_DEFAULT_TRANSFORM_GROUP", 564: "CURRENT_PATH", 565: "CURRENT_ROLE", 566: "CURRENT_ROW", 567: "CURRENT_SCHEMA", 568: "CURRENT_TIME", 569: "CURRENT_TRANSFORM_GROUP_FOR_TYPE", 570: "CYCLE", 571: "DATABASES", 572: "DEALLOCATE", 573: "DEC", 574: "DECFLOAT", 575: "DECIMAL", 576: "DECLARE", 577: "DEFINE", 578: "DEREF", 579: "DESC", 580: "DETERMINISTIC", 581: "DISCONNECT", 582: "DISTINCT", 583: "DOUBLE", 584: "DYNAMIC", 585: "EACH", 586: "ELEMENT", 587: "ELSE", 588: "EMPTY", 589: "END", 590: "END_FRAME", 591: "END_PARTITION", 592: "EQUALS", 593: "ESCAPE", 594: "EVERY", 595: "EXCEPT", 596: "EXEC", 597: "EXECUTE", 598: "EXISTS", 599: "EXTENDED", 600: "EXTERNAL", 601: "EXTRACT", 602: "FALSE", 603: "FETCH", 604: "FILES", 605: "FILTER", 606: "FIRST", 607: "FLOAT", 608: "FOLLOWING", 609: "FOR", 610: "FOREIGN", 611: "FORMATTED", 612: "FRAME_ROW", 613: "FREE", 614: "FUSION", 615: "GET", 616: "GLOBAL", 617: "GROUP_CONCAT", 618: "GROUPING", 619: "GROUPS", 620: "HAVING", 621: "HDFS_START_QUOTE", 622: "HOLD", 623: "IF", 624: "IGNORE", 62
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], [17, 1], [17, 1], [17, 1], [17, 1], [17, 2], [30, 7], [34, 3], [34, 4], [34, 5], [34, 6], [31, 7], [31, 6], [31, 7], [31, 4], [31, 7], [31, 6], [31, 6], [31, 5], [31, 2], [31, 2], [31, 3], [31, 3], [35, 1], [35, 7], [35, 4], [35, 7], [35, 6], [35, 6], [35, 5], [35, 2], [35, 2], [35, 3], [35, 4], [35, 3], [35, 3], [35, 7], [35, 7], [35, 7], [35, 8], [35, 7], [35, 5], [35, 6], [35, 6], [35, 6], [35, 4], [35, 5], [35, 6], [35, 6], [35, 7], [35, 4], [35, 5], [35, 6], [35, 6], [35, 4], [35, 5], [35, 2], [35, 2], [35, 2], [35, 3], [35, 4], [35, 4], [35, 3], [35, 3], [35, 3], [35, 4], [35, 3], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [59, 0], [59, 1], [67, 3], [81, 3], [90, 1], [90, 3], [92, 1], [92, 3], [92, 5], [92, 3], [94, 3], [96, 1], [69, 3], [69, 2], [69, 3], [69, 3], [69, 3], [69, 4], [69, 2], [69, 1], [69, 3], [82, 1], [82, 2], [82, 3], [82, 4], [82, 3], [82, 2], [82, 2], [82, 4], [82, 3], [82, 3], [82, 4], [82, 5], [82, 4], [110, 3], [113, 3], [113, 4], [120, 4], [120, 4], [123, 4], [123, 4], [121, 3], [121, 5], [124, 3], [124, 5], [68, 3], [68, 3], [68, 5], [68, 6], [68, 3], [83, 3], [83, 3], [83, 4], [83, 2], [83, 4], [83, 5], [83, 5], [83, 5], [83, 2], [83, 3], [83, 3], [43, 3], [72, 3], [72, 3], [84, 1], [84, 1], [48, 0], [48, 1], [132, 1], [132, 2], [76, 1], [76, 2], [76, 2], [76, 3], [134, 2], [134, 2], [133, 2], [32, 5], [32, 3], [32, 4], [32, 6], [36, 1], [36, 2], [36, 3], [36, 4], [36, 5], [36, 3], [36, 3], [36, 3], [36, 4], [135, 3], [139, 3], [139, 3], [33, 6], [37, 2], [37, 3], [37, 4], [37, 5], [37, 6], [145, 1], [145, 1], [5, 3], [5, 3], [5, 2], [18, 2], [18, 3], [18, 4], [18, 3], [18, 3], [6, 2], [6, 3], [19, 2], [19, 3], [19, 3], [19, 3], [7, 5], [7, 5], [20, 2], [20, 3], [20, 3], [20, 4], [20, 6], [20, 5], [20, 5], [20, 5], [20, 3], [20, 5], [20, 4], [20, 5], [20, 6], [20, 5], [8, 1], [8, 1], [8, 1], [8, 1], [8, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 3], [161, 3], [161, 5], [166, 4], [166, 3], [166, 5], [166, 4], [166, 6], [166, 6], [173, 2], [174, 2], [174, 2], [175, 0], [175, 1], [177, 2], [176, 1], [178, 2], [178, 2], [178, 3], [178, 3], [102, 3], [182, 1], [182, 3], [183, 3], [162, 6], [167, 5], [167, 5], [167, 4], [184, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 12], [186, 11], [186, 11], [187, 2], [195, 2], [195, 2], [203, 0], [203, 1], [203, 2], [203, 2], [204, 1], [204, 2], [204, 2], [204, 2], [118, 3], [118, 5], [119, 3], [119, 5], [119, 5], [210, 1], [210, 3], [212, 1], [212, 3], [212, 3], [212, 5], [212, 2], [212, 4], [212, 4], [212, 6], [112, 3], [114, 3], [114, 3], [114, 3], [215, 0], [215, 1], [218, 1], [218, 2], [217, 1], [217, 2], [217, 2], [217, 3], [219, 1], [219, 2], [219, 2], [219, 2], [219, 2], [219, 2], [219, 1], [219, 1], [220, 1], [220, 2], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [216, 1], [216, 1], [216, 1], [227, 4], [230, 3], [233, 4], [233, 4], [228, 6], [231, 3], [234, 6], [234, 4], [234, 6], [234, 5], [229, 4], [232, 3], [235, 4], [243, 1], [243, 3], [244, 1], [244, 2], [244, 3], [244, 3], [244, 5], [245, 4], [246, 5], [246, 4], [246, 4], [246, 4], [246, 3], [246, 3], [249, 1], [249, 3], [250, 1], [250, 2], [250, 3], [250, 3], [250, 5], [251, 2], [251, 2], [251, 1], [251, 1], [240, 1], [240, 1], [211, 2], [213, 1], [213, 2], [213, 2], [221, 2], [225, 2], [188, 0], [188, 1], [255, 3], [255, 3], [255, 5], [255, 3], [255, 5], [260, 3], [260, 1], [196, 2], [196, 3], [196, 3], [196, 2], [196, 2], [196, 3], [196, 3], [196, 3], [196, 5], [196, 5], [196, 5], [258, 1], [258, 3], [261, 1], [261, 3], [261, 5], [263, 4], [264, 3], [264, 2], [264, 4], [264, 4], [259, 3], [262, 2], [262, 2], [262, 3], [262, 3], [262, 3], [189, 0], [189, 1], [268, 3], [197, 2], [197, 3], [266, 3], [267, 3], [267, 3], [270, 1], [270, 3], [271, 1], [271
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(['ALL']);
break;
case 33:
case 2170:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TABLE', 'VIEW']);
break;
case 34:
parser.addDatabaseLocation(_$[$0 - 4], [{ name: $$[$0 - 4] }]);
break;
case 35:
case 196:
case 208:
case 829:
case 1447:
case 2206:
case 2265:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases();
break;
case 36:
parser.addDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
parser.suggestKeywords(['SET OWNER']);
break;
case 37:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
parser.suggestKeywords(['OWNER']);
break;
case 38:
parser.addDatabaseLocation(_$[$0 - 3], [{ name: $$[$0 - 3] }]);
parser.suggestKeywords(['ROLE', 'USER']);
break;
case 43:
case 54:
case 77:
parser.addColumnLocation($$[$0 - 3].location, [$$[$0 - 3].identifier]);
break;
case 44:
case 55:
case 124:
parser.addColumnLocation($$[$0 - 2].location, [$$[$0 - 2].identifier]);
break;
case 45:
case 56:
case 80:
case 81:
case 120:
case 123:
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
break;
case 61:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'IF NOT EXISTS', weight: 4 }, { value: 'COLUMNS', weight: 3 }, { value: 'PARTITION', weight: 2 }, { value: 'RANGE PARTITION', weight: 1 }]);
}
else {
parser.suggestKeywords([{ value: 'PARTITION', weight: 2 }, { value: 'RANGE PARTITION', weight: 1 }]);
}
break;
case 62:
case 88:
parser.suggestKeywords(['COLUMNS']);
break;
case 67:
if (!$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['LOCATION', 'CACHED IN', 'UNCACHED']);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['CACHED IN', 'UNCACHED']);
}
else if ($$[$0 - 1] && $$[$0 - 1].suggestKeywords) {
parser.suggestKeywords($$[$0 - 1].suggestKeywords);
}
break;
case 69:
case 154:
case 426:
case 431:
case 432:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['PARTITION']);
break;
case 70:
case 155:
parser.suggestKeywords(['VALUE']);
break;
case 71:
case 156:
case 440:
case 1474:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['=']);
break;
case 73:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['COLUMN']);
}
parser.suggestColumns();
break;
case 74:
parser.suggestKeywords(['DROP DEFAULT', 'SET BLOCK_SIZE', 'SET COMMENT', 'SET COMPRESSION', 'SET DEFAULT',
'SET ENCODING']);
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
break;
case 75:
parser.suggestKeywords(['DEFAULT']);
parser.addColumnLocation($$[$0 - 2].location, [$$[$0 - 2].identifier]);
break;
case 76:
parser.suggestKeywords(['BLOCK_SIZE', 'COMMENT', 'COMPRESSION', 'DEFAULT', 'ENCODING']);
parser.addColumnLocation($$[$0 - 2].location, [$$[$0 - 2].identifier]);
break;
case 78:
case 225:
case 669:
case 2166:
case 2226:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['STATS']);
break;
case 79:
case 122:
case 159:
case 465:
case 1414:
case 1418:
case 1422:
case 1457:
case 1458:
2019-12-31 18:47:24 +08:00
case 1503:
case 1506:
case 1613:
case 1658:
case 2256:
2019-12-31 18:47:24 +08:00
parser.suggestColumns();
break;
case 82:
case 184:
parser.suggestKeywords(['ROLE', 'USER']);
break;
case 86:
parser.suggestKeywords(['ADD COLUMNS', 'ADD PARTITION', 'ADD RANGE PARTITION', 'ALTER', 'ALTER COLUMN', 'CHANGE',
'DROP COLUMN', 'DROP PARTITION', 'DROP RANGE PARTITION', 'PARTITION', 'RECOVER PARTITIONS', 'RENAME TO',
'REPLACE COLUMNS', 'SET CACHED IN', 'SET COLUMN STATS', 'SET FILEFORMAT', 'SET LOCATION', 'SET OWNER',
'SET ROW FORMAT', 'SET SERDEPROPERTIES', 'SET TBLPROPERTIES', 'SET UNCACHED']);
break;
case 87:
parser.suggestKeywords(['SET CACHED IN', 'SET FILEFORMAT', 'SET LOCATION', 'SET ROW FORMAT',
'SET SERDEPROPERTIES', 'SET TBLPROPERTIES', 'SET UNCACHED']);
break;
case 89:
parser.suggestKeywords(['CACHED IN', 'FILEFORMAT', 'LOCATION', 'ROW FORMAT', 'SERDEPROPERTIES', 'TBLPROPERTIES', 'UNCACHED']);
break;
case 90:
parser.suggestKeywords(['CACHED IN', 'COLUMN STATS', 'FILEFORMAT', 'LOCATION', 'OWNER ROLE', 'OWNER USER', 'ROW FORMAT', 'SERDEPROPERTIES', 'TBLPROPERTIES', 'UNCACHED']);
break;
case 92:
case 188:
case 819:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TO']);
break;
case 93:
case 189:
case 1443:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases({ appendDot: true });
break;
case 94:
case 410:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['PARTITIONS']);
break;
case 111:
parser.suggestIdentifiers(['\'avgSize\'', '\'maxSize\'', '\'numDVs\'', '\'numNulls\'']);
break;
case 125:
case 476:
2019-12-31 18:47:24 +08:00
parser.suggestFileFormats();
break;
case 128:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH REPLICATION =']);
}
break;
case 130:
case 469:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FORMAT']);
break;
case 131:
case 470:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DELIMITED']);
break;
case 132:
case 1888:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1].suggestKeywords) {
parser.suggestKeywords($$[$0 - 1].suggestKeywords);
}
break;
case 149:
parser.addColumnLocation($$[$0].location, [$$[$0].identifier]);
break;
case 150:
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'COLUMN', weight: 1 }, { value: 'PARTITION', weight: 1 }, { value: 'RANGE PARTITION', weight: 1 }, { value: 'IF EXISTS', weight: 2 }]);
parser.suggestColumns();
}
else {
parser.suggestKeywords(['PARTITION', 'RANGE PARTITION']);
}
break;
case 161:
case 190:
case 210:
case 663:
case 683:
case 687:
case 689:
case 826:
case 1534:
case 2165:
case 2169:
case 2214:
case 2225:
case 2245:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
break;
case 162:
case 678:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestTables) {
parser.yy.result.suggestTables.onlyTables = true;
}
break;
case 163:
parser.suggestTables({ onlyTables: true });
parser.suggestDatabases({ appendDot: true });
break;
case 169:
case 468:
case 749:
case 750:
case 751:
case 1567:
case 1595:
case 1616:
case 1629:
case 1633:
case 1651:
case 1674:
case 1700:
case 1701:
case 1778:
case 1780:
case 1848:
case 1858:
case 1865:
case 1877:
case 2023:
case 2261:
case 2305:
case 2306:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0];
break;
case 176:
if (!$$[$0]) {
this.$ = { suggestKeywords: ['LOCATION'] };
}
break;
case 182:
parser.suggestKeywords(['AS', 'RENAME TO', 'SET OWNER']);
break;
case 183:
parser.suggestKeywords(['OWNER ROLE', 'OWNER USER']);
break;
case 186:
case 507:
case 516:
case 1577:
case 1944:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SELECT']);
break;
case 191:
case 688:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestTables) {
parser.yy.result.suggestTables.onlyViews = true;
}
break;
case 192:
parser.suggestTables({ onlyViews: true });
parser.suggestDatabases({ appendDot: true });
break;
case 193:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
break;
case 194:
parser.suggestKeywords(['ON DATABASE']);
break;
case 195:
parser.suggestKeywords(['DATABASE']);
break;
case 197:
parser.addDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
parser.suggestKeywords(['IS']);
break;
case 198:
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
parser.suggestKeywords(['NULL']);
break;
case 201:
case 216:
case 230:
case 664:
case 674:
case 675:
case 694:
case 908:
case 917:
case 918:
case 2182:
case 2215:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
break;
case 202:
case 1535:
2019-12-31 18:47:24 +08:00
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 204:
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
parser.suggestKeywords(['AUTHORIZATION', 'FUNCTIONS']);
break;
case 206:
case 916:
case 2186:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 211:
parser.suggestKeywords(['METADATA']);
break;
case 212:
case 218:
case 227:
case 665:
case 670:
case 700:
case 830:
case 914:
case 1429:
case 2242:
case 2262:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 214:
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['METADATA']);
break;
case 215:
case 222:
case 223:
parser.addTablePrimary($$[$0 - 2]);
break;
case 217:
parser.suggestKeywords(['STATS', 'INCREMENTAL STATS']);
break;
case 220:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['STATS', 'INCREMENTAL STATS']);
break;
case 221:
parser.addTablePrimary($$[$0 - 3]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['TABLESAMPLE']);
}
else if ($$[$0 - 1].suggestKeywords) {
parser.suggestKeywords($$[$0 - 1].suggestKeywords);
}
break;
case 224:
case 668:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['INCREMENTAL']);
break;
case 226:
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['STATS']);
break;
case 229:
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0]) {
parser.suggestKeywords(['PARTITION']);
}
break;
case 240:
if ($$[$0 - 1]) {
parser.suggestKeywords(['TABLE']);
}
else {
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'EXTERNAL TABLE', 'FUNCTION', 'ROLE', 'SCHEMA', 'TABLE', 'VIEW']);
}
break;
case 242:
parser.addNewDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
break;
case 243:
case 266:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 245:
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 246:
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 247:
parser.addNewDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
break;
case 249:
var keywords = [];
if (!$$[$0]) {
keywords.push('LOCATION');
}
if (!$$[$0 - 1] && !$$[$0]) {
keywords.push('COMMENT');
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
break;
case 279:
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 });
keywords.push({ value: 'LIKE PARQUET', 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: 'PARTITIONED BY', weight: 12 });
keywords.push({ value: 'PARTITION BY', weight: 12 });
}
if (!$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'SORT BY', weight: 11 });
}
if (!$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'COMMENT', weight: 10 });
}
if (!$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'ROW FORMAT', 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));
}
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'WITH SERDEPROPERTIES', weight: 6 });
}
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'STORED AS', weight: 5 });
}
if (!$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'LOCATION', weight: 4 });
}
if (!$$[$0 - 2] && !$$[$0 - 1]) {
keywords.push({ value: 'CACHED IN', weight: 3 }, { value: 'UNCACHED', weight: 3 });
}
else if ($$[$0 - 2] && $$[$0 - 2].suggestKeywords && !$$[$0 - 1]) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 3));
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'TBLPROPERTIES', weight: 2 });
}
keywords.push({ value: 'AS', weight: 1 });
}
parser.suggestKeywords(keywords);
break;
case 280:
parser.addNewTableLocation(_$[$0 - 1], $$[$0 - 1], $$[$0]);
this.$ = $$[$0];
break;
case 285:
case 286:
case 1435:
case 1438:
2019-12-31 18:47:24 +08:00
this.$ = [];
break;
case 289:
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
parser.suggestKeywords(['PARQUET']);
break;
case 291:
case 610:
case 612:
2019-12-31 18:47:24 +08:00
case 1349:
case 1352:
case 1436:
case 1476:
case 1541:
case 1682:
case 1861:
case 1941:
case 1998:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
break;
case 292:
case 611:
case 613:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 3];
break;
case 295:
parser.suggestKeywords(['PRIMARY KEY']);
break;
case 296:
case 1433:
case 1569:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0]];
break;
case 297:
this.$ = $$[$0 - 2].concat($$[$0]);
break;
case 302:
case 304:
case 463:
2019-12-31 18:47:24 +08:00
parser.checkForKeywords($$[$0 - 1]);
break;
case 303:
case 305:
parser.checkForKeywords($$[$0 - 3]);
break;
case 306:
this.$ = $$[$0 - 2];
this.$.type = $$[$0 - 1];
var keywords = [];
if (!$$[$0]['primary']) {
keywords.push('PRIMARY KEY');
}
if (!$$[$0]['encoding']) {
keywords.push('ENCODING');
}
if (!$$[$0]['compression']) {
keywords.push('COMPRESSION');
}
if (!$$[$0]['default']) {
keywords.push('DEFAULT');
}
if (!$$[$0]['block_size']) {
keywords.push('BLOCK_SIZE');
}
if (!$$[$0]['null']) {
keywords.push('NOT NULL');
keywords.push('NULL');
}
if (!$$[$0]['comment']) {
keywords.push('COMMENT');
}
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 307:
case 340:
case 346:
case 347:
case 360:
case 363:
case 372:
case 374:
parser.suggestKeywords(parser.getColumnDataTypeKeywords());
break;
case 310:
case 1916:
2019-12-31 18:47:24 +08:00
this.$ = {};
break;
case 312:
this.$ = {};
this.$[$$[$0]] = true;
break;
case 313:
$$[$0 - 1][$$[$0]] = true;
break;
case 318:
this.$ = 'primary';
break;
case 319:
this.$ = 'encoding';
break;
case 320:
this.$ = 'compression';
break;
case 321:
this.$ = 'default';
break;
case 322:
this.$ = 'block_size';
break;
case 323:
case 324:
this.$ = 'null';
break;
case 325:
this.$ = 'comment';
break;
case 327:
parser.suggestKeywords(['NULL']);
break;
case 345:
case 567:
case 578:
case 601:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(parser.getTypeKeywords());
break;
case 359:
case 362:
parser.suggestKeywords(['COMMENT']);
break;
case 383:
parser.suggestKeywords(['KEY']);
break;
case 393:
2019-12-31 18:47:24 +08:00
case 394:
case 397:
case 423:
case 491:
case 492:
case 496:
case 2024:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
break;
case 398:
case 401:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['HASH', 'RANGE']);
break;
case 439:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['VALUE', 'VALUES']);
break;
case 441:
2019-12-31 18:47:24 +08:00
case 447:
case 450:
case 906:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
break;
case 442:
2019-12-31 18:47:24 +08:00
if ($$[$0].endsWithLessThanOrEqual) {
parser.suggestKeywords(['VALUES']);
}
break;
case 443:
case 446:
case 449:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['<', '<=']);
break;
case 444:
2019-12-31 18:47:24 +08:00
case 1389:
case 1392:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['VALUES']);
break;
case 475:
case 1576:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AS']);
break;
case 484:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1] && !$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'FIELDS TERMINATED BY', weight: 2 }, { value: 'LINES TERMINATED BY', weight: 1 }] };
}
else if ($$[$0 - 1] && $$[$0 - 1].suggestKeywords && !$$[$0]) {
this.$ = { suggestKeywords: parser.createWeightedKeywords($$[$0 - 1].suggestKeywords, 2).concat(['LINES TERMINATED BY']) };
}
else if (!$$[$0]) {
this.$ = { suggestKeywords: [{ value: 'LINES TERMINATED BY', weight: 1 }] };
}
break;
case 488:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ESCAPED BY'] };
break;
case 490:
case 495:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TERMINATED BY']);
break;
case 500:
case 501:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SERDEPROPERTIES']);
break;
case 509:
2019-12-31 18:47:24 +08:00
parser.commitLocations();
break;
case 511:
case 524:
case 540:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
parser.suggestDatabases({ appendDot: true });
break;
case 512:
case 525:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 6]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 515:
2019-12-31 18:47:24 +08:00
var keywords = [{ value: 'AS', weight: 1 }];
if (!$$[$0 - 1]) {
keywords.push({ value: 'COMMENT', weight: 3 });
}
parser.suggestKeywords(keywords);
break;
case 526:
case 545:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['RETURNS']);
break;
case 527:
case 546:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['LOCATION']);
break;
case 528:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SYMBOL']);
break;
case 538:
case 656:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FUNCTION']);
break;
case 539:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 13]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 547:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'INIT_FN', weight: 2 }, { value: 'UPDATE_FN', weight: 1 }]);
}
else {
parser.suggestKeywords([{ value: 'UPDATE_FN', weight: 1 }]);
}
break;
case 548:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['MERGE_FN']);
break;
case 549:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'PREPARE_FN', weight: 5 }, { value: 'CLOSE_FN', weight: 4 }, { value: 'SERIALIZE_FN', weight: 3 }, { value: 'FINALIZE_FN', weight: 2 }, { value: 'INTERMEDIATE', weight: 1 }]);
}
else if ($$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'CLOSE_FN', weight: 4 }, { value: 'SERIALIZE_FN', weight: 3 }, { value: 'FINALIZE_FN', weight: 2 }, { value: 'INTERMEDIATE', weight: 1 }]);
}
else if ($$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'SERIALIZE_FN', weight: 3 }, { value: 'FINALIZE_FN', weight: 2 }, { value: 'INTERMEDIATE', weight: 1 }]);
}
else if ($$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'FINALIZE_FN', weight: 2 }, { value: 'INTERMEDIATE', weight: 1 }]);
}
else if ($$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'INTERMEDIATE', weight: 1 }]);
}
break;
case 568:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['...']);
break;
case 603:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
break;
case 607:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['COMMENT']);
}
break;
case 623:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 1]);
break;
case 640:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'FUNCTION', 'INCREMENTAL STATS', 'ROLE', 'SCHEMA', 'STATS', 'TABLE', 'VIEW']);
break;
case 644:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestDatabases();
break;
case 645:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
break;
case 647:
case 652:
case 657:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 3]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 650:
case 651:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestDatabases({ appendDot: true });
break;
case 654:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE']);
break;
case 667:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['INCREMENTAL']);
break;
case 673:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['PARTITION']);
break;
case 677:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestTables({ onlyTables: true });
parser.suggestDatabases({
appendDot: true
});
break;
case 680:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PURGE']);
}
break;
case 684:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestTables({ onlyViews: true });
parser.suggestDatabases({ appendDot: true });
break;
case 685:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 690:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TABLE']);
break;
case 691:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 695:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 698:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
if (!$$[$0 - 1]) {
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
}
break;
case 701:
2019-12-31 18:47:24 +08:00
var keywords = [{ value: 'FULL JOIN', weight: 1 }, { value: 'FULL OUTER JOIN', weight: 1 }, { value: 'JOIN', weight: 1 }, { value: 'LEFT JOIN', weight: 1 }, { value: 'LEFT OUTER JOIN', weight: 1 }, { value: 'RIGHT JOIN', weight: 1 }, { value: 'RIGHT OUTER JOIN', weight: 1 }, { value: 'INNER JOIN', weight: 1 }, { value: 'LEFT ANTI JOIN', weight: 1 }, { value: 'LEFT SEMI JOIN', weight: 1 }, { value: 'RIGHT ANTI JOIN', weight: 1 }, { value: 'RIGHT SEMI JOIN', weight: 1 }];
if (!$$[$0]) {
keywords.push({ value: 'WHERE', weight: 3 });
}
if ($$[$0 - 2].suggestJoinConditions) {
parser.suggestJoinConditions($$[$0 - 2].suggestJoinConditions);
}
if ($$[$0 - 2].suggestJoins) {
parser.suggestJoins($$[$0 - 2].suggestJoins);
}
if ($$[$0 - 2].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 2));
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
break;
case 714:
case 925:
case 927:
2019-12-31 18:47:24 +08:00
parser.addStatementLocation(_$[$0]);
break;
case 716:
case 717:
2019-12-31 18:47:24 +08:00
parser.suggestDdlAndDmlKeywords(['EXPLAIN']);
break;
case 718:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INSERT', 'SELECT']);
break;
case 732:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0]);
this.$ = { selectList: $$[$0] };
break;
case 733:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1]);
this.$ = { selectList: $$[$0 - 1], tableExpression: $$[$0] };
break;
case 734:
2019-12-31 18:47:24 +08:00
parser.selectListNoTableSuggest($$[$0 - 1], $$[$0 - 3]);
break;
case 736:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0]);
if ($$[$0].cursorAtStart) {
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 1] && !$$[$0 - 2]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'STRAIGHT_JOIN', weight: 1 });
}
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 - 2] || $$[$0 - 2] === 'ALL')) {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
break;
case 737:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0], true);
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2] || $$[$0 - 2] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 1] && !$$[$0 - 2]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'STRAIGHT_JOIN', weight: 1 });
}
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 738:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1]);
break;
case 739:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1]);
parser.selectListNoTableSuggest($$[$0 - 1], $$[$0 - 3]);
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'select';
}
break;
case 740:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1], true);
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 3] || $$[$0 - 3] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 2] && !$$[$0 - 3]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
if (!$$[$0 - 2]) {
keywords.push({ value: 'STRAIGHT_JOIN', weight: 1 });
}
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 741:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5]), _$[$0 - 2]);
parser.checkForSelectListKeywords($$[$0 - 2]);
break;
case 742:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5], $$[$0 - 6], _$[$0 - 6]), _$[$0 - 3]);
parser.checkForSelectListKeywords($$[$0 - 3]);
break;
case 743:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$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 752:
case 753:
2019-12-31 18:47:24 +08:00
this.$ = { cursorAtStart: false, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 754:
case 1852:
case 1853:
2019-12-31 18:47:24 +08:00
this.$ = { cursorAtStart: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 760:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['JOIN', 'OUTER JOIN']);
break;
case 761:
case 762:
parser.suggestKeywords(['ANTI JOIN', 'INNER JOIN', 'JOIN', 'OUTER JOIN', 'SEMI JOIN']);
break;
2019-12-31 18:47:24 +08:00
case 763:
case 764:
case 765:
case 766:
2019-12-31 18:47:24 +08:00
case 767:
case 768:
case 770:
case 771:
2019-12-31 18:47:24 +08:00
case 772:
case 773:
case 775:
case 776:
case 777:
case 778:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['JOIN'] };
break;
case 769:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['OUTER'] };
break;
case 774:
case 779:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ANTI', 'INNER', 'OUTER', 'SEMI'] };
break;
case 780:
2019-12-31 18:47:24 +08:00
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'GROUP BY', weight: 6 }, { value: 'HAVING', weight: 5 }, { value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true, true, true]),
cursorAtEnd: !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
};
break;
case 781:
2019-12-31 18:47:24 +08:00
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true]),
cursorAtEnd: !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
};
break;
case 782:
2019-12-31 18:47:24 +08:00
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [{ value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true]),
cursorAtEnd: !$$[$0 - 1] && !$$[$0]
};
break;
case 783:
2019-12-31 18:47:24 +08:00
this.$ = {
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'OFFSET', weight: 2 }], [true]),
cursorAtEnd: !$$[$0]
};
break;
case 798:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'where';
}
break;
case 799:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'group by';
}
break;
case 801:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'order by';
}
break;
case 804:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'GROUP BY', weight: 6 }, { value: 'HAVING', weight: 5 }, { value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true, true, true]);
if ($$[$0 - 6].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 6].suggestKeywords, 1));
}
this.$ = parser.getValueExpressionKeywords($$[$0 - 6], keywords);
this.$.cursorAtEnd = !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0];
if ($$[$0 - 6].columnReference) {
this.$.columnReference = $$[$0 - 6].columnReference;
}
if (!$$[$0 - 4]) {
parser.suggestGroupBys({ prefix: 'GROUP BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2]) {
parser.suggestOrderBys({ prefix: 'ORDER BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
this.$.whereClauseLocation = $$[$0 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 6], _$[$0 - 6]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
break;
case 805:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'HAVING', weight: 5 }, { value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true, true]);
if ($$[$0 - 5].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 5].suggestKeywords, 6));
}
if ($$[$0 - 5].valueExpression) {
this.$ = parser.getValueExpressionKeywords($$[$0 - 5].valueExpression, keywords);
if ($$[$0 - 5].valueExpression.columnReference) {
this.$.columnReference = $$[$0 - 5].valueExpression.columnReference;
}
}
else {
this.$ = { suggestKeywords: keywords };
}
this.$.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 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 5], _$[$0 - 5]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
break;
case 806:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'ORDER BY', weight: 5 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [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 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 4], _$[$0 - 4]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
break;
case 807:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [{ value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true]);
if ($$[$0 - 3].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 3].suggestKeywords, 4));
}
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0 - 1] && !$$[$0] };
this.$.whereClauseLocation = $$[$0 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 3], _$[$0 - 3]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
break;
case 808:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'OFFSET', weight: 2 }], [true]);
this.$ = { suggestKeywords: keywords, cursorAtEnd: !$$[$0] };
this.$.whereClauseLocation = $$[$0 - 6] ? _$[$0 - 6] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5], $$[$0 - 6], _$[$0 - 6]);
this.$.limitClauseLocation = _$[$0 - 2];
break;
case 812:
case 849:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DROP', 'INSERT', 'REFRESH', 'ROLE', 'SELECT']);
break;
case 813:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TO GROUP']);
break;
case 814:
case 851:
case 2222:
case 2223:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GROUP']);
break;
case 816:
case 853:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1].isCreate) {
parser.suggestKeywords(['ON DATABASE', 'ON SERVER']);
}
else {
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
}
break;
case 817:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].isCreate) {
parser.suggestKeywords(['DATABASE', 'SERVER']);
}
else {
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
}
break;
case 820:
case 857:
case 2202:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
break;
case 821:
case 823:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH GRANT OPTION']);
}
break;
case 825:
case 2198:
2019-12-31 18:47:24 +08:00
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 834:
2019-12-31 18:47:24 +08:00
this.$ = { isCreate: true };
break;
case 844:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GRANT OPTION']);
break;
case 845:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['OPTION']);
break;
case 850:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM GROUP']);
break;
case 854:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].isCreate) {
parser.suggestKeywords(['DATABASE', 'SERVER']);
}
else {
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
}
break;
case 856:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
break;
case 862:
2019-12-31 18:47:24 +08:00
this.$ = { selectList: $$[$0] };
break;
case 863:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
this.$.cursorAtEnd = true;
break;
case 864:
2019-12-31 18:47:24 +08:00
parser.selectListNoTableSuggest($$[$0], $$[$0 - 2]);
break;
case 865:
2019-12-31 18:47:24 +08:00
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2] || $$[$0 - 2] === 'ALL') {
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
}
if (!$$[$0 - 1] && !$$[$0 - 2]) {
keywords.push({ value: 'ALL', weight: 2 });
keywords.push({ value: 'DISTINCT', weight: 2 });
}
if (!$$[$0 - 1]) {
keywords.push({ value: 'STRAIGHT_JOIN', weight: 1 });
}
parser.suggestKeywords(keywords);
parser.suggestFunctions();
parser.suggestColumns();
break;
case 871:
2019-12-31 18:47:24 +08:00
var keywords = $$[$0 - 2].suggestKeywords && !$$[$0 - 1] ? parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 2) : [];
if (!$$[$0 - 1]) {
keywords = keywords.concat(['[NOSHUFFLE]', '[SHUFFLE]', 'SELECT', 'VALUES']);
}
else {
keywords = keywords.concat(['SELECT']);
}
parser.suggestKeywords(keywords);
break;
case 881:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].owner = 'upsert';
parser.addTablePrimary($$[$0 - 1]);
break;
case 882:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INTO']);
break;
case 883:
case 889:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['TABLE']);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 884:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 3]) {
parser.suggestKeywords(['TABLE']);
}
$$[$0 - 1].owner = 'upsert';
parser.addTablePrimary($$[$0 - 1]);
break;
case 886:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].owner = 'upsert';
parser.addTablePrimary($$[$0 - 1]);
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.owner = 'upsert';
}
break;
case 887:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0]) {
this.$ = { suggestKeywords: ['PARTITION'] };
}
break;
case 888:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INTO', 'OVERWRITE']);
break;
case 890:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 4]) {
parser.suggestKeywords(['TABLE']);
}
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
break;
case 892:
case 893:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.owner = 'insert';
}
break;
case 909:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DATA INPATH']);
break;
case 910:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INPATH']);
break;
case 912:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
}
else {
parser.suggestKeywords(['INTO TABLE']);
}
break;
case 913:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TABLE']);
break;
case 922:
case 923:
2019-12-31 18:47:24 +08:00
return parser.yy.result;
break;
case 924:
2019-12-31 18:47:24 +08:00
parser.prepareNewStatement();
break;
case 926:
case 928:
2019-12-31 18:47:24 +08:00
parser.addStatementLocation(_$[$0 - 3]);
break;
case 946:
2019-12-31 18:47:24 +08:00
parser.suggestDdlAndDmlKeywords();
break;
case 1350:
case 1353:
case 1477:
2019-12-31 18:47:24 +08:00
this.$ = '';
break;
case 1373:
case 1376:
2019-12-31 18:47:24 +08:00
parser.yy.correlatedSubQuery = false;
break;
case 1374:
case 1378:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['EXISTS']);
break;
case 1377:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['NOT EXISTS']);
break;
case 1388:
case 1390:
case 1391:
case 1393:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['<', '<=', '<>', '=', '>', '>=']);
break;
case 1426:
case 1478:
2019-12-31 18:47:24 +08:00
parser.addTableLocation(_$[$0], [{ name: $$[$0] }]);
this.$ = { identifierChain: [{ name: $$[$0] }] };
break;
case 1427:
case 1479:
2019-12-31 18:47:24 +08:00
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
parser.addTableLocation(_$[$0], [{ name: $$[$0 - 2] }, { name: $$[$0] }]);
this.$ = { identifierChain: [{ name: $$[$0 - 2] }, { name: $$[$0] }] };
break;
case 1428:
2019-12-31 18:47:24 +08:00
// This is a special case for expression like "SELECT | FROM db.table.col"
this.$ = { identifierChain: [{ name: $$[$0 - 3] }, { name: $$[$0 - 1] }].concat($$[$0]) };
break;
case 1430:
case 1444:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases();
this.$ = { identifierChain: [{ name: $$[$0 - 2] }] };
break;
case 1431:
2019-12-31 18:47:24 +08:00
// You can have statements like 'SELECT ... FROM testTable t, t.|'
parser.suggestTablesOrColumns($$[$0 - 2]);
break;
case 1432:
2019-12-31 18:47:24 +08:00
// TODO: switch to suggestColumns, it's currently handled in sqlAutocompleter2.js
// Issue is that suggestColumns is deleted if no tables are defined and this is
// only cases like "SELECT | FROM db.table.col"
parser.suggestTables({ identifierChain: [{ name: $$[$0 - 3] }, { name: $$[$0 - 1] }].concat($$[$0]) });
break;
case 1434:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].push($$[$0]);
break;
case 1437:
case 1543:
case 1863:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2];
break;
case 1439:
2019-12-31 18:47:24 +08:00
this.$ = { name: $$[$0] };
break;
case 1441:
2019-12-31 18:47:24 +08:00
this.$ = [{ name: $$[$0] }];
break;
case 1442:
2019-12-31 18:47:24 +08:00
this.$ = [{ name: $$[$0 - 2] }, { name: $$[$0 - 1] }];
break;
case 1456:
case 1618:
case 1619:
case 1625:
case 1626:
case 1937:
case 2025:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
break;
case 1464:
case 1467:
2019-12-31 18:47:24 +08:00
if (!$$[$0]) {
this.$ = { suggestKeywords: ['WITH REPLICATION ='] };
}
break;
case 1469:
case 2183:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['IN']);
break;
case 1473:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['REPLICATION =']);
break;
case 1480:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ prependDot: true });
break;
case 1481:
2019-12-31 18:47:24 +08:00
parser.suggestTablesOrColumns($$[$0 - 2]);
break;
case 1483:
2019-12-31 18:47:24 +08:00
this.$ = { identifierChain: $$[$0 - 1].identifierChain, alias: $$[$0] };
break;
case 1486:
2019-12-31 18:47:24 +08:00
parser.yy.locations[parser.yy.locations.length - 1].type = 'column';
break;
case 1487:
case 1814:
2019-12-31 18:47:24 +08:00
parser.addAsteriskLocation(_$[$0], $$[$0 - 2].concat({ asterisk: true }));
break;
case 1489:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0].identifier];
parser.yy.firstChainLocation = parser.addUnknownLocation($$[$0].location, [$$[$0].identifier]);
break;
case 1490:
2019-12-31 18:47:24 +08:00
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 1491:
case 1499:
2019-12-31 18:47:24 +08:00
if ($$[$0].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1492:
case 1500:
2019-12-31 18:47:24 +08:00
if ($$[$0].insideKey) {
parser.suggestKeyValues({ identifierChain: $$[$0 - 2].concat([$$[$0].identifier]) });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1495:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({
identifierChain: $$[$0 - 2]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1496:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({
identifierChain: $$[$0 - 4]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1497:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0].identifier];
break;
case 1498:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].push($$[$0].identifier);
break;
case 1501:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].insideKey) {
parser.suggestKeyValues({ identifierChain: $$[$0 - 4].concat([$$[$0 - 2].identifier]) });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1502:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0 - 2].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1504:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({ identifierChain: $$[$0 - 2] });
break;
case 1505:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({ identifierChain: $$[$0 - 4] });
break;
case 1507:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0] }, location: _$[$0] };
break;
case 1508:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3], keySet: true }, location: _$[$0 - 3] };
break;
case 1509:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 2], keySet: true }, location: _$[$0 - 2] };
break;
case 1510:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3] }, insideKey: true };
break;
case 1511:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3] } };
break;
case 1536:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords([{ value: 'DATABASE', weight: 2 }, { value: 'EXTENDED', weight: 1 }, { value: 'FORMATTED', weight: 1 }]);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1538:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
if (!$$[$0 - 2]) {
parser.suggestKeywords([{ value: 'DATABASE', weight: 2 }, { value: 'EXTENDED', weight: 1 }, { value: 'FORMATTED', weight: 1 }]);
}
break;
case 1539:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
parser.suggestDatabases();
break;
case 1540:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 1546:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 3]);
break;
case 1547:
case 1548:
case 1572:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 2]);
break;
case 1562:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'DISTINCT', 'SELECT']);
break;
case 1563:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'DISTINCT']);
break;
case 1570:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2].concat([$$[$0]]);
break;
case 1574:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 4]);
break;
case 1575:
2019-12-31 18:47:24 +08:00
parser.addCteAliasLocation(_$[$0 - 4], $$[$0 - 4]);
$$[$0 - 1].alias = $$[$0 - 4];
this.$ = $$[$0 - 1];
break;
case 1582:
case 1583:
2019-12-31 18:47:24 +08:00
parser.addClauseLocation('whereClause', _$[$0 - 1], $$[$0].whereClauseLocation);
parser.addClauseLocation('limitClause', $$[$0].limitClausePreceding || _$[$0 - 1], $$[$0].limitClauseLocation);
break;
case 1584:
2019-12-31 18:47:24 +08:00
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 (typeof $$[$0 - 3].tableReferenceList.hasJoinCondition !== 'undefined' && !$$[$0 - 3].tableReferenceList.hasJoinCondition) {
keywords.push({ value: 'ON', weight: 3 });
keywords.push({ value: 'USING', 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].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].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(['FULL', 'FULL OUTER', 'LEFT', 'LEFT OUTER', 'RIGHT', 'RIGHT OUTER']);
keywords = keywords.concat(['ANTI', 'CROSS', 'INNER', 'LEFT ANTI', 'LEFT INNER', 'LEFT SEMI', 'OUTER', 'RIGHT ANTI', 'RIGHT INNER', 'RIGHT SEMI', 'SEMI']);
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: 'ANTI 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 ANTI JOIN', weight: 1 },
{ value: 'LEFT INNER JOIN', weight: 1 },
{ value: 'LEFT JOIN', weight: 1 },
{ value: 'LEFT OUTER JOIN', weight: 1 },
{ value: 'LEFT SEMI JOIN', weight: 1 },
{ value: 'OUTER JOIN', weight: 1 },
{ value: 'RIGHT ANTI JOIN', weight: 1 },
{ value: 'RIGHT INNER JOIN', weight: 1 },
{ value: 'RIGHT JOIN', weight: 1 },
{ value: 'RIGHT OUTER JOIN', weight: 1 },
{ value: 'RIGHT SEMI JOIN', weight: 1 },
{ value: 'SEMI JOIN', weight: 1 }
]);
parser.suggestKeywords(keywords);
break;
case 1585:
2019-12-31 18:47:24 +08:00
// 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 1589:
2019-12-31 18:47:24 +08:00
this.$ = { tableReferenceList: $$[$0] };
break;
case 1590:
case 1870:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1592:
2019-12-31 18:47:24 +08:00
var keywords = parser.getKeywordsForOptionalsLR([$$[$0 - 5], $$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'WHERE', weight: 9 },
{ value: 'GROUP BY', weight: 8 },
{ value: 'HAVING', weight: 7 },
{ value: 'ORDER BY', weight: 5 },
{ value: 'LIMIT', weight: 3 },
{ value: 'OFFSET', weight: 2 }], [true, true, true, true, true, true]);
if (keywords.length > 0) {
this.$ = { suggestKeywords: keywords, empty: !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0] };
}
else {
this.$ = {};
}
this.$.whereClauseLocation = $$[$0 - 5] ? _$[$0 - 5] : undefined;
this.$.limitClausePreceding = parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4], $$[$0 - 5], _$[$0 - 5]);
this.$.limitClauseLocation = $$[$0 - 1] ? _$[$0 - 1] : undefined;
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]) {
this.$.suggestFilters = { prefix: 'WHERE', tablePrimaries: parser.yy.latestTablePrimaries.concat() };
}
if (!$$[$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 1596:
2019-12-31 18:47:24 +08:00
if ($$[$0].suggestFilters) {
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1597:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
parser.suggestKeywords(['EXISTS', 'NOT EXISTS']);
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1600:
2019-12-31 18:47:24 +08:00
this.$ = { valueExpression: $$[$0] };
break;
case 1601:
case 1640:
2019-12-31 18:47:24 +08:00
parser.suggestSelectListAliases();
break;
case 1602:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestSelectListAliases();
parser.suggestGroupBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1603:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
parser.suggestGroupBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1630:
2019-12-31 18:47:24 +08:00
if ($$[$0].emptyOrderBy) {
parser.suggestOrderBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1631:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
parser.suggestOrderBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1635:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: false };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 1636:
case 1637:
case 1638:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: false };
break;
case 1639:
2019-12-31 18:47:24 +08:00
this.$ = parser.mergeSuggestKeywords($$[$0 - 1], $$[$0]);
break;
case 1642:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: true };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 1643:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ASC', 'DESC'] };
break;
case 1646:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['NULLS FIRST', 'NULLS LAST'] };
break;
case 1649:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FIRST', 'LAST']);
break;
case 1656:
2019-12-31 18:47:24 +08:00
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
this.$ = $$[$0];
break;
case 1662:
case 1667:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['BIGINT'] });
break;
case 1663:
case 1668:
2019-12-31 18:47:24 +08:00
delete parser.yy.result.suggestColumns;
break;
case 1672:
case 1673:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 1675:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0], 'NUMBER');
this.$ = $$[$0];
$$[$0].types = ['NUMBER'];
break;
case 1676:
case 1677:
case 1678:
case 1679:
case 1680:
2019-12-31 18:47:24 +08:00
case 1687:
case 1688:
case 1689:
case 1690:
case 1691:
case 1692:
case 1698:
case 1699:
case 1720:
case 1774:
case 1775:
case 1837:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'] };
break;
case 1681:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'] };
// clear correlated flag after completed sub-query (set by lexer)
parser.yy.correlatedSubQuery = false;
break;
case 1683:
case 1684:
case 1685:
case 1686:
2019-12-31 18:47:24 +08:00
parser.addColRefToVariableIfExists($$[$0 - 2], $$[$0]);
this.$ = { types: ['BOOLEAN'] };
break;
case 1693:
case 1694:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0-2], 'BOOLEAN');
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 1695:
case 1696:
case 1697:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0-2], 'NUMBER');
// verifyType($$[$0], 'NUMBER');
this.$ = { types: ['NUMBER'] };
break;
case 1703:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BETWEEN', 'EXISTS', 'IN', 'ILIKE', 'IREGEXP', 'LIKE', 'REGEXP', 'RLIKE']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1704:
case 1706:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1705:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
parser.suggestKeywords(['EXISTS']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1707:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['BOOLEAN'] });
parser.suggestColumns({ types: ['BOOLEAN'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 1708:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'], suggestFilters: $$[$0].suggestFilters };
break;
case 1709:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
this.$ = { types: ['T'] };
break;
case 1710:
2019-12-31 18:47:24 +08:00
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions('NUMBER');
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
break;
case 1711:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['NUMBER'] });
parser.suggestColumns({ types: ['NUMBER'] });
this.$ = { types: ['NUMBER'] };
break;
case 1712:
2019-12-31 18:47:24 +08:00
var keywords = ['FALSE', 'NOT NULL', 'NOT TRUE', 'NOT FALSE', 'NULL', 'TRUE', 'DISTINCT FROM', 'NOT DISTINCT FROM', 'NOT UNKNOWN', 'UNKNOWN'];
parser.suggestKeywords(keywords);
this.$ = { types: ['BOOLEAN'] };
break;
case 1713:
2019-12-31 18:47:24 +08:00
var keywords = ['FALSE', 'NULL', 'TRUE', 'DISTINCT FROM', 'UNKNOWN'];
parser.suggestKeywords(keywords);
this.$ = { types: ['BOOLEAN'] };
break;
case 1714:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1715:
case 1716:
case 1717:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['NOT']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1718:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 5], $$[$0 - 3] ? 'IS NOT DISTINCT FROM' : 'IS DISTINCT FROM');
this.$ = { types: ['BOOLEAN'] };
break;
case 1719:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1721:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
break;
case 1722:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 1723:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1724:
case 1725:
case 1726:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
2019-12-31 18:47:24 +08:00
case 1727:
case 1728:
case 1729:
case 1730:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions($$[$0].types);
parser.addColRefIfExists($$[$0]);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1731:
case 1733:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1732:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: true };
break;
case 1734:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: $$[$0 - 1] === '<=' };
break;
case 1735:
case 1736:
case 1737:
case 1738:
2019-12-31 18:47:24 +08:00
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 2].types);
parser.addColRefIfExists($$[$0 - 2]);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1739:
2019-12-31 18:47:24 +08:00
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 1740:
2019-12-31 18:47:24 +08:00
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 1741:
case 1742:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
break;
case 1743:
case 1744:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
break;
case 1745:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 3].suggestFilters };
break;
case 1746:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1747:
case 1751:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1], ['AND']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1748:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1749:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].types[0] === $$[$0].types[0] && !$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 2].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1750:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].types[0] === $$[$0].types[0] && !$$[$0].typeSet) {
parser.applyTypeToSuggestions($$[$0 - 2].types);
}
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1752:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0 - 2].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1753:
case 1755:
case 1757:
case 1759:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true, suggestFilters: true };
break;
case 1754:
case 1758:
parser.addColRefIfExists($$[$0]);
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1756:
case 1760:
2019-12-31 18:47:24 +08:00
parser.addColRefIfExists($$[$0 - 2]);
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1761:
case 1762:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 1763:
case 1764:
case 1765:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2].typeSet) {
parser.applyTypeToSuggestions(['NUMBER']);
parser.addColRefIfExists($$[$0]);
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1766:
case 1767:
case 1768:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 1769:
case 1770:
case 1771:
2019-12-31 18:47:24 +08:00
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions(['NUMBER']);
parser.addColRefIfExists($$[$0 - 2]);
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
break;
case 1772:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 1773:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1776:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1777:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1] + ' ' + $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1779:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 1781:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 1782:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0];
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
break;
case 1783:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 1784:
case 2071:
case 2076:
case 2077:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'] };
break;
case 1785:
case 1787:
2019-12-31 18:47:24 +08:00
$$[$0].position = 1;
break;
case 1786:
2019-12-31 18:47:24 +08:00
$$[$0].position = $$[$0 - 2].position + 1;
this.$ = $$[$0];
break;
case 1788:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].position += 1;
break;
case 1789:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].position = 1;
break;
case 1790:
2019-12-31 18:47:24 +08:00
$$[$0 - 4].position += 1;
break;
case 1791:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
$$[$0 - 2].position += 1;
break;
case 1792:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
$$[$0 - 4].position += 1;
break;
case 1793:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 3]);
break;
case 1794:
case 1795:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { cursorAtStart: true, position: 1 };
break;
case 1796:
case 1797:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { position: 2 };
break;
case 1801:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['COLREF'], columnReference: $$[$0].chain };
break;
case 1802:
2019-12-31 18:47:24 +08:00
// 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 1803:
2019-12-31 18:47:24 +08:00
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 1805:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['NULL'] };
break;
case 1806:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['TIMESTAMP'] };
break;
case 1808:
2019-12-31 18:47:24 +08:00
if ($$[$0].suggestKeywords) {
this.$ = { types: ['COLREF'], columnReference: $$[$0], suggestKeywords: $$[$0].suggestKeywords };
}
else {
this.$ = { types: ['COLREF'], columnReference: $$[$0] };
}
break;
case 1809:
2019-12-31 18:47:24 +08:00
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 1810:
case 1985:
case 1986:
2019-12-31 18:47:24 +08:00
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
if ($$[$0].position) {
parser.applyArgumentTypesToSuggestions($$[$0 - 1], $$[$0].position);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 1]) };
break;
case 1813:
2019-12-31 18:47:24 +08:00
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 1817:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DAYS', 'HOURS', 'MICROSECONDS', 'MILLISECONDS', 'MINUTES', 'MONTHS', 'NANOSECONDS', 'SECONDS', 'WEEKS', 'YEARS']);
break;
case 1822:
2019-12-31 18:47:24 +08:00
parser.suggestValues($$[$0]);
break;
case 1823:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['NUMBER'] };
break;
case 1829:
case 1831:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1] + $$[$0];
break;
case 1830:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2] + $$[$0 - 1] + $$[$0];
break;
case 1835:
case 1836:
2019-12-31 18:47:24 +08:00
if (/\$\{[^}]*\}/.test($$[$0])) {
parser.addVariableLocation(_$[$0], $$[$0]);
this.$ = { types: ['STRING'], columnReference: [{ name: $$[$0] }] };
}
else {
this.$ = { types: ['STRING'] };
}
break;
case 1838:
2019-12-31 18:47:24 +08:00
this.$ = { partialQuote: '\'', missingEndQuote: parser.yy.missingEndQuote };
break;
case 1839:
2019-12-31 18:47:24 +08:00
this.$ = { partialQuote: '"', missingEndQuote: parser.yy.missingEndQuote };
break;
case 1844:
2019-12-31 18:47:24 +08:00
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 1845:
2019-12-31 18:47:24 +08:00
parser.addAsteriskLocation(_$[$0], [{ asterisk: true }]);
this.$ = { asterisk: true };
break;
case 1846:
2019-12-31 18:47:24 +08:00
if ($$[$0]) {
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
}
break;
case 1847:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
parser.addColumnAliasLocation(_$[$0], $$[$0], _$[$0 - 2]);
this.$ = { suggestAggregateFunctions: true };
break;
case 1849:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0]];
break;
case 1850:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].push($$[$0]);
break;
case 1855:
2019-12-31 18:47:24 +08:00
parser.checkForSelectListKeywords($$[$0 - 2]);
break;
case 1856:
2019-12-31 18:47:24 +08:00
parser.checkForSelectListKeywords($$[$0 - 3]);
break;
case 1857:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestTables: true, suggestDatabases: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 1859:
case 1860:
case 1862:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true, };
break;
case 1873:
2019-12-31 18:47:24 +08:00
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 1880:
2019-12-31 18:47:24 +08:00
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 1881:
2019-12-31 18:47:24 +08:00
if ($$[$0] && $$[$0].valueExpression) {
this.$ = $$[$0].valueExpression;
}
else {
this.$ = {};
}
this.$.joinType = $$[$0 - 4];
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 1882:
2019-12-31 18:47:24 +08:00
this.$ = { joinType: $$[$0 - 1] };
break;
case 1883:
2019-12-31 18:47:24 +08:00
this.$ = { joinType: $$[$0 - 2] };
break;
case 1887:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 3].suggestKeywords) {
parser.suggestKeywords($$[$0 - 3].suggestKeywords);
}
break;
case 1891:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2]) {
parser.suggestKeywords(['[BROADCAST]', '[SHUFFLE]']);
}
if (!$$[$0 - 2] && 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 - 3],
tables: tables
});
}
}
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
break;
case 1896:
2019-12-31 18:47:24 +08:00
this.$ = 'JOIN';
break;
case 1897:
2019-12-31 18:47:24 +08:00
this.$ = 'ANTI JOIN';
break;
case 1898:
2019-12-31 18:47:24 +08:00
this.$ = 'CROSS JOIN';
break;
case 1899:
2019-12-31 18:47:24 +08:00
this.$ = 'INNER JOIN';
break;
case 1900:
2019-12-31 18:47:24 +08:00
this.$ = 'OUTER JOIN';
break;
case 1901:
2019-12-31 18:47:24 +08:00
this.$ = 'SEMI JOIN';
break;
case 1902:
2019-12-31 18:47:24 +08:00
this.$ = 'FULL JOIN';
break;
case 1903:
2019-12-31 18:47:24 +08:00
this.$ = 'FULL OUTER JOIN';
break;
case 1904:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT JOIN';
break;
case 1905:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT ANTI JOIN';
break;
case 1906:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT INNER JOIN';
break;
case 1907:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT OUTER JOIN';
break;
case 1908:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT SEMI JOIN';
break;
case 1909:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT JOIN';
break;
case 1910:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT ANTI JOIN';
break;
case 1911:
case 1912:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT OUTER JOIN';
break;
case 1913:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT SEMI JOIN';
break;
case 1914:
2019-12-31 18:47:24 +08:00
this.$ = { noJoinCondition: true, suggestKeywords: ['ON', 'USING'] };
break;
case 1915:
2019-12-31 18:47:24 +08:00
this.$ = { valueExpression: $$[$0] };
break;
case 1920:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestJoinConditions({ prependOn: false });
break;
case 1921:
2019-12-31 18:47:24 +08:00
this.$ = {
primary: $$[$0 - 2]
};
if ($$[$0 - 2].identifierChain) {
if ($$[$0 - 1]) {
$$[$0 - 2].alias = $$[$0 - 1].alias;
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
parser.addTablePrimary($$[$0 - 2]);
}
var keywords = [];
if ($$[$0] && $$[$0].suggestKeywords) {
keywords = $$[$0].suggestKeywords;
}
else if (!$$[$0 - 1] && !$$[$0]) {
keywords = [{ value: 'AS', weight: 2 }, { value: 'TABLESAMPLE', weight: 3 }];
}
else if (!$$[$0]) {
keywords = [{ value: 'TABLESAMPLE', weight: 3 }];
}
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 1922:
2019-12-31 18:47:24 +08:00
this.$ = {
primary: $$[$0 - 2]
};
if ($$[$0 - 1]) {
this.$.primary.alias = $$[$0 - 1].alias;
parser.addTablePrimary({ subQueryAlias: $$[$0 - 1].alias });
parser.addSubqueryAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
var keywords = [];
if ($$[$0] && $$[$0].suggestKeywords) {
keywords = $$[$0].suggestKeywords;
}
else {
keywords = parser.getKeywordsForOptionalsLR([$$[$0], $$[$0 - 1]], [{ value: 'TABLESAMPLE', weight: 1 }, { value: 'AS', weight: 2 }], [true, true]);
}
if (keywords.length > 0) {
this.$.suggestKeywords = keywords;
}
break;
case 1923:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1]) {
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
break;
case 1924:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1]) {
$$[$0 - 2].alias = $$[$0 - 1].alias;
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
parser.addTablePrimary($$[$0 - 2]);
break;
case 1925:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1]) {
parser.addTablePrimary({ subQueryAlias: $$[$0 - 1].alias });
parser.addSubqueryAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias);
}
break;
case 1932:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['REPEATABLE()'] };
break;
case 1934:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SYSTEM()']);
break;
case 1939:
2019-12-31 18:47:24 +08:00
parser.pushQueryState();
break;
case 1940:
2019-12-31 18:47:24 +08:00
parser.popQueryState();
break;
case 1942:
2019-12-31 18:47:24 +08:00
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 1945:
2019-12-31 18:47:24 +08:00
var subQuery = parser.getSubQuery($$[$0]);
subQuery.columns.forEach(function (column) {
parser.expandIdentifierChain({ wrapper: column });
delete column.linked;
});
parser.popQueryState(subQuery);
this.$ = subQuery;
break;
case 1962:
case 1963:
case 1964:
case 1965:
2019-12-31 18:47:24 +08:00
this.$ = { alias: $$[$0], location: _$[$0] };
break;
case 1971:
2019-12-31 18:47:24 +08:00
if (!$$[$0]) {
$$[$0 - 1].suggestKeywords = ['OVER'];
}
break;
case 1979:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['OVER']);
break;
case 1983:
case 1984:
2019-12-31 18:47:24 +08:00
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 1995:
2019-12-31 18:47:24 +08:00
this.$ = { expression: $$[$0 - 1] };
break;
case 1996:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { position: 1 };
break;
case 1997:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1]);
break;
case 2005:
case 2083:
case 2124:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 2]) };
break;
case 2006:
2019-12-31 18:47:24 +08:00
this.$ = { function: $$[$0 - 3], expression: $$[$0 - 2], types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2007:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyArgumentTypesToSuggestions($$[$0 - 3], 1);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2008:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2009:
2019-12-31 18:47:24 +08:00
parser.applyArgumentTypesToSuggestions($$[$0 - 3], $$[$0 - 1].position);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2017:
case 2018:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestFunctions) {
parser.suggestAggregateFunctions();
}
break;
case 2019:
2019-12-31 18:47:24 +08:00
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 2020:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'ORDER BY', weight: 2 }]);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 3]);
}
break;
case 2029:
2019-12-31 18:47:24 +08:00
// Only allowed in last order by
delete parser.yy.result.suggestAnalyticFunctions;
break;
case 2030:
2019-12-31 18:47:24 +08:00
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 2036:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BETWEEN']);
break;
case 2037:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2] && !$$[$0 - 1]) {
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED PRECEDING']);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['AND']);
}
break;
case 2042:
2019-12-31 18:47:24 +08:00
lexer.popState();
break;
case 2043:
2019-12-31 18:47:24 +08:00
lexer.begin('hdfs');
break;
case 2045:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 3] });
break;
case 2046:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 2] });
break;
case 2047:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 1] });
break;
case 2048:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: '' });
break;
case 2049:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: '' });
break;
case 2055:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['PRECEDING']);
break;
case 2056:
case 2061:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ROW']);
break;
case 2060:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED FOLLOWING']);
break;
case 2062:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FOLLOWING']);
break;
case 2068:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2069:
2019-12-31 18:47:24 +08:00
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2070:
case 2075:
2019-12-31 18:47:24 +08:00
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2072:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2073:
case 2074:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'] };
break;
case 2078:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'AS', weight: 2 }]);
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2079:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'AS', weight: 2 }]);
this.$ = { types: ['T'] };
break;
case 2080:
case 2081:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(parser.getTypeKeywords());
this.$ = { types: ['T'] };
break;
case 2082:
case 2088:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2084:
case 2089:
case 2123:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2085:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
keywords.push('ALL');
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
}
parser.suggestKeywords(keywords);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2086:
case 2091:
case 2126:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2087:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1].cursorAtStart) {
var keywords = parser.getSelectListKeywords();
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
keywords.push('ALL');
}
parser.suggestKeywords(keywords);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2090:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
if ($$[$0 - 4].toLowerCase() === 'group_concat') {
keywords.push('ALL');
}
else {
keywords.push('ALL');
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 2092:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1].cursorAtStart) {
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
if ($$[$0 - 4].toLowerCase() === 'group_concat') {
keywords.push('ALL');
}
else {
keywords.push('ALL');
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 2109:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2110:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2111:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2112:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2113:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2114:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2115:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2116:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2117:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2118:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2119:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 3].types[0] === 'STRING') {
parser.suggestValueExpressionKeywords($$[$0 - 3], ['FROM']);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 3]);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2120:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].types[0] === 'STRING') {
parser.suggestValueExpressionKeywords($$[$0 - 2], ['FROM']);
}
else {
parser.suggestValueExpressionKeywords($$[$0 - 2]);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2125:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
var keywords = parser.getSelectListKeywords(true);
if (!$$[$0 - 2]) {
keywords.push('DISTINCT');
keywords.push('ALL');
}
if (parser.yy.result.suggestKeywords) {
keywords = parser.yy.result.suggestKeywords.concat(keywords);
}
parser.suggestKeywords(keywords);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2127:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestFunctions && !parser.yy.result.suggestFunctions.types) {
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
}
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2151:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE FUNCTIONS', 'ANALYTIC FUNCTIONS', 'COLUMN STATS', 'CREATE TABLE', 'CURRENT ROLES', 'CREATE VIEW', 'DATABASES', 'FILES IN', 'FUNCTIONS', 'GRANT ROLE', 'GRANT USER', 'PARTITIONS', 'RANGE PARTITIONS', 'ROLE GRANT GROUP', 'ROLES', 'SCHEMAS', 'TABLE STATS', 'TABLES']);
break;
case 2152:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['COLUMN STATS', 'CREATE TABLE', 'CREATE VIEW', 'FILES IN', 'PARTITIONS', 'RANGE PARTITIONS', 'TABLE STATS']);
break;
case 2153:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE FUNCTIONS', 'ANALYTIC FUNCTIONS', 'DATABASES', 'FUNCTIONS', 'SCHEMAS', 'TABLES']);
break;
case 2167:
case 2184:
case 2216:
case 2218:
case 2227:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
break;
case 2171:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1].isView) {
parser.suggestTables({ onlyViews: true });
}
else {
parser.suggestTables();
}
parser.suggestDatabases({
appendDot: true
});
break;
case 2172:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestTables && $$[$0 - 1].isView) {
parser.yy.result.suggestTables.onlyViews = true;
}
break;
case 2173:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['TABLE', 'VIEW']);
break;
case 2175:
2019-12-31 18:47:24 +08:00
this.$ = { isView: true };
break;
case 2177:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ROLES']);
break;
case 2178:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CURRENT']);
break;
case 2181:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['LIKE']);
break;
case 2188:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['IN']);
break;
case 2191:
case 2194:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FUNCTIONS']);
break;
case 2192:
case 2195:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE', 'ANALYTICAL']);
break;
case 2193:
case 2232:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IN', 'LIKE']);
}
else {
parser.suggestKeywords(['LIKE']);
}
break;
case 2196:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2]) {
parser.suggestKeywords([{ value: 'IN', weight: 2 }, { value: 'LIKE', weight: 1 }]);
}
else {
parser.suggestKeywords(['LIKE']);
}
break;
case 2204:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
break;
case 2205:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
break;
case 2207:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases({
appendDot: true
});
parser.suggestTables();
break;
case 2221:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GRANT']);
break;
case 2238:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1] && !$$[$0 - 2]) {
parser.suggestKeywords([{ value: 'FROM', weight: 2 }, { value: 'WHERE', weight: 1 }]);
}
else if (!$$[$0 - 1] && $$[$0 - 2]) {
var keywords = [{ value: 'FULL JOIN', weight: 2 }, { value: 'FULL OUTER JOIN', weight: 2 }, { value: 'JOIN', weight: 2 }, { value: 'LEFT JOIN', weight: 2 }, { value: 'LEFT OUTER JOIN', weight: 2 }, { value: 'RIGHT JOIN', weight: 2 }, { value: 'RIGHT OUTER JOIN', weight: 2 }, { value: 'INNER JOIN', weight: 2 }, { value: 'LEFT ANTI JOIN', weight: 2 }, { value: 'LEFT SEMI JOIN', weight: 2 }, { value: 'RIGHT ANTI JOIN', weight: 2 }, { value: 'RIGHT SEMI JOIN', weight: 2 }, { value: 'WHERE', weight: 1 }];
if ($$[$0 - 2].suggestJoinConditions) {
parser.suggestJoinConditions($$[$0 - 2].suggestJoinConditions);
}
if ($$[$0 - 2].suggestJoins) {
parser.suggestJoins($$[$0 - 2].suggestJoins);
}
if ($$[$0 - 2].suggestKeywords) {
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 3));
}
parser.suggestKeywords(keywords);
}
else if (!$$[$0 - 1]) {
parser.suggestKeywords(['WHERE']);
}
break;
case 2239:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SET']);
break;
case 2255:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['=']);
break;
case 2264:
2019-12-31 18:47:24 +08:00
if (!parser.yy.cursorFound) {
parser.yy.result.useDatabase = $$[$0];
}
break;
case 2267:
2019-12-31 18:47:24 +08:00
this.$ = { inValueEdit: true };
break;
case 2268:
2019-12-31 18:47:24 +08:00
this.$ = { inValueEdit: true, cursorAtStart: true };
break;
case 2269:
case 2270:
case 2271:
case 2272:
case 2273:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['NOT'] };
break;
case 2279:
case 2280:
case 2281:
case 2282:
case 2283:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['STRING'] });
parser.suggestColumns({ types: ['STRING'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 2284:
case 2286:
2019-12-31 18:47:24 +08:00
this.$ = parser.findCaseType($$[$0 - 1]);
break;
case 2285:
case 2288:
2019-12-31 18:47:24 +08:00
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2287:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1], ['END']);
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2289:
2019-12-31 18:47:24 +08:00
this.$ = parser.findCaseType($$[$0 - 2]);
break;
case 2290:
2019-12-31 18:47:24 +08:00
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 2291:
2019-12-31 18:47:24 +08:00
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 2292:
2019-12-31 18:47:24 +08:00
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
break;
case 2293:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2294:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 2295:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = $$[$0 - 1];
break;
case 2296:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'] };
break;
case 2299:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], lastType: $$[$0] };
break;
case 2300:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].caseTypes.push($$[$0]);
this.$ = { caseTypes: $$[$0 - 1].caseTypes, lastType: $$[$0] };
break;
case 2304:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
break;
case 2307:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0].suggestFilters };
break;
case 2308:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 2309:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2310:
case 2311:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0].suggestFilters };
break;
case 2312:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2313:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [$$[$0]] };
break;
case 2314:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2315:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2316:
case 2318:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2317:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2319:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [$$[$0]], suggestFilters: true };
break;
case 2320:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2321:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2322:
case 2323:
case 2324:
case 2325:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
}
},
table: [o($V0, $V1, { 501: 1, 406: 2 }), { 1: [3] }, o($V2, $V3, { 402: 3, 502: 4, 403: 6, 404: 7, 407: 8, 3: 394, 363: 395, 137: 396, 410: 397, 239: 398, 371: 399, 408: 400, 16: 401, 368: 402, 140: 403, 4: 405, 5: 406, 6: 407, 7: 408, 8: 409, 9: 410, 10: 411, 11: 412, 12: 413, 13: 414, 14: 415, 15: 416, 364: 417, 365: 418, 366: 419, 367: 420, 411: 421, 17: 426, 18: 427, 19: 428, 20: 429, 21: 430, 22: 431, 23: 432, 24: 433, 25: 434, 28: 435, 29: 436, 369: 437, 370: 438, 372: 439, 374: 440, 375: 441, 419: 442, 30: 443, 31: 444, 32: 445, 33: 446, 161: 450, 162: 451, 163: 452, 164: 453, 165: 454, 376: 455, 377: 456, 378: 457, 379: 458, 380: 459, 381: 460, 382: 461, 994: 464, 995: 465, 996: 466, 997: 467, 998: 468, 999: 469, 1000: 470, 1001: 471, 1002: 472, 1003: 473, 1004: 474, 1005: 475, 373: 477, 34: 481, 35: 482, 36: 483, 37: 484, 166: 486, 167: 487, 168: 488, 169: 489, 383: 491, 384: 492, 385: 493, 386: 494, 387: 495, 388: 496, 1007: 499, 1008: 500, 1009: 501, 1010: 502, 1011: 503, 1012: 504, 1013: 505, 1014: 506, 1015: 507, 1016: 508, 1017: 509, 472: 510, 43: 511, 135: 512, 312: 514, 313: 515, 471: 517, 72: 518, 139: 519, 314: 520, 315: 521, 477: 522, 473: 523, 482: 524, 483: 525, 480: 526, 481: 527, 2: $V4, 26: $V5, 27: $V6, 38: $V7, 41: $V8, 50: $V9, 51: $Va, 54: $Vb, 63: $Vc, 65: $Vd, 66: $Ve, 70: $Vf, 71: $Vg, 85: $Vh, 86: $Vi, 89: $Vj, 91: $Vk, 95: $Vl, 101: $Vm, 103: $Vn, 106: $Vo, 107: $Vp, 129: $Vq, 136: $Vr, 138: $Vs, 142: $Vt, 143: $Vu, 144: $Vv, 146: $Vw, 147: $Vx, 149: $Vy, 151: $Vz, 153: $VA, 155: $VB, 158: $VC, 170: $VD, 179: $VE, 180: $VF, 208: $VG, 224: $VH, 236: $VI, 237: $VJ, 238: $VK, 241: $VL, 242: $VM, 253: $VN, 254: $VO, 256: $VP, 257: $VQ, 265: $VR, 269: $VS, 276: $VT, 278: $VU, 288: $VV, 289: $VW, 290: $VX, 292: $VY, 293: $VZ, 294: $V_, 295: $V$, 296: $V01, 301: $V11, 302: $V21, 304: $V31, 305: $V41, 307: $V51, 316: $V61, 322: $V71, 342: $V81, 343: $V91, 344: $Va1, 345: $Vb1, 348: $Vc1, 349: $Vd1, 350: $Ve1, 351: $Vf1, 352: $Vg1, 353: $Vh1, 354: $Vi1, 360: $Vj1, 362: $Vk1, 391: $Vl1, 392: $Vm1, 393: $Vn1, 395: $Vo1, 409: $Vp1, 412: $Vq1, 426: $Vr1, 428: $Vs1, 429: $Vt1, 430: $Vu1, 431: $Vv1, 432: $Vw1, 433: $Vx1, 434: $Vy1, 435: $Vz1, 436: $VA1, 453: $VB1, 454: $VC1, 462: $VD1, 463: $VE1, 464: $VF1, 466: $VG1, 467: $VH1, 484: $VI1, 485: $VJ1, 489: $VK1, 490: $VL1, 495: $VM1, 496: $VN1, 497: $VO1, 504: $VP1, 505: $VQ1, 506: $VR1, 507: $VS1, 508: $VT1, 509: $VU1, 510: $VV1, 511: $VW1, 512: $VX1, 513: $VY1, 514: $VZ1, 515: $V_1, 516: $V$1, 517: $V02, 518: $V12, 519: $V22, 520: $V32, 521: $V42, 522: $V52, 523: $V62, 524: $V72, 525: $V82, 526: $V92, 527: $Va2, 528: $Vb2, 529: $Vc2, 530: $Vd2, 531: $Ve2, 532: $Vf2, 533: $Vg2, 534: $Vh2, 535: $Vi2, 536: $Vj2, 537: $Vk2, 538: $Vl2, 539: $Vm2, 540: $Vn2, 541: $Vo2, 542: $Vp2, 543: $Vq2, 544: $Vr2, 545: $Vs2, 546: $Vt2, 547: $Vu2, 548: $Vv2, 549: $Vw2, 550: $Vx2, 551: $Vy2, 552: $Vz2, 553: $VA2, 554: $VB2, 555: $VC2, 556: $VD2, 557: $VE2, 558: $VF2, 559: $VG2, 560: $VH2, 561: $VI2, 562: $VJ2, 563: $VK2, 564: $VL2, 565: $VM2, 566: $VN2, 567: $VO2, 568: $VP2, 569: $VQ2, 570: $VR2, 571: $VS2, 572: $VT2, 573: $VU2, 574: $VV2, 575: $VW2, 576: $VX2, 577: $VY2, 578: $VZ2, 579: $V_2, 580: $V$2, 581: $V03, 582: $V13, 583: $V23, 584: $V33, 585: $V43, 586: $V53, 587: $V63, 588: $V73, 589: $V83, 590: $V93, 591: $Va3, 592: $Vb3, 593: $Vc3, 594: $Vd3, 595: $Ve3, 596: $Vf3, 597: $Vg3, 598: $Vh3, 599: $Vi3, 600: $Vj3, 601: $Vk3, 602: $Vl3, 603: $Vm3, 604: $Vn3, 605: $Vo3, 606: $Vp3, 607: $Vq3, 608: $Vr3, 609: $Vs3, 610: $Vt3, 611: $Vu3, 612: $Vv3, 613: $Vw3, 614: $Vx3, 615: $Vy3, 616: $Vz3, 617: $VA3, 618: $VB3, 619: $VC3, 620: $VD3, 621: $VE3, 622: $VF3, 623: $VG3, 624: $VH3, 625: $VI3, 626: $VJ3, 627: $VK3, 628: $VL3, 629: $VM3, 630: $VN3, 631: $VO3, 632: $VP3, 633: $VQ3, 634: $VR3, 635: $VS3, 636: $VT3, 637: $VU3, 638: $VV3, 639: $VW3, 640: $VX3, 641: $VY3, 642: $VZ3, 643: $V_3, 644: $V$3, 645: $V04, 646: $V14, 647: $V24, 648: $V34, 649: $V44, 650: $V54, 651: $V64, 652: $V74, 653: $V84, 654: $V94, 655: $Va4, 656: $Vb4, 657: $Vc4, 658: $Vd4, 659: $Ve4, 660: $V
defaultActions: { 9: [2, 947], 10: [2, 948], 11: [2, 949], 12: [2, 950], 13: [2, 951], 14: [2, 952], 15: [2, 953], 16: [2, 954], 17: [2, 955], 18: [2, 956], 19: [2, 957], 20: [2, 958], 21: [2, 959], 22: [2, 960], 23: [2, 961], 24: [2, 962], 25: [2, 963], 26: [2, 964], 27: [2, 965], 28: [2, 966], 29: [2, 967], 30: [2, 968], 31: [2, 969], 32: [2, 970], 33: [2, 971], 34: [2, 972], 35: [2, 973], 36: [2, 974], 37: [2, 975], 38: [2, 976], 39: [2, 977], 40: [2, 978], 41: [2, 979], 42: [2, 980], 43: [2, 981], 44: [2, 982], 45: [2, 983], 46: [2, 984], 47: [2, 985], 48: [2, 986], 49: [2, 987], 50: [2, 988], 51: [2, 989], 52: [2, 990], 53: [2, 991], 54: [2, 992], 55: [2, 993], 56: [2, 994], 57: [2, 995], 58: [2, 996], 59: [2, 997], 60: [2, 998], 61: [2, 999], 62: [2, 1000], 63: [2, 1001], 64: [2, 1002], 65: [2, 1003], 66: [2, 1004], 67: [2, 1005], 68: [2, 1006], 69: [2, 1007], 70: [2, 1008], 71: [2, 1009], 72: [2, 1010], 73: [2, 1011], 74: [2, 1012], 75: [2, 1013], 76: [2, 1014], 77: [2, 1015], 78: [2, 1016], 79: [2, 1017], 80: [2, 1018], 81: [2, 1019], 82: [2, 1020], 83: [2, 1021], 84: [2, 1022], 85: [2, 1023], 86: [2, 1024], 87: [2, 1025], 88: [2, 1026], 89: [2, 1027], 90: [2, 1028], 91: [2, 1029], 92: [2, 1030], 93: [2, 1031], 94: [2, 1032], 95: [2, 1033], 96: [2, 1034], 97: [2, 1035], 98: [2, 1036], 99: [2, 1037], 100: [2, 1038], 101: [2, 1039], 102: [2, 1040], 104: [2, 1042], 105: [2, 1043], 106: [2, 1044], 107: [2, 1045], 108: [2, 1046], 109: [2, 1047], 110: [2, 1048], 111: [2, 1049], 112: [2, 1050], 113: [2, 1051], 114: [2, 1052], 115: [2, 1053], 116: [2, 1054], 117: [2, 1055], 118: [2, 1056], 119: [2, 1057], 120: [2, 1058], 121: [2, 1059], 122: [2, 1060], 123: [2, 1061], 124: [2, 1062], 125: [2, 1063], 126: [2, 1064], 127: [2, 1065], 128: [2, 1066], 129: [2, 1067], 130: [2, 1068], 131: [2, 1069], 132: [2, 1070], 133: [2, 1071], 134: [2, 1072], 135: [2, 1073], 136: [2, 1074], 137: [2, 1075], 138: [2, 1076], 139: [2, 1077], 140: [2, 1078], 141: [2, 1079], 142: [2, 1080], 143: [2, 1081], 144: [2, 1082], 145: [2, 1083], 146: [2, 1084], 147: [2, 1085], 148: [2, 1086], 149: [2, 1087], 150: [2, 1088], 151: [2, 1089], 152: [2, 1090], 154: [2, 1092], 155: [2, 1093], 156: [2, 1094], 157: [2, 1095], 158: [2, 1096], 159: [2, 1097], 160: [2, 1098], 161: [2, 1099], 162: [2, 1100], 163: [2, 1101], 164: [2, 1102], 165: [2, 1103], 166: [2, 1104], 167: [2, 1105], 168: [2, 1106], 169: [2, 1107], 170: [2, 1108], 171: [2, 1109], 172: [2, 1110], 173: [2, 1111], 174: [2, 1112], 175: [2, 1113], 176: [2, 1114], 177: [2, 1115], 178: [2, 1116], 179: [2, 1117], 180: [2, 1118], 181: [2, 1119], 182: [2, 1120], 183: [2, 1121], 184: [2, 1122], 185: [2, 1123], 186: [2, 1124], 187: [2, 1125], 188: [2, 1126], 189: [2, 1127], 190: [2, 1128], 191: [2, 1129], 192: [2, 1130], 193: [2, 1131], 194: [2, 1132], 195: [2, 1133], 196: [2, 1134], 197: [2, 1135], 198: [2, 1136], 199: [2, 1137], 200: [2, 1138], 201: [2, 1139], 202: [2, 1140], 203: [2, 1141], 204: [2, 1142], 205: [2, 1143], 206: [2, 1144], 207: [2, 1145], 208: [2, 1146], 209: [2, 1147], 210: [2, 1148], 211: [2, 1149], 212: [2, 1150], 213: [2, 1151], 214: [2, 1152], 215: [2, 1153], 216: [2, 1154], 217: [2, 1155], 218: [2, 1156], 219: [2, 1157], 220: [2, 1158], 221: [2, 1159], 222: [2, 1160], 223: [2, 1161], 224: [2, 1162], 225: [2, 1163], 226: [2, 1164], 227: [2, 1165], 228: [2, 1166], 229: [2, 1167], 230: [2, 1168], 231: [2, 1169], 232: [2, 1170], 233: [2, 1171], 234: [2, 1172], 235: [2, 1173], 236: [2, 1174], 237: [2, 1175], 238: [2, 1176], 239: [2, 1177], 240: [2, 1178], 241: [2, 1179], 242: [2, 1180], 243: [2, 1181], 244: [2, 1182], 245: [2, 1183], 246: [2, 1184], 247: [2, 1185], 248: [2, 1186], 249: [2, 1187], 250: [2, 1188], 251: [2, 1189], 252: [2, 1190], 253: [2, 1191], 254: [2, 1192], 255: [2, 1193], 256: [2, 1194], 257: [2, 1195], 258: [2, 1196], 259: [2, 1197], 260: [2, 1198], 261: [2, 1199], 262: [2, 1200], 263: [2, 1201], 264: [2, 1202], 265: [2, 1203], 266: [2, 1204], 267: [2, 1205], 268: [2, 1206], 269: [2, 1207], 270: [2, 1208], 271: [2, 1209], 272: [2, 1210], 273: [2, 1211], 274: [
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;
return 797;
2019-12-31 18:47:24 +08:00
break;
case 5:
return 44;
break;
case 6:
return 322;
2019-12-31 18:47:24 +08:00
break;
case 7:
return 426;
2019-12-31 18:47:24 +08:00
break;
case 8:
return 512;
2019-12-31 18:47:24 +08:00
break;
case 9:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('ALTER', yy_.yylloc, yy.lexer.upcomingInput());
return 38;
break;
case 10:
return 513;
2019-12-31 18:47:24 +08:00
break;
case 11:
return 514;
2019-12-31 18:47:24 +08:00
break;
case 12:
return 431;
2019-12-31 18:47:24 +08:00
break;
case 13:
return 515;
2019-12-31 18:47:24 +08:00
break;
case 14:
return 517;
2019-12-31 18:47:24 +08:00
break;
case 15:
return 519;
2019-12-31 18:47:24 +08:00
break;
case 16:
return 520;
2019-12-31 18:47:24 +08:00
break;
case 17:
return 136;
break;
case 18:
return 521;
2019-12-31 18:47:24 +08:00
break;
case 19:
return 522;
2019-12-31 18:47:24 +08:00
break;
case 20:
return 523;
2019-12-31 18:47:24 +08:00
break;
case 21:
return 524;
2019-12-31 18:47:24 +08:00
break;
case 22:
return 525;
2019-12-31 18:47:24 +08:00
break;
case 23:
return 151;
break;
case 24:
return 289;
2019-12-31 18:47:24 +08:00
break;
case 25:
return 528;
2019-12-31 18:47:24 +08:00
break;
case 26:
return 529;
2019-12-31 18:47:24 +08:00
break;
case 27:
return 530;
2019-12-31 18:47:24 +08:00
break;
case 28:
return 531;
2019-12-31 18:47:24 +08:00
break;
case 29:
return 532;
2019-12-31 18:47:24 +08:00
break;
case 30:
return 85;
break;
case 31:
return 533;
2019-12-31 18:47:24 +08:00
break;
case 32:
return 534;
2019-12-31 18:47:24 +08:00
break;
case 33:
return 257;
break;
case 34:
return 536;
2019-12-31 18:47:24 +08:00
break;
case 35:
return 537;
2019-12-31 18:47:24 +08:00
break;
case 36:
return 538;
2019-12-31 18:47:24 +08:00
break;
case 37:
return 539;
2019-12-31 18:47:24 +08:00
break;
case 38:
return 540;
2019-12-31 18:47:24 +08:00
break;
case 39:
return 541;
2019-12-31 18:47:24 +08:00
break;
case 40:
return 111;
break;
case 41:
return 543;
2019-12-31 18:47:24 +08:00
break;
case 42:
return 544;
2019-12-31 18:47:24 +08:00
break;
case 43:
return 545;
2019-12-31 18:47:24 +08:00
break;
case 44:
return 351;
2019-12-31 18:47:24 +08:00
break;
case 45:
return 546;
2019-12-31 18:47:24 +08:00
break;
case 46:
return 547;
2019-12-31 18:47:24 +08:00
break;
case 47:
return 65;
break;
case 48:
return 117;
break;
case 49:
parser.determineCase(yy_.yytext);
return 86;
break;
case 50:
return 548;
2019-12-31 18:47:24 +08:00
break;
case 51:
return 87;
break;
case 52:
parser.determineCase(yy_.yytext);
return 155;
break;
case 53:
return 549;
2019-12-31 18:47:24 +08:00
break;
case 54:
return 550;
2019-12-31 18:47:24 +08:00
break;
case 55:
return 551;
2019-12-31 18:47:24 +08:00
break;
case 56:
return 552;
2019-12-31 18:47:24 +08:00
break;
case 57:
return 553;
2019-12-31 18:47:24 +08:00
break;
case 58:
return 554;
2019-12-31 18:47:24 +08:00
break;
case 59:
return 555;
2019-12-31 18:47:24 +08:00
break;
case 60:
return 556;
2019-12-31 18:47:24 +08:00
break;
case 61:
return 558;
2019-12-31 18:47:24 +08:00
break;
case 62:
return 559;
2019-12-31 18:47:24 +08:00
break;
case 63:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('CREATE', yy_.yylloc, yy.lexer.upcomingInput());
return 170;
break;
case 64:
return 432;
2019-12-31 18:47:24 +08:00
break;
case 65:
return 560;
2019-12-31 18:47:24 +08:00
break;
case 66:
return 561;
2019-12-31 18:47:24 +08:00
break;
case 67:
return 562;
2019-12-31 18:47:24 +08:00
break;
case 68:
return 563;
2019-12-31 18:47:24 +08:00
break;
case 69:
return 564;
2019-12-31 18:47:24 +08:00
break;
case 70:
return 565;
2019-12-31 18:47:24 +08:00
break;
case 71:
return 566;
2019-12-31 18:47:24 +08:00
break;
case 72:
return 567;
2019-12-31 18:47:24 +08:00
break;
case 73:
return 568;
2019-12-31 18:47:24 +08:00
break;
case 74:
return 569;
2019-12-31 18:47:24 +08:00
break;
case 75:
return 570;
2019-12-31 18:47:24 +08:00
break;
case 76:
return 496;
2019-12-31 18:47:24 +08:00
break;
case 77:
return 143;
break;
case 78:
return 571;
2019-12-31 18:47:24 +08:00
break;
case 79:
return 572;
2019-12-31 18:47:24 +08:00
break;
case 80:
return 573;
2019-12-31 18:47:24 +08:00
break;
case 81:
return 574;
2019-12-31 18:47:24 +08:00
break;
case 82:
return 575;
2019-12-31 18:47:24 +08:00
break;
case 83:
return 576;
2019-12-31 18:47:24 +08:00
break;
case 84:
return 577;
2019-12-31 18:47:24 +08:00
break;
case 85:
return 393;
2019-12-31 18:47:24 +08:00
break;
case 86:
return 296;
2019-12-31 18:47:24 +08:00
break;
case 87:
return 578;
2019-12-31 18:47:24 +08:00
break;
case 88:
return 579;
2019-12-31 18:47:24 +08:00
break;
case 89:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('DESCRIBE', yy_.yylloc);
return 840;
2019-12-31 18:47:24 +08:00
break;
case 90:
return 580;
2019-12-31 18:47:24 +08:00
break;
case 91:
return 581;
2019-12-31 18:47:24 +08:00
break;
case 92:
return 582;
2019-12-31 18:47:24 +08:00
break;
case 93:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 94:
return 583;
2019-12-31 18:47:24 +08:00
break;
case 95:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('DROP', yy_.yylloc, yy.lexer.upcomingInput());
return 63;
break;
case 96:
return 584;
2019-12-31 18:47:24 +08:00
break;
case 97:
return 585;
2019-12-31 18:47:24 +08:00
break;
case 98:
return 586;
2019-12-31 18:47:24 +08:00
break;
case 99:
return 587;
2019-12-31 18:47:24 +08:00
break;
case 100:
return 588;
2019-12-31 18:47:24 +08:00
break;
case 101:
return 88;
break;
case 102:
return 589;
2019-12-31 18:47:24 +08:00
break;
case 103:
return 590;
2019-12-31 18:47:24 +08:00
break;
case 104:
return 591;
2019-12-31 18:47:24 +08:00
break;
case 105:
return 592;
2019-12-31 18:47:24 +08:00
break;
case 106:
return 593;
2019-12-31 18:47:24 +08:00
break;
case 107:
return 304;
2019-12-31 18:47:24 +08:00
break;
case 108:
return 594;
2019-12-31 18:47:24 +08:00
break;
case 109:
return 595;
2019-12-31 18:47:24 +08:00
break;
case 110:
return 596;
2019-12-31 18:47:24 +08:00
break;
case 111:
return 597;
2019-12-31 18:47:24 +08:00
break;
case 112:
parser.yy.correlatedSubQuery = true;
return 598;
2019-12-31 18:47:24 +08:00
break;
case 113:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('EXPLAIN', yy_.yylloc);
return 506;
2019-12-31 18:47:24 +08:00
break;
case 114:
return 599;
break;
case 115:
return 600;
break;
2019-12-31 18:47:24 +08:00
case 116:
return 602;
2019-12-31 18:47:24 +08:00
break;
case 117:
return 603;
2019-12-31 18:47:24 +08:00
break;
case 118:
return 301;
2019-12-31 18:47:24 +08:00
break;
case 119:
return 98;
break;
case 120:
return 604;
2019-12-31 18:47:24 +08:00
break;
case 121:
return 605;
2019-12-31 18:47:24 +08:00
break;
case 122:
return 353;
2019-12-31 18:47:24 +08:00
break;
case 123:
return 606;
2019-12-31 18:47:24 +08:00
break;
case 124:
return 607;
2019-12-31 18:47:24 +08:00
break;
case 125:
return 608;
2019-12-31 18:47:24 +08:00
break;
case 126:
return 609;
2019-12-31 18:47:24 +08:00
break;
case 127:
return 610;
2019-12-31 18:47:24 +08:00
break;
case 128:
return 107;
break;
case 129:
return 611;
2019-12-31 18:47:24 +08:00
break;
case 130:
return 612;
2019-12-31 18:47:24 +08:00
break;
case 131:
return 613;
2019-12-31 18:47:24 +08:00
break;
case 132:
parser.determineCase(yy_.yytext);
return 395;
2019-12-31 18:47:24 +08:00
break;
case 133:
return 428;
2019-12-31 18:47:24 +08:00
break;
case 134:
return 316;
2019-12-31 18:47:24 +08:00
break;
case 135:
return 149;
break;
case 136:
return 614;
2019-12-31 18:47:24 +08:00
break;
case 137:
return 615;
2019-12-31 18:47:24 +08:00
break;
case 138:
return 616;
2019-12-31 18:47:24 +08:00
break;
case 139:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('GRANT', yy_.yylloc);
return 453;
2019-12-31 18:47:24 +08:00
break;
case 140:
return 454;
2019-12-31 18:47:24 +08:00
break;
case 141:
return 618;
2019-12-31 18:47:24 +08:00
break;
case 142:
return 619;
2019-12-31 18:47:24 +08:00
break;
case 143:
return 265;
2019-12-31 18:47:24 +08:00
break;
case 144:
return 620;
2019-12-31 18:47:24 +08:00
break;
case 145:
return 622;
2019-12-31 18:47:24 +08:00
break;
case 146:
return 623;
2019-12-31 18:47:24 +08:00
break;
case 147:
return 624;
2019-12-31 18:47:24 +08:00
break;
case 148:
return 625;
2019-12-31 18:47:24 +08:00
break;
case 149:
return 626;
2019-12-31 18:47:24 +08:00
break;
case 150:
return 158;
break;
case 151:
return 627;
2019-12-31 18:47:24 +08:00
break;
case 152:
return 345;
2019-12-31 18:47:24 +08:00
break;
case 153:
return 628;
2019-12-31 18:47:24 +08:00
break;
case 154:
return 433;
2019-12-31 18:47:24 +08:00
break;
case 155:
return 629;
2019-12-31 18:47:24 +08:00
break;
case 156:
this.begin('hdfs');
return 497;
2019-12-31 18:47:24 +08:00
break;
case 157:
return 630;
2019-12-31 18:47:24 +08:00
break;
case 158:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('INSERT', yy_.yylloc);
return 464;
2019-12-31 18:47:24 +08:00
break;
case 159:
return 631;
2019-12-31 18:47:24 +08:00
break;
case 160:
return 354;
2019-12-31 18:47:24 +08:00
break;
case 161:
return 632;
2019-12-31 18:47:24 +08:00
break;
case 162:
return 633;
2019-12-31 18:47:24 +08:00
break;
case 163:
return 634;
2019-12-31 18:47:24 +08:00
break;
case 164:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 165:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('INVALIDATE', yy_.yylloc, yy.lexer.upcomingInput());
return 153;
break;
case 166:
return 635;
2019-12-31 18:47:24 +08:00
break;
case 167:
return 144;
break;
case 168:
return 436;
2019-12-31 18:47:24 +08:00
break;
case 169:
return 636;
2019-12-31 18:47:24 +08:00
break;
case 170:
return 637;
2019-12-31 18:47:24 +08:00
break;
case 171:
return 638;
2019-12-31 18:47:24 +08:00
break;
case 172:
return 639;
2019-12-31 18:47:24 +08:00
break;
case 173:
return 640;
2019-12-31 18:47:24 +08:00
break;
case 174:
return 641;
2019-12-31 18:47:24 +08:00
break;
case 175:
return 642;
2019-12-31 18:47:24 +08:00
break;
case 176:
return 643;
2019-12-31 18:47:24 +08:00
break;
case 177:
return 644;
2019-12-31 18:47:24 +08:00
break;
case 178:
return 254;
break;
case 179:
return 290;
2019-12-31 18:47:24 +08:00
break;
case 180:
return 645;
2019-12-31 18:47:24 +08:00
break;
case 181:
return 646;
2019-12-31 18:47:24 +08:00
break;
case 182:
return 647;
2019-12-31 18:47:24 +08:00
break;
case 183:
return 648;
2019-12-31 18:47:24 +08:00
break;
case 184:
return 429;
2019-12-31 18:47:24 +08:00
break;
case 185:
return 208;
break;
case 186:
return 649;
2019-12-31 18:47:24 +08:00
break;
case 187:
return 650;
2019-12-31 18:47:24 +08:00
break;
case 188:
return 361;
2019-12-31 18:47:24 +08:00
break;
case 189:
return 305;
2019-12-31 18:47:24 +08:00
break;
case 190:
return 651;
2019-12-31 18:47:24 +08:00
break;
case 191:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('LOAD', yy_.yylloc, yy.lexer.upcomingInput());
return 495;
2019-12-31 18:47:24 +08:00
break;
case 192:
return 652;
2019-12-31 18:47:24 +08:00
break;
case 193:
return 653;
2019-12-31 18:47:24 +08:00
break;
case 194:
this.begin('hdfs');
return 654;
2019-12-31 18:47:24 +08:00
break;
case 195:
return 655;
2019-12-31 18:47:24 +08:00
break;
case 196:
return 656;
2019-12-31 18:47:24 +08:00
break;
case 197:
return 657;
2019-12-31 18:47:24 +08:00
break;
case 198:
return 658;
2019-12-31 18:47:24 +08:00
break;
case 199:
return 660;
2019-12-31 18:47:24 +08:00
break;
case 200:
return 349;
2019-12-31 18:47:24 +08:00
break;
case 201:
return 154;
break;
case 202:
return 661;
2019-12-31 18:47:24 +08:00
break;
case 203:
return 663;
2019-12-31 18:47:24 +08:00
break;
case 204:
return 664;
2019-12-31 18:47:24 +08:00
break;
case 205:
return 665;
2019-12-31 18:47:24 +08:00
break;
case 206:
return 666;
2019-12-31 18:47:24 +08:00
break;
case 207:
return 667;
2019-12-31 18:47:24 +08:00
break;
case 208:
return 668;
2019-12-31 18:47:24 +08:00
break;
case 209:
return 670;
2019-12-31 18:47:24 +08:00
break;
case 210:
return 671;
2019-12-31 18:47:24 +08:00
break;
case 211:
return 672;
2019-12-31 18:47:24 +08:00
break;
case 212:
return 224;
break;
case 213:
return 673;
2019-12-31 18:47:24 +08:00
break;
case 214:
return 146;
break;
case 215:
return 674;
2019-12-31 18:47:24 +08:00
break;
case 216:
return 675;
2019-12-31 18:47:24 +08:00
break;
case 217:
return 676;
2019-12-31 18:47:24 +08:00
break;
case 218:
return 677;
2019-12-31 18:47:24 +08:00
break;
case 219:
return 678;
2019-12-31 18:47:24 +08:00
break;
case 220:
return 878;
2019-12-31 18:47:24 +08:00
break;
case 221:
return 679;
2019-12-31 18:47:24 +08:00
break;
case 222:
return 142;
break;
case 223:
return 680;
2019-12-31 18:47:24 +08:00
break;
case 224:
return 681;
2019-12-31 18:47:24 +08:00
break;
case 225:
return 466;
2019-12-31 18:47:24 +08:00
break;
case 226:
return 682;
2019-12-31 18:47:24 +08:00
break;
case 227:
return 291;
2019-12-31 18:47:24 +08:00
break;
case 228:
return 683;
2019-12-31 18:47:24 +08:00
break;
case 229:
return 684;
2019-12-31 18:47:24 +08:00
break;
case 230:
return 434;
2019-12-31 18:47:24 +08:00
break;
case 231:
return 685;
2019-12-31 18:47:24 +08:00
break;
case 232:
return 686;
2019-12-31 18:47:24 +08:00
break;
case 233:
return 687;
2019-12-31 18:47:24 +08:00
break;
case 234:
return 488;
2019-12-31 18:47:24 +08:00
break;
case 235:
return 292;
2019-12-31 18:47:24 +08:00
break;
case 236:
return 51;
break;
case 237:
return 256;
break;
case 238:
return 71;
break;
case 239:
return 688;
2019-12-31 18:47:24 +08:00
break;
case 240:
return 689;
2019-12-31 18:47:24 +08:00
break;
case 241:
return 690;
2019-12-31 18:47:24 +08:00
break;
case 242:
return 691;
2019-12-31 18:47:24 +08:00
break;
case 243:
return 692;
2019-12-31 18:47:24 +08:00
break;
case 244:
return 693;
2019-12-31 18:47:24 +08:00
break;
case 245:
return 694;
2019-12-31 18:47:24 +08:00
break;
case 246:
return 695;
2019-12-31 18:47:24 +08:00
break;
case 247:
return 696;
2019-12-31 18:47:24 +08:00
break;
case 248:
return 697;
2019-12-31 18:47:24 +08:00
break;
case 249:
return 698;
2019-12-31 18:47:24 +08:00
break;
case 250:
return 350;
2019-12-31 18:47:24 +08:00
break;
case 251:
return 253;
break;
case 252:
return 699;
2019-12-31 18:47:24 +08:00
break;
case 253:
return 700;
2019-12-31 18:47:24 +08:00
break;
case 254:
return 391;
2019-12-31 18:47:24 +08:00
break;
case 255:
return 50;
break;
case 256:
return 293;
2019-12-31 18:47:24 +08:00
break;
case 257:
return 701;
2019-12-31 18:47:24 +08:00
break;
case 258:
return 702;
2019-12-31 18:47:24 +08:00
break;
case 259:
return 70;
break;
case 260:
return 703;
2019-12-31 18:47:24 +08:00
break;
case 261:
return 704;
2019-12-31 18:47:24 +08:00
break;
case 262:
return 705;
2019-12-31 18:47:24 +08:00
break;
case 263:
return 706;
2019-12-31 18:47:24 +08:00
break;
case 264:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('REFRESH', yy_.yylloc);
return 147;
break;
case 265:
return 707;
2019-12-31 18:47:24 +08:00
break;
case 266:
return 708;
2019-12-31 18:47:24 +08:00
break;
case 267:
return 709;
2019-12-31 18:47:24 +08:00
break;
case 268:
return 710;
2019-12-31 18:47:24 +08:00
break;
case 269:
return 711;
2019-12-31 18:47:24 +08:00
break;
case 270:
return 712;
2019-12-31 18:47:24 +08:00
break;
case 271:
return 713;
2019-12-31 18:47:24 +08:00
break;
case 272:
return 714;
2019-12-31 18:47:24 +08:00
break;
case 273:
return 715;
2019-12-31 18:47:24 +08:00
break;
case 274:
return 716;
2019-12-31 18:47:24 +08:00
break;
case 275:
return 56;
break;
case 276:
return 717;
2019-12-31 18:47:24 +08:00
break;
case 277:
return 73;
break;
case 278:
return 718;
2019-12-31 18:47:24 +08:00
break;
case 279:
return 719;
2019-12-31 18:47:24 +08:00
break;
case 280:
return 343;
2019-12-31 18:47:24 +08:00
break;
case 281:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('REVOKE', yy_.yylloc);
return 467;
2019-12-31 18:47:24 +08:00
break;
case 282:
return 430;
2019-12-31 18:47:24 +08:00
break;
case 283:
return 720;
2019-12-31 18:47:24 +08:00
break;
case 284:
return 360;
2019-12-31 18:47:24 +08:00
break;
case 285:
return 721;
2019-12-31 18:47:24 +08:00
break;
case 286:
return 722;
2019-12-31 18:47:24 +08:00
break;
case 287:
return 723;
2019-12-31 18:47:24 +08:00
break;
case 288:
return 106;
break;
case 289:
return 724;
2019-12-31 18:47:24 +08:00
break;
case 290:
return 725;
2019-12-31 18:47:24 +08:00
break;
case 291:
return 726;
2019-12-31 18:47:24 +08:00
break;
case 292:
return 727;
2019-12-31 18:47:24 +08:00
break;
case 293:
return 728;
2019-12-31 18:47:24 +08:00
break;
case 294:
return 729;
2019-12-31 18:47:24 +08:00
break;
case 295:
return 730;
2019-12-31 18:47:24 +08:00
break;
case 296:
return 731;
2019-12-31 18:47:24 +08:00
break;
case 297:
return 732;
2019-12-31 18:47:24 +08:00
break;
case 298:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SELECT', yy_.yylloc);
return 412;
2019-12-31 18:47:24 +08:00
break;
case 299:
return 435;
2019-12-31 18:47:24 +08:00
break;
case 300:
return 733;
2019-12-31 18:47:24 +08:00
break;
case 301:
return 294;
2019-12-31 18:47:24 +08:00
break;
case 302:
return 103;
break;
case 303:
return 352;
2019-12-31 18:47:24 +08:00
break;
case 304:
return 462;
2019-12-31 18:47:24 +08:00
break;
case 305:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SET', yy_.yylloc);
return 26;
break;
case 306:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SHOW', yy_.yylloc);
return 1006;
2019-12-31 18:47:24 +08:00
break;
case 307:
return 734;
2019-12-31 18:47:24 +08:00
break;
case 308:
return 735;
2019-12-31 18:47:24 +08:00
break;
case 309:
return 736;
2019-12-31 18:47:24 +08:00
break;
case 310:
return 737;
2019-12-31 18:47:24 +08:00
break;
case 311:
return 269;
2019-12-31 18:47:24 +08:00
break;
case 312:
return 738;
2019-12-31 18:47:24 +08:00
break;
case 313:
return 739;
2019-12-31 18:47:24 +08:00
break;
case 314:
return 740;
2019-12-31 18:47:24 +08:00
break;
case 315:
return 741;
2019-12-31 18:47:24 +08:00
break;
case 316:
return 742;
2019-12-31 18:47:24 +08:00
break;
case 317:
return 743;
2019-12-31 18:47:24 +08:00
break;
case 318:
return 66;
break;
case 319:
return 288;
2019-12-31 18:47:24 +08:00
break;
case 320:
return 747;
2019-12-31 18:47:24 +08:00
break;
case 321:
return 748;
2019-12-31 18:47:24 +08:00
break;
case 322:
return 749;
2019-12-31 18:47:24 +08:00
break;
case 323:
return 750;
2019-12-31 18:47:24 +08:00
break;
case 324:
return 751;
2019-12-31 18:47:24 +08:00
break;
case 325:
return 752;
2019-12-31 18:47:24 +08:00
break;
case 326:
return 344;
2019-12-31 18:47:24 +08:00
break;
case 327:
return 754;
2019-12-31 18:47:24 +08:00
break;
case 328:
return 755;
2019-12-31 18:47:24 +08:00
break;
case 329:
return 756;
2019-12-31 18:47:24 +08:00
break;
case 330:
return 129;
break;
case 331:
return 757;
2019-12-31 18:47:24 +08:00
break;
case 332:
return 758;
2019-12-31 18:47:24 +08:00
break;
case 333:
return 101;
break;
case 334:
return 302;
2019-12-31 18:47:24 +08:00
break;
case 335:
return 295;
2019-12-31 18:47:24 +08:00
break;
case 336:
return 759;
2019-12-31 18:47:24 +08:00
break;
case 337:
return 760;
2019-12-31 18:47:24 +08:00
break;
case 338:
return 761;
2019-12-31 18:47:24 +08:00
break;
case 339:
return 762;
2019-12-31 18:47:24 +08:00
break;
case 340:
return 763;
2019-12-31 18:47:24 +08:00
break;
case 341:
return 57;
break;
case 342:
return 764;
2019-12-31 18:47:24 +08:00
break;
case 343:
return 765;
2019-12-31 18:47:24 +08:00
break;
case 344:
return 766;
2019-12-31 18:47:24 +08:00
break;
case 345:
return 767;
2019-12-31 18:47:24 +08:00
break;
case 346:
return 768;
2019-12-31 18:47:24 +08:00
break;
case 347:
return 769;
2019-12-31 18:47:24 +08:00
break;
case 348:
return 770;
2019-12-31 18:47:24 +08:00
break;
case 349:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('TRUNCATE', yy_.yylloc, yy.lexer.upcomingInput());
return 392;
2019-12-31 18:47:24 +08:00
break;
case 350:
return 771;
2019-12-31 18:47:24 +08:00
break;
case 351:
return 983;
2019-12-31 18:47:24 +08:00
break;
case 352:
return 109;
break;
case 353:
return 772;
2019-12-31 18:47:24 +08:00
break;
case 354:
return 773;
2019-12-31 18:47:24 +08:00
break;
case 355:
return 880;
2019-12-31 18:47:24 +08:00
break;
case 356:
return 774;
2019-12-31 18:47:24 +08:00
break;
case 357:
parser.determineCase(yy_.yytext);
return 1021;
2019-12-31 18:47:24 +08:00
break;
case 358:
return 348;
2019-12-31 18:47:24 +08:00
break;
case 359:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('UPSERT', yy_.yylloc);
return 484;
2019-12-31 18:47:24 +08:00
break;
case 360:
return 463;
2019-12-31 18:47:24 +08:00
break;
case 361:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('USE', yy_.yylloc);
return 1035;
2019-12-31 18:47:24 +08:00
break;
case 362:
return 776;
2019-12-31 18:47:24 +08:00
break;
case 363:
return 777;
2019-12-31 18:47:24 +08:00
break;
case 364:
return 778;
2019-12-31 18:47:24 +08:00
break;
case 365:
return 276;
2019-12-31 18:47:24 +08:00
break;
case 366:
return 781;
2019-12-31 18:47:24 +08:00
break;
case 367:
return 782;
2019-12-31 18:47:24 +08:00
break;
case 368:
return 786;
2019-12-31 18:47:24 +08:00
break;
case 369:
return 787;
2019-12-31 18:47:24 +08:00
break;
case 370:
return 141;
break;
case 371:
return 788;
2019-12-31 18:47:24 +08:00
break;
case 372:
return 789;
2019-12-31 18:47:24 +08:00
break;
case 373:
return 790;
2019-12-31 18:47:24 +08:00
break;
case 374:
return 791;
2019-12-31 18:47:24 +08:00
break;
case 375:
return 792;
2019-12-31 18:47:24 +08:00
break;
case 376:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('WITH', yy_.yylloc);
return 307;
2019-12-31 18:47:24 +08:00
break;
case 377:
return 793;
2019-12-31 18:47:24 +08:00
break;
case 378:
return 794;
2019-12-31 18:47:24 +08:00
break;
case 379:
this.begin('hdfs');
return 206;
break;
case 380:
return 53;
break;
case 381:
return 685;
2019-12-31 18:47:24 +08:00
break;
case 382:
return 360;
2019-12-31 18:47:24 +08:00
break;
case 383:
return 236;
break;
case 384:
return 64;
break;
case 385:
return 241;
break;
case 386:
return 41;
break;
case 387:
return 242;
break;
case 388:
return 535;
2019-12-31 18:47:24 +08:00
break;
case 389:
return 490;
2019-12-31 18:47:24 +08:00
break;
case 390:
return 489;
2019-12-31 18:47:24 +08:00
break;
case 391:
yy.lexer.unput('(');
yy_.yytext = 'appx_median';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 516;
2019-12-31 18:47:24 +08:00
break;
case 392:
yy.lexer.unput('(');
yy_.yytext = 'avg';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 526;
2019-12-31 18:47:24 +08:00
break;
case 393:
yy.lexer.unput('(');
yy_.yytext = 'cast';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 542;
2019-12-31 18:47:24 +08:00
break;
case 394:
yy.lexer.unput('(');
yy_.yytext = 'count';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 557;
2019-12-31 18:47:24 +08:00
break;
case 395:
yy.lexer.unput('(');
yy_.yytext = 'extract';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 601;
2019-12-31 18:47:24 +08:00
break;
case 396:
yy.lexer.unput('(');
yy_.yytext = 'group_concat';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 617;
2019-12-31 18:47:24 +08:00
break;
case 397:
yy.lexer.unput('(');
yy_.yytext = 'left';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 963;
2019-12-31 18:47:24 +08:00
break;
case 398:
yy.lexer.unput('(');
yy_.yytext = 'max';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 659;
2019-12-31 18:47:24 +08:00
break;
case 399:
yy.lexer.unput('(');
yy_.yytext = 'min';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 662;
2019-12-31 18:47:24 +08:00
break;
case 400:
yy.lexer.unput('(');
yy_.yytext = 'ndv';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 669;
2019-12-31 18:47:24 +08:00
break;
case 401:
yy.lexer.unput('(');
yy_.yytext = 'stddev';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 744;
2019-12-31 18:47:24 +08:00
break;
case 402:
yy.lexer.unput('(');
yy_.yytext = 'stddev_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 745;
2019-12-31 18:47:24 +08:00
break;
case 403:
yy.lexer.unput('(');
yy_.yytext = 'stddev_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 746;
2019-12-31 18:47:24 +08:00
break;
case 404:
yy.lexer.unput('(');
yy_.yytext = 'sum';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 753;
2019-12-31 18:47:24 +08:00
break;
case 405:
yy.lexer.unput('(');
yy_.yytext = 'var_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 779;
2019-12-31 18:47:24 +08:00
break;
case 406:
yy.lexer.unput('(');
yy_.yytext = 'var_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 780;
2019-12-31 18:47:24 +08:00
break;
case 407:
yy.lexer.unput('(');
yy_.yytext = 'variance';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 783;
2019-12-31 18:47:24 +08:00
break;
case 408:
yy.lexer.unput('(');
yy_.yytext = 'variance_pop';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 784;
2019-12-31 18:47:24 +08:00
break;
case 409:
yy.lexer.unput('(');
yy_.yytext = 'variance_samp';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 785;
2019-12-31 18:47:24 +08:00
break;
case 410:
yy.lexer.unput('(');
yy_.yytext = 'cume_dist';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 411:
yy.lexer.unput('(');
yy_.yytext = 'dense_rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 412:
yy.lexer.unput('(');
yy_.yytext = 'first_value';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 413:
yy.lexer.unput('(');
yy_.yytext = 'lag';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 414:
yy.lexer.unput('(');
yy_.yytext = 'last_value';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 415:
yy.lexer.unput('(');
yy_.yytext = 'lead';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 416:
yy.lexer.unput('(');
yy_.yytext = 'ntile';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 417:
yy.lexer.unput('(');
yy_.yytext = 'percent_rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 418:
yy.lexer.unput('(');
yy_.yytext = 'rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 419:
yy.lexer.unput('(');
yy_.yytext = 'row_number';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 513;
2019-12-31 18:47:24 +08:00
break;
case 420:
yy.lexer.unput('(');
yy_.yytext = 'system';
return 930;
2019-12-31 18:47:24 +08:00
break;
case 421:
return 362;
2019-12-31 18:47:24 +08:00
break;
case 422:
return 362;
2019-12-31 18:47:24 +08:00
break;
case 423:
return 775;
2019-12-31 18:47:24 +08:00
break;
case 424:
return 504;
2019-12-31 18:47:24 +08:00
break;
case 425:
parser.yy.cursorFound = true;
return 27;
break;
case 426:
parser.yy.cursorFound = true;
return 797;
2019-12-31 18:47:24 +08:00
break;
case 427:
return 621;
2019-12-31 18:47:24 +08:00
break;
case 428:
parser.addFileLocation(yy_.yylloc, yy_.yytext);
return 988;
2019-12-31 18:47:24 +08:00
break;
case 429:
this.popState();
return 989;
2019-12-31 18:47:24 +08:00
break;
case 430:
return 500;
2019-12-31 18:47:24 +08:00
break;
case 431:
return 514;
2019-12-31 18:47:24 +08:00
break;
case 432:
return 682;
2019-12-31 18:47:24 +08:00
break;
case 433:
return 54;
break;
case 434:
return 237;
break;
case 435:
return 238;
break;
case 436:
return 278;
2019-12-31 18:47:24 +08:00
break;
case 437:
return 278;
2019-12-31 18:47:24 +08:00
break;
case 438:
return 278;
2019-12-31 18:47:24 +08:00
break;
case 439:
return 278;
2019-12-31 18:47:24 +08:00
break;
case 440:
return 278;
2019-12-31 18:47:24 +08:00
break;
case 441:
return 509;
2019-12-31 18:47:24 +08:00
break;
case 442:
return 508;
2019-12-31 18:47:24 +08:00
break;
case 443:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 444:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 445:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 446:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 447:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 448:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 449:
return 95;
break;
case 450:
return 138;
break;
case 451:
return 342;
2019-12-31 18:47:24 +08:00
break;
case 452:
return 248;
break;
case 453:
return 405;
2019-12-31 18:47:24 +08:00
break;
case 454:
return 795;
2019-12-31 18:47:24 +08:00
break;
case 455:
return 507;
2019-12-31 18:47:24 +08:00
break;
case 456:
return 89;
break;
case 457:
return 91;
break;
case 458:
return 510;
2019-12-31 18:47:24 +08:00
break;
case 459:
return 511;
2019-12-31 18:47:24 +08:00
break;
case 460:
return 505;
2019-12-31 18:47:24 +08:00
break;
case 461:
this.begin('backtickedValue');
return 527;
2019-12-31 18:47:24 +08:00
break;
case 462:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '`')) {
return 800;
2019-12-31 18:47:24 +08:00
}
return 181;
break;
case 463:
this.popState();
return 527;
2019-12-31 18:47:24 +08:00
break;
case 464:
this.begin('singleQuotedValue');
return 179;
break;
case 465:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '\'')) {
return 800;
2019-12-31 18:47:24 +08:00
}
return 181;
break;
case 466:
this.popState();
return 179;
break;
case 467:
this.begin('doubleQuotedValue');
return 180;
break;
case 468:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '"')) {
return 800;
2019-12-31 18:47:24 +08:00
}
return 181;
break;
case 469:
this.popState();
return 180;
break;
case 470:
return 500;
2019-12-31 18:47:24 +08:00
break;
case 471: /* To prevent console logging of unknown chars */
break;
case 472:
break;
case 473:
break;
case 474:
break;
case 475:
break;
case 476:
console.log(yy_.yytext);
break;
}
},
rules: [/^(?:\s)/i, /^(?:--.*)/i, /^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/i, /^(?:\u2020)/i, /^(?:\u2021)/i, /^(?:ADD)/i, /^(?:AGGREGATE)/i, /^(?:ALL)/i, /^(?:ALLOCATE)/i, /^(?:ALTER)/i, /^(?:ANALYTIC)/i, /^(?:AND)/i, /^(?:ANTI)/i, /^(?:ANY)/i, /^(?:ARE)/i, /^(?:ARRAY_AGG)/i, /^(?:ARRAY_MAX_CARDINALITY)/i, /^(?:AS)/i, /^(?:ASC)/i, /^(?:ASENSITIVE)/i, /^(?:ASYMMETRIC)/i, /^(?:AT)/i, /^(?:ATOMIC)/i, /^(?:AUTHORIZATION)/i, /^(?:AVRO)/i, /^(?:BEGIN_FRAME)/i, /^(?:BEGIN_PARTITION)/i, /^(?:BETWEEN)/i, /^(?:BIGINT)/i, /^(?:BLOB)/i, /^(?:BLOCK_SIZE)/i, /^(?:BOOLEAN)/i, /^(?:BOTH)/i, /^(?:BY)/i, /^(?:CACHED)/i, /^(?:CALLED)/i, /^(?:CARDINALITY)/i, /^(?:CASCADE)/i, /^(?:CASCADED)/i, /^(?:CASE)/i, /^(?:CHANGE)/i, /^(?:CHAR)/i, /^(?:CHARACTER)/i, /^(?:CLOB)/i, /^(?:CLOSE_FN)/i, /^(?:COLLATE)/i, /^(?:COLLECT)/i, /^(?:COLUMN)/i, /^(?:COLUMNS)/i, /^(?:COMMENT)/i, /^(?:COMMIT)/i, /^(?:COMPRESSION)/i, /^(?:COMPUTE)/i, /^(?:CONDITION)/i, /^(?:CONNECT)/i, /^(?:CONSTRAINT)/i, /^(?:CONTAINS)/i, /^(?:CONVERT)/i, /^(?:COPY)/i, /^(?:CORR)/i, /^(?:CORRESPONDING)/i, /^(?:COVAR_POP)/i, /^(?:COVAR_SAMP)/i, /^(?:CREATE)/i, /^(?:CROSS)/i, /^(?:CUBE)/i, /^(?:CURRENT)/i, /^(?:CURRENT_DATE)/i, /^(?:CURRENT_DEFAULT_TRANSFORM_GROUP)/i, /^(?:CURRENT_PATH)/i, /^(?:CURRENT_ROLE)/i, /^(?:CURRENT_ROW)/i, /^(?:CURRENT_SCHEMA)/i, /^(?:CURRENT_TIME)/i, /^(?:CURRENT_TRANSFORM_GROUP_FOR_TYPE)/i, /^(?:CYCLE)/i, /^(?:DATA)/i, /^(?:DATABASE)/i, /^(?:DATABASES)/i, /^(?:DEALLOCATE)/i, /^(?:DEC)/i, /^(?:DECFLOAT)/i, /^(?:DECIMAL)/i, /^(?:DECLARE)/i, /^(?:DEFINE)/i, /^(?:DELETE)/i, /^(?:DELIMITED)/i, /^(?:DEREF)/i, /^(?:DESC)/i, /^(?:DESCRIBE)/i, /^(?:DETERMINISTIC)/i, /^(?:DISCONNECT)/i, /^(?:DISTINCT)/i, /^(?:DIV)/i, /^(?:DOUBLE)/i, /^(?:DROP)/i, /^(?:DYNAMIC)/i, /^(?:EACH)/i, /^(?:ELEMENT)/i, /^(?:ELSE)/i, /^(?:EMPTY)/i, /^(?:ENCODING)/i, /^(?:END)/i, /^(?:END_FRAME)/i, /^(?:END_PARTITION)/i, /^(?:EQUALS)/i, /^(?:ESCAPE)/i, /^(?:ESCAPED)/i, /^(?:EVERY)/i, /^(?:EXCEPT)/i, /^(?:EXEC)/i, /^(?:EXECUTE)/i, /^(?:EXISTS)/i, /^(?:EXPLAIN)/i, /^(?:EXTENDED)/i, /^(?:EXTERNAL)/i, /^(?:FALSE)/i, /^(?:FETCH)/i, /^(?:FIELDS)/i, /^(?:FILEFORMAT)/i, /^(?:FILES)/i, /^(?:FILTER)/i, /^(?:FINALIZE_FN)/i, /^(?:FIRST)/i, /^(?:FLOAT)/i, /^(?:FOLLOWING)/i, /^(?:FOR)/i, /^(?:FOREIGN)/i, /^(?:FORMAT)/i, /^(?:FORMATTED)/i, /^(?:FRAME_ROW)/i, /^(?:FREE)/i, /^(?:FROM)/i, /^(?:FULL)/i, /^(?:FUNCTION)/i, /^(?:FUNCTIONS)/i, /^(?:FUSION)/i, /^(?:GET)/i, /^(?:GLOBAL)/i, /^(?:GRANT)/i, /^(?:GROUP)/i, /^(?:GROUPING)/i, /^(?:GROUPS)/i, /^(?:HASH)/i, /^(?:HAVING)/i, /^(?:HOLD)/i, /^(?:IF)/i, /^(?:IGNORE)/i, /^(?:ILIKE)/i, /^(?:IN)/i, /^(?:INCREMENTAL)/i, /^(?:INDICATOR)/i, /^(?:INIT_FN)/i, /^(?:INITIAL)/i, /^(?:INNER)/i, /^(?:INOUT)/i, /^(?:INPATH)/i, /^(?:INSENSITIVE)/i, /^(?:INSERT)/i, /^(?:INT)/i, /^(?:INTERMEDIATE)/i, /^(?:INTERSECT)/i, /^(?:INTERSECTION)/i, /^(?:INTERVAL)/i, /^(?:INTO)/i, /^(?:INVALIDATE)/i, /^(?:IREGEXP)/i, /^(?:IS)/i, /^(?:JOIN)/i, /^(?:JSON_ARRAY)/i, /^(?:JSON_ARRAYAGG)/i, /^(?:JSON_EXISTS)/i, /^(?:JSON_OBJECT)/i, /^(?:JSON_OBJECTAGG)/i, /^(?:JSON_QUERY)/i, /^(?:JSON_TABLE)/i, /^(?:JSON_TABLE_PRIMITIVE)/i, /^(?:JSON_VALUE)/i, /^(?:KEY)/i, /^(?:KUDU)/i, /^(?:LARGE)/i, /^(?:LAST)/i, /^(?:LATERAL)/i, /^(?:LEADING)/i, /^(?:LEFT)/i, /^(?:LIKE)/i, /^(?:LIKE_REGEX)/i, /^(?:LIMIT)/i, /^(?:LIFECYCLE)/i, /^(?:LINES)/i, /^(?:LISTAGG)/i, /^(?:LOAD)/i, /^(?:LOCAL)/i, /^(?:LOCALTIMESTAMP)/i, /^(?:LOCATION)/i, /^(?:MATCH)/i, /^(?:MATCH_NUMBER)/i, /^(?:MATCH_RECOGNIZE)/i, /^(?:MATCHES)/i, /^(?:MERGE)/i, /^(?:MERGE_FN)/i, /^(?:METADATA)/i, /^(?:METHOD)/i, /^(?:MODIFIES)/i, /^(?:MULTISET)/i, /^(?:NATIONAL)/i, /^(?:NATURAL)/i, /^(?:NCHAR)/i, /^(?:NCLOB)/i, /^(?:NO)/i, /^(?:NONE)/i, /^(?:NORMALIZE)/i, /^(?:NOT)/i, /^(?:NTH_VALUE)/i, /^(?:NULL)/i, /^(?:NULLS)/i, /^(?:NUMERIC)/i, /^(?:OCCURRENCES_REGEX)/i, /^(?:OCTET_LENGTH)/i, /^(?:OF)/i, /^(?:OFFSET)/i, /^(?:OMIT)/i, /^(?:ON)/i, /^(?:ONE)/i, /^(?:ONLY)/i, /^(?:OPTION)/i, /^(?:OR)/i, /^(?:ORC)/i, /^(?:ORDER)/i, /^(?:OUT)/i, /^(?:OUTER)/i, /^(?:OVER)/i, /^(?:OVERLAPS)/i, /^(?:OVERLAY)/i, /^(?:OVERWRITE)/i, /^(?:PARQUET)/i, /^(?:PARTITI
conditions: { "hdfs": { "rules": [425, 426, 427, 428, 429, 430, 472], "inclusive": false }, "doubleQuotedValue": { "rules": [468, 469, 475], "inclusive": false }, "singleQuotedValue": { "rules": [465, 466, 474], "inclusive": false }, "backtickedValue": { "rules": [462, 463, 473], "inclusive": false }, "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, 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, 312, 313, 314, 315, 316, 317, 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, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 464, 467, 470, 471, 476], "inclusive": true } }
});
return lexer;
})();
parser.lexer = lexer;
function Parser() {
this.yy = {};
}
Parser.prototype = parser;
parser.Parser = Parser;
return new Parser;
})();
exports.default = impalaAutocompleteParser;