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

5365 lines
413 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 impalaSyntaxParser = (function () {
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v)
; return o; }, $V0 = [26, 38, 63, 86, 147, 153, 155, 170, 307, 392, 393, 402, 414, 415, 418, 441, 452, 459, 463, 471, 815, 1001, 1016, 1030], $V1 = [2, 825], $V2 = [459, 463], $V3 = [2, 826], $V4 = [1, 50], $V5 = [1, 70], $V6 = [1, 77], $V7 = [1, 73], $V8 = [1, 32], $V9 = [1, 33], $Va = [1, 34], $Vb = [1, 74], $Vc = [1, 69], $Vd = [1, 78], $Ve = [1, 64], $Vf = [1, 47], $Vg = [1, 85], $Vh = [1, 68], $Vi = [1, 48], $Vj = [1, 84], $Vk = [1, 66], $Vl = [1, 27], $Vm = [1, 49], $Vn = [1, 79], $Vo = [1, 67], $Vp = [1, 63], $Vq = [91, 361, 459, 463], $Vr = [2, 1471], $Vs = [1, 94], $Vt = [1, 96], $Vu = [1, 110], $Vv = [1, 107], $Vw = [1, 112], $Vx = [1, 108], $Vy = [1, 111], $Vz = [1, 113], $VA = [1, 109], $VB = [1, 104], $VC = [1, 105], $VD = [1, 103], $VE = [1, 120], $VF = [1, 122], $VG = [1, 124], $VH = [1, 121], $VI = [1, 119], $VJ = [1, 123], $VK = [1, 125], $VL = [41, 64, 242, 254, 411, 412, 417, 469, 470, 494], $VM = [2, 1280], $VN = [1, 130], $VO = [1, 131], $VP = [1, 145], $VQ = [2, 1506], $VR = [1, 153], $VS = [1, 154], $VT = [1, 161], $VU = [1, 162], $VV = [1, 174], $VW = [1, 176], $VX = [1, 173], $VY = [276, 415, 446, 447], $VZ = [91, 361, 459, 463, 747], $V_ = [2, 1299], $V$ = [26, 38, 41, 44, 51, 56, 57, 63, 64, 70, 73, 86, 89, 91, 95, 101, 106, 109, 111, 136, 142, 179, 180, 242, 254, 256, 269, 276, 288, 307, 361, 391, 395, 403, 411, 412, 415, 417, 446, 447, 459, 463, 469, 470, 481, 494, 503, 527, 582, 589, 598, 606, 620, 622, 626, 655, 657, 693, 707, 733, 747, 752, 765, 871], $V01 = [26, 38, 41, 44, 50, 51, 54, 56, 57, 63, 64, 70, 73, 85, 86, 87, 88, 89, 91, 95, 101, 106, 109, 111, 136, 138, 142, 144, 146, 179, 180, 206, 208, 224, 236, 237, 238, 241, 242, 248, 253, 254, 256, 269, 276, 278, 288, 307, 361, 391, 395, 403, 411, 412, 415, 417, 446, 447, 459, 463, 469, 470, 474, 475, 476, 477, 480, 481, 485, 488, 494, 497, 498, 500, 503, 506, 510, 527, 543, 547, 551, 555, 557, 575, 582, 589, 594, 595, 598, 601, 605, 606, 620, 622, 626, 646, 654, 655, 657, 675, 680, 692, 693, 694, 698, 707, 711, 723, 733, 734, 735, 738, 747, 752, 757, 763, 765, 871], $V11 = [1, 234], $V21 = [1, 235], $V31 = [1, 243], $V41 = [2, 1326], $V51 = [54, 138], $V61 = [91, 95, 361, 395, 403, 459, 463, 589, 622, 655, 747, 765, 871], $V71 = [1, 254], $V81 = [1, 255], $V91 = [1, 259], $Va1 = [1, 256], $Vb1 = [1, 253], $Vc1 = [1, 260], $Vd1 = [1, 257], $Ve1 = [1, 261], $Vf1 = [1, 258], $Vg1 = [91, 95, 142, 361, 395, 403, 459, 463, 481, 527, 582, 589, 598, 606, 620, 622, 655, 657, 693, 707, 733, 747, 752, 765, 871], $Vh1 = [2, 1916], $Vi1 = [1, 265], $Vj1 = [1, 268], $Vk1 = [1, 269], $Vl1 = [41, 64, 91, 95, 136, 142, 179, 180, 242, 254, 361, 395, 403, 411, 412, 417, 459, 463, 469, 470, 481, 494, 527, 582, 589, 598, 606, 620, 622, 655, 657, 693, 707, 733, 747, 752, 765, 871], $Vm1 = [307, 415], $Vn1 = [2, 1894], $Vo1 = [26, 41, 51, 64, 242, 254, 411, 412, 417, 459, 463, 469, 470, 494], $Vp1 = [41, 64, 73, 89, 138, 146, 179, 180, 224, 236, 241, 242, 254, 362, 392, 411, 412, 417, 469, 470, 473, 474, 475, 479, 483, 493, 494, 508, 509, 524, 566, 569, 570, 586, 592, 604, 631, 634, 641, 719, 720, 721, 728, 745, 750, 751, 754, 755, 758, 759, 760, 770, 957], $Vq1 = [41, 64, 73, 89, 91, 138, 146, 179, 180, 224, 236, 241, 242, 254, 362, 392, 411, 412, 415, 417, 469, 470, 473, 474, 475, 479, 483, 493, 494, 508, 509, 524, 566, 569, 570, 586, 592, 604, 631, 634, 641, 719, 720, 721, 722, 728, 745, 750, 751, 754, 755, 758, 759, 760, 770, 957], $Vr1 = [89, 95, 414, 415, 441], $Vs1 = [41, 64, 242, 254, 411, 412, 417, 459, 463, 469, 470, 494, 592], $Vt1 = [50, 51], $Vu1 = [2, 1292], $Vv1 = [2, 164], $Vw1 = [1, 286], $Vx1 = [1, 292], $Vy1 = [1, 294], $Vz1 = [1, 295], $VA1 = [1, 297], $VB1 = [1, 298], $VC1 = [1, 300], $VD1 = [1, 299], $VE1 = [2, 1289], $VF1 = [1, 307], $VG1 = [1, 342], $VH1 = [1, 341], $VI1 = [1, 343], $VJ1 = [179, 208, 459, 463], $VK1 = [2, 1296], $VL1 = [1, 349], $VM1 = [1, 353], $VN1 = [2, 761], $VO1 = [1, 355], $VP1 = [41, 64, 129, 242, 254, 411, 412, 417, 469, 470, 494], $VQ1 = [1, 367], $VR1 = [1, 366], $VS1 = [1, 368], $VT1 = [1, 369], $VU
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", 402: "GRANT", 403: "GROUP", 411: "SERVER", 412: "URI", 413: "ALL", 414: "INSERT", 415: "SELECT", 417: "OPTION", 418: "REVOKE", 441: "UPSERT", 442: "INTO", 445: "OVERWRITE", 446: "SHUFFLE", 447: "NOSHUFFLE", 452: "LOAD", 453: "DATA", 454: "INPATH", 459: "EOF", 463: ";", 467: "SetSpecification_EDIT", 469: "REGULAR_IDENTIFIER", 470: "VARIABLE_REFERENCE", 471: "EXPLAIN", 473: "!", 474: "*", 475: "-", 476: "[", 477: "]", 478: "ALLOCATE", 479: "ANALYTIC", 480: "AND", 481: "ANTI", 482: "ANY", 483: "APPX_MEDIAN", 484: "ARE", 485: "ARITHMETIC_OPERATOR", 486: "ARRAY_AGG", 487: "ARRAY_MAX_CARDINALITY", 488: "ASC", 489: "ASENSITIVE", 490: "ASYMMETRIC", 491: "AT", 492: "ATOMIC", 493: "AVG", 494: "BACKTICK", 495: "BEGIN_FRAME", 496: "BEGIN_PARTITION", 497: "BETWEEN", 498: "BIGINT", 499: "BLOB", 500: "BOOLEAN", 501: "BOTH", 502: "BROADCAST", 503: "CACHED", 504: "CALLED", 505: "CARDINALITY", 506: "CASCADE", 507: "CASCADED", 508: "CASE", 509: "CAST", 510: "CHAR", 511: "CHARACTER", 512: "CLOB", 513: "COLLATE", 514: "COLLECT", 515: "COMMIT", 516: "CONDITION", 517: "CONNECT", 518: "CONSTRAINT", 519: "CONTAINS", 520: "CONVERT", 521: "COPY", 522: "CORR", 523: "CORRESPONDING", 524: "COUNT", 525: "COVAR_POP", 526: "COVAR_SAMP", 527: "CROSS", 528: "CUBE", 529: "CURRENT", 530: "CURRENT_DATE", 531: "CURRENT_DEFAULT_TRANSFORM_GROUP", 532: "CURRENT_PATH", 533: "CURRENT_ROLE", 534: "CURRENT_ROW", 535: "CURRENT_SCHEMA", 536: "CURRENT_TIME", 537: "CURRENT_TRANSFORM_GROUP_FOR_TYPE", 538: "CYCLE", 539: "DATABASES", 540: "DEALLOCATE", 541: "DEC", 542: "DECFLOAT", 543: "DECIMAL", 544: "DECLARE", 545: "DEFINE", 546: "DEREF", 547: "DESC", 548: "DETERMINISTIC", 549: "DISCONNECT", 550: "DISTINCT", 551: "DOUBLE", 552: "DYNAMIC", 553: "EACH", 554: "ELEMENT", 555: "ELSE", 556: "EMPTY", 557: "END", 558: "END_FRAME", 559: "END_PARTITION", 560: "EQUALS", 561: "ESCAPE", 562: "EVERY", 563: "EXCEPT", 564: "EXEC", 565: "EXECUTE", 566: "EXISTS", 567: "EXTENDED", 568: "EXTERNAL", 569: "EXTRACT", 570: "FALSE", 571: "FETCH", 572: "FILES", 573: "FILTER", 574: "FIRST", 575: "FLOAT", 576: "FOLLOWING", 577: "FOR", 578: "FOREIGN", 579: "FORMATTED", 580: "FRAME_ROW", 581: "FREE", 582: "FULL", 583: "FUSION", 584: "GET", 585: "GLOBAL", 586: "GROUP_CONCAT", 587: "GROUPING", 588: "GROUPS", 589: "HAVING", 590: "HDFS_START_QUOTE", 591: "HOLD", 592: "IF", 593: "IGNORE", 594: "ILIKE", 595: "IN", 596: "INDICATOR", 597: "INITIAL", 598: "INNER", 599: "INOUT", 600: "INSENSITIVE", 601: "INT", 602: "INT
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], [173, 2], [175, 2], [175, 2], [174, 0], [174, 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, 3], [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 2127:
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 730:
case 1364:
case 2163:
case 2222:
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 425:
case 430:
case 431:
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 439:
case 1391:
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 668:
case 2123:
case 2183:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['STATS']);
break;
case 79:
case 122:
case 159:
case 464:
case 1331:
case 1335:
case 1339:
case 1374:
case 1375:
2019-12-31 18:47:24 +08:00
case 1420:
case 1423:
case 1551:
case 1596:
case 2213:
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 720:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TO']);
break;
case 93:
case 189:
case 1360:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases({ appendDot: true });
break;
case 94:
case 409:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['PARTITIONS']);
break;
case 111:
parser.suggestIdentifiers(['\'avgSize\'', '\'maxSize\'', '\'numDVs\'', '\'numNulls\'']);
break;
case 125:
case 475:
2019-12-31 18:47:24 +08:00
parser.suggestFileFormats();
break;
case 128:
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH REPLICATION =']);
}
break;
case 130:
case 468:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FORMAT']);
break;
case 131:
case 469:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DELIMITED']);
break;
case 132:
case 1826:
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 662:
case 682:
case 686:
case 688:
case 727:
case 1451:
case 2122:
case 2126:
case 2171:
case 2182:
case 2202:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
break;
case 162:
case 677:
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 467:
case 1494:
case 1533:
case 1554:
case 1567:
case 1571:
case 1589:
case 1612:
case 1638:
case 1639:
case 1716:
case 1718:
case 1786:
case 1796:
case 1803:
case 1815:
case 1978:
case 2218:
case 2262:
case 2263:
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 506:
case 515:
case 1504:
case 1899:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SELECT']);
break;
case 191:
case 687:
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 663:
case 673:
case 674:
case 693:
case 809:
case 818:
case 819:
case 2139:
case 2172:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
break;
case 202:
case 1452:
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 817:
case 2143:
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 664:
case 669:
case 699:
case 731:
case 815:
case 1346:
case 2199:
case 2219:
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 667:
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 265:
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 248:
var keywords = [];
if (!$$[$0]) {
keywords.push('LOCATION');
}
if (!$$[$0 - 1] && !$$[$0]) {
keywords.push('COMMENT');
}
if (keywords.length > 0) {
parser.suggestKeywords(keywords);
}
break;
case 278:
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 279:
parser.addNewTableLocation(_$[$0 - 1], $$[$0 - 1], $$[$0]);
this.$ = $$[$0];
break;
case 284:
case 285:
case 1352:
case 1355:
2019-12-31 18:47:24 +08:00
this.$ = [];
break;
case 288:
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
parser.suggestKeywords(['PARQUET']);
break;
case 290:
case 609:
case 611:
2019-12-31 18:47:24 +08:00
case 1266:
case 1269:
case 1353:
case 1393:
case 1458:
case 1620:
case 1799:
case 1896:
case 1953:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
break;
case 291:
case 610:
case 612:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 3];
break;
case 294:
parser.suggestKeywords(['PRIMARY KEY']);
break;
case 295:
case 1350:
case 1496:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0]];
break;
case 296:
this.$ = $$[$0 - 2].concat($$[$0]);
break;
case 301:
case 303:
case 462:
2019-12-31 18:47:24 +08:00
parser.checkForKeywords($$[$0 - 1]);
break;
case 302:
case 304:
parser.checkForKeywords($$[$0 - 3]);
break;
case 305:
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 306:
case 339:
case 345:
case 346:
case 359:
case 362:
case 371:
case 373:
parser.suggestKeywords(parser.getColumnDataTypeKeywords());
break;
case 309:
case 1871:
2019-12-31 18:47:24 +08:00
this.$ = {};
break;
case 311:
this.$ = {};
this.$[$$[$0]] = true;
break;
case 312:
$$[$0 - 1][$$[$0]] = true;
break;
case 317:
this.$ = 'primary';
break;
case 318:
this.$ = 'encoding';
break;
case 319:
this.$ = 'compression';
break;
case 320:
this.$ = 'default';
break;
case 321:
this.$ = 'block_size';
break;
case 322:
case 323:
this.$ = 'null';
break;
case 324:
this.$ = 'comment';
break;
case 326:
parser.suggestKeywords(['NULL']);
break;
case 344:
case 566:
case 577:
case 600:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(parser.getTypeKeywords());
break;
case 358:
case 361:
parser.suggestKeywords(['COMMENT']);
break;
case 382:
parser.suggestKeywords(['KEY']);
break;
case 392:
2019-12-31 18:47:24 +08:00
case 393:
case 396:
case 422:
case 490:
case 491:
case 495:
case 1979:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
break;
case 397:
case 400:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['HASH', 'RANGE']);
break;
case 438:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['VALUE', 'VALUES']);
break;
case 440:
2019-12-31 18:47:24 +08:00
case 446:
case 449:
case 807:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
break;
case 441:
2019-12-31 18:47:24 +08:00
if ($$[$0].endsWithLessThanOrEqual) {
parser.suggestKeywords(['VALUES']);
}
break;
case 442:
case 445:
case 448:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['<', '<=']);
break;
case 443:
2019-12-31 18:47:24 +08:00
case 1306:
case 1309:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['VALUES']);
break;
case 474:
case 1503:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AS']);
break;
case 483:
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 487:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ESCAPED BY'] };
break;
case 489:
case 494:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TERMINATED BY']);
break;
case 499:
case 500:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SERDEPROPERTIES']);
break;
case 508:
2019-12-31 18:47:24 +08:00
parser.commitLocations();
break;
case 510:
case 523:
case 539:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
parser.suggestDatabases({ appendDot: true });
break;
case 511:
case 524:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 6]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 514:
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 525:
case 544:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['RETURNS']);
break;
case 526:
case 545:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['LOCATION']);
break;
case 527:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SYMBOL']);
break;
case 537:
case 655:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FUNCTION']);
break;
case 538:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 13]) {
parser.suggestKeywords(['IF NOT EXISTS']);
}
break;
case 546:
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 547:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['MERGE_FN']);
break;
case 548:
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 567:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['...']);
break;
case 602:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestAggregateFunctions();
parser.suggestAnalyticFunctions();
break;
case 606:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['COMMENT']);
}
break;
case 622:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 1]);
break;
case 639:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'FUNCTION', 'INCREMENTAL STATS', 'ROLE', 'SCHEMA', 'STATS', 'TABLE', 'VIEW']);
break;
case 643:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestDatabases();
break;
case 644:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
break;
case 646:
case 651:
case 656:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 3]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 649:
case 650:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
parser.suggestDatabases({ appendDot: true });
break;
case 653:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE']);
break;
case 666:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['INCREMENTAL']);
break;
case 672:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['PARTITION']);
break;
case 676:
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 679:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0 - 1]) {
parser.suggestKeywords(['PURGE']);
}
break;
case 683:
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 684:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 689:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TABLE']);
break;
case 690:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 694:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
if (!$$[$0 - 2]) {
parser.suggestKeywords(['IF EXISTS']);
}
break;
case 697:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
if (!$$[$0 - 1]) {
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
}
break;
case 700:
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 713:
case 750:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DROP', 'INSERT', 'REFRESH', 'ROLE', 'SELECT']);
break;
case 714:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TO GROUP']);
break;
case 715:
case 752:
case 2179:
case 2180:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GROUP']);
break;
case 717:
case 754:
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 718:
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 721:
case 758:
case 2159:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
break;
case 722:
case 724:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['WITH GRANT OPTION']);
}
break;
case 726:
case 2155:
2019-12-31 18:47:24 +08:00
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 735:
2019-12-31 18:47:24 +08:00
this.$ = { isCreate: true };
break;
case 745:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GRANT OPTION']);
break;
case 746:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['OPTION']);
break;
case 751:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM GROUP']);
break;
case 755:
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 757:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
break;
case 763:
2019-12-31 18:47:24 +08:00
this.$ = { selectList: $$[$0] };
break;
case 764:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
this.$.cursorAtEnd = true;
break;
case 765:
2019-12-31 18:47:24 +08:00
parser.selectListNoTableSuggest($$[$0], $$[$0 - 2]);
break;
case 766:
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 772:
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 782:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].owner = 'upsert';
parser.addTablePrimary($$[$0 - 1]);
break;
case 783:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INTO']);
break;
case 784:
case 790:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['TABLE']);
}
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 785:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 3]) {
parser.suggestKeywords(['TABLE']);
}
$$[$0 - 1].owner = 'upsert';
parser.addTablePrimary($$[$0 - 1]);
break;
case 787:
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 788:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
if (!$$[$0]) {
this.$ = { suggestKeywords: ['PARTITION'] };
}
break;
case 789:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INTO', 'OVERWRITE']);
break;
case 791:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 4]) {
parser.suggestKeywords(['TABLE']);
}
$$[$0 - 2].owner = 'insert';
parser.addTablePrimary($$[$0 - 2]);
break;
case 793:
case 794:
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 810:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DATA INPATH']);
break;
case 811:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INPATH']);
break;
case 813:
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 814:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['TABLE']);
break;
case 823:
case 824:
2019-12-31 18:47:24 +08:00
return parser.yy.result;
break;
case 825:
2019-12-31 18:47:24 +08:00
parser.prepareNewStatement();
break;
case 827:
case 829:
case 831:
parser.addStatementLocation(_$[$0]);
break;
case 830:
case 832:
2019-12-31 18:47:24 +08:00
parser.addStatementLocation(_$[$0 - 3]);
break;
case 839:
2019-12-31 18:47:24 +08:00
parser.suggestDdlAndDmlKeywords(['EXPLAIN']);
break;
case 840:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['INSERT', 'SELECT']);
break;
case 863:
2019-12-31 18:47:24 +08:00
parser.suggestDdlAndDmlKeywords();
break;
case 1267:
case 1270:
case 1394:
2019-12-31 18:47:24 +08:00
this.$ = '';
break;
case 1290:
case 1293:
2019-12-31 18:47:24 +08:00
parser.yy.correlatedSubQuery = false;
break;
case 1291:
case 1295:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['EXISTS']);
break;
case 1294:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['NOT EXISTS']);
break;
case 1305:
case 1307:
case 1308:
case 1310:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['<', '<=', '<>', '=', '>', '>=']);
break;
case 1343:
case 1395:
2019-12-31 18:47:24 +08:00
parser.addTableLocation(_$[$0], [{ name: $$[$0] }]);
this.$ = { identifierChain: [{ name: $$[$0] }] };
break;
case 1344:
case 1396:
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 1345:
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 1347:
case 1361:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases();
this.$ = { identifierChain: [{ name: $$[$0 - 2] }] };
break;
case 1348:
2019-12-31 18:47:24 +08:00
// You can have statements like 'SELECT ... FROM testTable t, t.|'
parser.suggestTablesOrColumns($$[$0 - 2]);
break;
case 1349:
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 1351:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].push($$[$0]);
break;
case 1354:
case 1460:
case 1801:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2];
break;
case 1356:
2019-12-31 18:47:24 +08:00
this.$ = { name: $$[$0] };
break;
case 1358:
2019-12-31 18:47:24 +08:00
this.$ = [{ name: $$[$0] }];
break;
case 1359:
2019-12-31 18:47:24 +08:00
this.$ = [{ name: $$[$0 - 2] }, { name: $$[$0 - 1] }];
break;
case 1373:
case 1556:
case 1557:
case 1563:
case 1564:
case 1892:
case 1980:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
break;
case 1381:
case 1384:
2019-12-31 18:47:24 +08:00
if (!$$[$0]) {
this.$ = { suggestKeywords: ['WITH REPLICATION ='] };
}
break;
case 1386:
case 2140:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['IN']);
break;
case 1390:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['REPLICATION =']);
break;
case 1397:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ prependDot: true });
break;
case 1398:
2019-12-31 18:47:24 +08:00
parser.suggestTablesOrColumns($$[$0 - 2]);
break;
case 1400:
2019-12-31 18:47:24 +08:00
this.$ = { identifierChain: $$[$0 - 1].identifierChain, alias: $$[$0] };
break;
case 1403:
2019-12-31 18:47:24 +08:00
parser.yy.locations[parser.yy.locations.length - 1].type = 'column';
break;
case 1404:
case 1752:
2019-12-31 18:47:24 +08:00
parser.addAsteriskLocation(_$[$0], $$[$0 - 2].concat({ asterisk: true }));
break;
case 1406:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0].identifier];
parser.yy.firstChainLocation = parser.addUnknownLocation($$[$0].location, [$$[$0].identifier]);
break;
case 1407:
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 1408:
case 1416:
2019-12-31 18:47:24 +08:00
if ($$[$0].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1409:
case 1417:
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 1412:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({
identifierChain: $$[$0 - 2]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1413:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({
identifierChain: $$[$0 - 4]
});
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
break;
case 1414:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0].identifier];
break;
case 1415:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].push($$[$0].identifier);
break;
case 1418:
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 1419:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 2].insideKey) {
parser.suggestKeyValues({ identifierChain: [$$[$0 - 2].identifier] });
parser.suggestColumns();
parser.suggestFunctions();
}
break;
case 1421:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({ identifierChain: $$[$0 - 2] });
break;
case 1422:
2019-12-31 18:47:24 +08:00
parser.suggestColumns({ identifierChain: $$[$0 - 4] });
break;
case 1424:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0] }, location: _$[$0] };
break;
case 1425:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3], keySet: true }, location: _$[$0 - 3] };
break;
case 1426:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 2], keySet: true }, location: _$[$0 - 2] };
break;
case 1427:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3] }, insideKey: true };
break;
case 1428:
2019-12-31 18:47:24 +08:00
this.$ = { identifier: { name: $$[$0 - 3] } };
break;
case 1453:
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 1455:
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 1456:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
parser.suggestDatabases();
break;
case 1457:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 2]) {
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
}
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
break;
case 1463:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 3]);
break;
case 1464:
case 1465:
case 1499:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 2]);
break;
case 1469:
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 1470:
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 1481:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'DISTINCT', 'SELECT']);
break;
case 1482:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ALL', 'DISTINCT']);
break;
case 1484:
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 1485:
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 1486:
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 1487:
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 1488:
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 1489:
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 1490:
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 1491:
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 1497:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2].concat([$$[$0]]);
break;
case 1501:
2019-12-31 18:47:24 +08:00
parser.addCommonTableExpressions($$[$0 - 4]);
break;
case 1502:
2019-12-31 18:47:24 +08:00
parser.addCteAliasLocation(_$[$0 - 4], $$[$0 - 4]);
$$[$0 - 1].alias = $$[$0 - 4];
this.$ = $$[$0 - 1];
break;
case 1509:
case 1510:
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 1511:
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 1512:
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 1516:
2019-12-31 18:47:24 +08:00
this.$ = { tableReferenceList: $$[$0] };
break;
case 1517:
case 1808:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({ appendDot: true });
break;
case 1519:
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 1520:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'where';
}
break;
case 1521:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'group by';
}
break;
case 1523:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestColumns) {
parser.yy.result.suggestColumns.source = 'order by';
}
break;
case 1526:
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 1527:
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 1528:
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 1529:
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 1530:
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 1534:
2019-12-31 18:47:24 +08:00
if ($$[$0].suggestFilters) {
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1535:
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 1538:
2019-12-31 18:47:24 +08:00
this.$ = { valueExpression: $$[$0] };
break;
case 1539:
case 1578:
2019-12-31 18:47:24 +08:00
parser.suggestSelectListAliases();
break;
case 1540:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestSelectListAliases();
parser.suggestGroupBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1541:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
parser.suggestGroupBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1568:
2019-12-31 18:47:24 +08:00
if ($$[$0].emptyOrderBy) {
parser.suggestOrderBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
}
break;
case 1569:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BY']);
parser.suggestOrderBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
break;
case 1573:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: false };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 1574:
case 1575:
case 1576:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: false };
break;
case 1577:
2019-12-31 18:47:24 +08:00
this.$ = parser.mergeSuggestKeywords($$[$0 - 1], $$[$0]);
break;
case 1580:
2019-12-31 18:47:24 +08:00
this.$ = { emptyOrderBy: true };
parser.valueExpressionSuggest();
parser.suggestAnalyticFunctions();
parser.suggestSelectListAliases();
break;
case 1581:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ASC', 'DESC'] };
break;
case 1584:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['NULLS FIRST', 'NULLS LAST'] };
break;
case 1587:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FIRST', 'LAST']);
break;
case 1594:
2019-12-31 18:47:24 +08:00
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
this.$ = $$[$0];
break;
case 1600:
case 1605:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['BIGINT'] });
break;
case 1601:
case 1606:
2019-12-31 18:47:24 +08:00
delete parser.yy.result.suggestColumns;
break;
case 1610:
case 1611:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 1613:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0], 'NUMBER');
this.$ = $$[$0];
$$[$0].types = ['NUMBER'];
break;
case 1614:
case 1615:
case 1616:
case 1617:
case 1618:
2019-12-31 18:47:24 +08:00
case 1625:
case 1626:
case 1627:
case 1628:
case 1629:
case 1630:
case 1636:
case 1637:
case 1658:
case 1712:
case 1713:
case 1775:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'] };
break;
case 1619:
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 1621:
case 1622:
case 1623:
case 1624:
2019-12-31 18:47:24 +08:00
parser.addColRefToVariableIfExists($$[$0 - 2], $$[$0]);
this.$ = { types: ['BOOLEAN'] };
break;
case 1631:
case 1632:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0-2], 'BOOLEAN');
// verifyType($$[$0], 'BOOLEAN');
this.$ = { types: ['BOOLEAN'] };
break;
case 1633:
case 1634:
case 1635:
2019-12-31 18:47:24 +08:00
// verifyType($$[$0-2], 'NUMBER');
// verifyType($$[$0], 'NUMBER');
this.$ = { types: ['NUMBER'] };
break;
case 1641:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BETWEEN', 'EXISTS', 'IN', 'ILIKE', 'IREGEXP', 'LIKE', 'REGEXP', 'RLIKE']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1642:
case 1644:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1643:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
parser.suggestKeywords(['EXISTS']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1645:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['BOOLEAN'] });
parser.suggestColumns({ types: ['BOOLEAN'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 1646:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'], suggestFilters: $$[$0].suggestFilters };
break;
case 1647:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
this.$ = { types: ['T'] };
break;
case 1648:
2019-12-31 18:47:24 +08:00
if (!$$[$0].typeSet) {
parser.applyTypeToSuggestions('NUMBER');
}
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
break;
case 1649:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['NUMBER'] });
parser.suggestColumns({ types: ['NUMBER'] });
this.$ = { types: ['NUMBER'] };
break;
case 1650:
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 1651:
2019-12-31 18:47:24 +08:00
var keywords = ['FALSE', 'NULL', 'TRUE', 'DISTINCT FROM', 'UNKNOWN'];
parser.suggestKeywords(keywords);
this.$ = { types: ['BOOLEAN'] };
break;
case 1652:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FROM']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1653:
case 1654:
case 1655:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['NOT']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1656:
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 1657:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1659:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1];
break;
case 1660:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 1661:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1662:
case 1663:
case 1664:
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
parser.applyTypeToSuggestions($$[$0].types);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
2019-12-31 18:47:24 +08:00
case 1665:
case 1666:
case 1667:
case 1668:
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 1669:
case 1671:
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 1670:
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 1672:
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 1673:
case 1674:
case 1675:
case 1676:
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 1677:
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 1678:
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 1679:
case 1680:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
break;
case 1681:
case 1682:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
break;
case 1683:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 3].suggestFilters };
break;
case 1684:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1685:
case 1689:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1], ['AND']);
this.$ = { types: ['BOOLEAN'] };
break;
case 1686:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1687:
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 1688:
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 1690:
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 1691:
case 1693:
case 1695:
case 1697:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
this.$ = { types: ['BOOLEAN'], typeSet: true, suggestFilters: true };
break;
case 1692:
case 1696:
2019-12-31 18:47:24 +08:00
parser.addColRefIfExists($$[$0]);
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1694:
case 1698:
2019-12-31 18:47:24 +08:00
parser.addColRefIfExists($$[$0 - 2]);
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
break;
case 1699:
case 1700:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 1701:
case 1702:
case 1703:
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 1704:
case 1705:
case 1706:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
parser.applyTypeToSuggestions(['NUMBER']);
this.$ = { types: ['NUMBER'], typeSet: true };
break;
case 1707:
case 1708:
case 1709:
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 1710:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 1711:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 1714:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1715:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest(undefined, $$[$0 - 1] + ' ' + $$[$0]);
parser.applyTypeToSuggestions(['STRING']);
this.$ = { types: ['BOOLEAN'], typeSet: true };
break;
case 1717:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 1719:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
this.$ = { types: ['T'], typeSet: true };
break;
case 1720:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0];
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
break;
case 1721:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 1722:
case 2026:
case 2031:
case 2032:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['T'] };
break;
case 1723:
case 1725:
2019-12-31 18:47:24 +08:00
$$[$0].position = 1;
break;
case 1724:
2019-12-31 18:47:24 +08:00
$$[$0].position = $$[$0 - 2].position + 1;
this.$ = $$[$0];
break;
case 1726:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].position += 1;
break;
case 1727:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].position = 1;
break;
case 1728:
2019-12-31 18:47:24 +08:00
$$[$0 - 4].position += 1;
break;
case 1729:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
$$[$0 - 2].position += 1;
break;
case 1730:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
$$[$0 - 4].position += 1;
break;
case 1731:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 3]);
break;
case 1732:
case 1733:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { cursorAtStart: true, position: 1 };
break;
case 1734:
case 1735:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { position: 2 };
break;
case 1739:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['COLREF'], columnReference: $$[$0].chain };
break;
case 1740:
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 1741:
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 1743:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['NULL'] };
break;
case 1744:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['TIMESTAMP'] };
break;
case 1746:
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 1747:
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 1748:
case 1940:
case 1941:
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 1751:
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 1755:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DAYS', 'HOURS', 'MICROSECONDS', 'MILLISECONDS', 'MINUTES', 'MONTHS', 'NANOSECONDS', 'SECONDS', 'WEEKS', 'YEARS']);
break;
case 1760:
2019-12-31 18:47:24 +08:00
parser.suggestValues($$[$0]);
break;
case 1761:
2019-12-31 18:47:24 +08:00
this.$ = { types: ['NUMBER'] };
break;
case 1767:
case 1769:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 1] + $$[$0];
break;
case 1768:
2019-12-31 18:47:24 +08:00
this.$ = $$[$0 - 2] + $$[$0 - 1] + $$[$0];
break;
case 1773:
case 1774:
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 1776:
2019-12-31 18:47:24 +08:00
this.$ = { partialQuote: '\'', missingEndQuote: parser.yy.missingEndQuote };
break;
case 1777:
2019-12-31 18:47:24 +08:00
this.$ = { partialQuote: '"', missingEndQuote: parser.yy.missingEndQuote };
break;
case 1782:
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 1783:
2019-12-31 18:47:24 +08:00
parser.addAsteriskLocation(_$[$0], [{ asterisk: true }]);
this.$ = { asterisk: true };
break;
case 1784:
2019-12-31 18:47:24 +08:00
if ($$[$0]) {
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
}
break;
case 1785:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions();
parser.suggestColumns();
parser.addColumnAliasLocation(_$[$0], $$[$0], _$[$0 - 2]);
this.$ = { suggestAggregateFunctions: true };
break;
case 1787:
2019-12-31 18:47:24 +08:00
this.$ = [$$[$0]];
break;
case 1788:
2019-12-31 18:47:24 +08:00
$$[$0 - 2].push($$[$0]);
break;
case 1790:
case 1791:
2019-12-31 18:47:24 +08:00
this.$ = { cursorAtStart: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 1793:
2019-12-31 18:47:24 +08:00
parser.checkForSelectListKeywords($$[$0 - 2]);
break;
case 1794:
2019-12-31 18:47:24 +08:00
parser.checkForSelectListKeywords($$[$0 - 3]);
break;
case 1795:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestTables: true, suggestDatabases: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
break;
case 1797:
case 1798:
case 1800:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true, };
break;
case 1811:
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 1818:
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 1819:
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 1820:
2019-12-31 18:47:24 +08:00
this.$ = { joinType: $$[$0 - 1] };
break;
case 1821:
2019-12-31 18:47:24 +08:00
this.$ = { joinType: $$[$0 - 2] };
break;
case 1825:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 3].suggestKeywords) {
parser.suggestKeywords($$[$0 - 3].suggestKeywords);
}
break;
case 1829:
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 1834:
2019-12-31 18:47:24 +08:00
this.$ = 'JOIN';
break;
case 1835:
2019-12-31 18:47:24 +08:00
this.$ = 'ANTI JOIN';
break;
case 1836:
2019-12-31 18:47:24 +08:00
this.$ = 'CROSS JOIN';
break;
case 1837:
2019-12-31 18:47:24 +08:00
this.$ = 'INNER JOIN';
break;
case 1838:
2019-12-31 18:47:24 +08:00
this.$ = 'OUTER JOIN';
break;
case 1839:
2019-12-31 18:47:24 +08:00
this.$ = 'SEMI JOIN';
break;
case 1840:
2019-12-31 18:47:24 +08:00
this.$ = 'FULL JOIN';
break;
case 1841:
2019-12-31 18:47:24 +08:00
this.$ = 'FULL OUTER JOIN';
break;
case 1842:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT JOIN';
break;
case 1843:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT ANTI JOIN';
break;
case 1844:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT INNER JOIN';
break;
case 1845:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT OUTER JOIN';
break;
case 1846:
2019-12-31 18:47:24 +08:00
this.$ = 'LEFT SEMI JOIN';
break;
case 1847:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT JOIN';
break;
case 1848:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT ANTI JOIN';
break;
case 1849:
case 1850:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT OUTER JOIN';
break;
case 1851:
2019-12-31 18:47:24 +08:00
this.$ = 'RIGHT SEMI JOIN';
break;
case 1852:
case 1853:
case 1854:
case 1855:
2019-12-31 18:47:24 +08:00
case 1856:
case 1857:
case 1859:
case 1860:
2019-12-31 18:47:24 +08:00
case 1861:
case 1862:
case 1864:
case 1865:
case 1866:
case 1867:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['JOIN'] };
break;
case 1858:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['OUTER'] };
break;
case 1863:
case 1868:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['ANTI', 'INNER', 'OUTER', 'SEMI'] };
break;
case 1869:
2019-12-31 18:47:24 +08:00
this.$ = { noJoinCondition: true, suggestKeywords: ['ON', 'USING'] };
break;
case 1870:
2019-12-31 18:47:24 +08:00
this.$ = { valueExpression: $$[$0] };
break;
case 1875:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestJoinConditions({ prependOn: false });
break;
case 1876:
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 1877:
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 1878:
2019-12-31 18:47:24 +08:00
if ($$[$0 - 1]) {
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
}
break;
case 1879:
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 1880:
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 1887:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['REPEATABLE()'] };
break;
case 1889:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SYSTEM()']);
break;
case 1894:
2019-12-31 18:47:24 +08:00
parser.pushQueryState();
break;
case 1895:
2019-12-31 18:47:24 +08:00
parser.popQueryState();
break;
case 1897:
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 1900:
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 1917:
case 1918:
case 1919:
case 1920:
2019-12-31 18:47:24 +08:00
this.$ = { alias: $$[$0], location: _$[$0] };
break;
case 1926:
2019-12-31 18:47:24 +08:00
if (!$$[$0]) {
$$[$0 - 1].suggestKeywords = ['OVER'];
}
break;
case 1934:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['OVER']);
break;
case 1938:
case 1939:
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 1950:
2019-12-31 18:47:24 +08:00
this.$ = { expression: $$[$0 - 1] };
break;
case 1951:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { position: 1 };
break;
case 1952:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1]);
break;
case 1960:
case 2038:
case 2079:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 2]) };
break;
case 1961:
2019-12-31 18:47:24 +08:00
this.$ = { function: $$[$0 - 3], expression: $$[$0 - 2], types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 1962:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyArgumentTypesToSuggestions($$[$0 - 3], 1);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 1963:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 1964:
2019-12-31 18:47:24 +08:00
parser.applyArgumentTypesToSuggestions($$[$0 - 3], $$[$0 - 1].position);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 1972:
case 1973:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestFunctions) {
parser.suggestAggregateFunctions();
}
break;
case 1974:
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 1975:
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 1984:
2019-12-31 18:47:24 +08:00
// Only allowed in last order by
delete parser.yy.result.suggestAnalyticFunctions;
break;
case 1985:
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 1991:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['BETWEEN']);
break;
case 1992:
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 1997:
2019-12-31 18:47:24 +08:00
lexer.popState();
break;
case 1998:
2019-12-31 18:47:24 +08:00
lexer.begin('hdfs');
break;
case 2000:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 3] });
break;
case 2001:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 2] });
break;
case 2002:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: $$[$0 - 1] });
break;
case 2003:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: '' });
break;
case 2004:
2019-12-31 18:47:24 +08:00
parser.suggestHdfs({ path: '' });
break;
case 2010:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['PRECEDING']);
break;
case 2011:
case 2016:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ROW']);
break;
case 2015:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED FOLLOWING']);
break;
case 2017:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FOLLOWING']);
break;
case 2023:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2024:
2019-12-31 18:47:24 +08:00
parser.suggestAggregateFunctions();
parser.suggestSelectListAliases(true);
break;
case 2025:
case 2030:
2019-12-31 18:47:24 +08:00
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2027:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2028:
case 2029:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'] };
break;
case 2033:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'AS', weight: 2 }]);
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
break;
case 2034:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'AS', weight: 2 }]);
this.$ = { types: ['T'] };
break;
case 2035:
case 2036:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(parser.getTypeKeywords());
this.$ = { types: ['T'] };
break;
case 2037:
case 2043:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2039:
case 2044:
case 2078:
2019-12-31 18:47:24 +08:00
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2040:
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 2041:
case 2046:
case 2081:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2]);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2042:
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 2045:
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 2047:
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 2064:
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 2065:
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 2066:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2067:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2068:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2069:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
break;
case 2070:
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 2071:
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 2072:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
break;
case 2073:
2019-12-31 18:47:24 +08:00
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
break;
case 2074:
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 2075:
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 2080:
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 2082:
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 2108:
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 2109:
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 2110:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE FUNCTIONS', 'ANALYTIC FUNCTIONS', 'DATABASES', 'FUNCTIONS', 'SCHEMAS', 'TABLES']);
break;
case 2124:
case 2141:
case 2173:
case 2175:
case 2184:
2019-12-31 18:47:24 +08:00
parser.suggestTables();
parser.suggestDatabases({
appendDot: true
});
break;
case 2128:
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 2129:
2019-12-31 18:47:24 +08:00
if (parser.yy.result.suggestTables && $$[$0 - 1].isView) {
parser.yy.result.suggestTables.onlyViews = true;
}
break;
case 2130:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0]);
parser.suggestKeywords(['TABLE', 'VIEW']);
break;
case 2132:
2019-12-31 18:47:24 +08:00
this.$ = { isView: true };
break;
case 2134:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ROLES']);
break;
case 2135:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['CURRENT']);
break;
case 2138:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['LIKE']);
break;
case 2145:
2019-12-31 18:47:24 +08:00
parser.addTablePrimary($$[$0 - 1]);
parser.suggestKeywords(['IN']);
break;
case 2148:
case 2151:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['FUNCTIONS']);
break;
case 2149:
case 2152:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['AGGREGATE', 'ANALYTICAL']);
break;
case 2150:
case 2189:
2019-12-31 18:47:24 +08:00
if (!$$[$0 - 1]) {
parser.suggestKeywords(['IN', 'LIKE']);
}
else {
parser.suggestKeywords(['LIKE']);
}
break;
case 2153:
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 2161:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
break;
case 2162:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
break;
case 2164:
2019-12-31 18:47:24 +08:00
parser.suggestDatabases({
appendDot: true
});
parser.suggestTables();
break;
case 2178:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['GRANT']);
break;
case 2195:
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 2196:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['SET']);
break;
case 2212:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['=']);
break;
case 2221:
2019-12-31 18:47:24 +08:00
if (!parser.yy.cursorFound) {
parser.yy.result.useDatabase = $$[$0];
}
break;
case 2224:
2019-12-31 18:47:24 +08:00
this.$ = { inValueEdit: true };
break;
case 2225:
2019-12-31 18:47:24 +08:00
this.$ = { inValueEdit: true, cursorAtStart: true };
break;
case 2226:
case 2227:
case 2228:
case 2229:
case 2230:
2019-12-31 18:47:24 +08:00
this.$ = { suggestKeywords: ['NOT'] };
break;
case 2236:
case 2237:
case 2238:
case 2239:
case 2240:
2019-12-31 18:47:24 +08:00
parser.suggestFunctions({ types: ['STRING'] });
parser.suggestColumns({ types: ['STRING'] });
this.$ = { types: ['BOOLEAN'] };
break;
case 2241:
case 2243:
2019-12-31 18:47:24 +08:00
this.$ = parser.findCaseType($$[$0 - 1]);
break;
case 2242:
case 2245:
2019-12-31 18:47:24 +08:00
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2244:
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 2246:
2019-12-31 18:47:24 +08:00
this.$ = parser.findCaseType($$[$0 - 2]);
break;
case 2247:
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 2248:
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 2249:
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 2250:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = parser.findCaseType($$[$0 - 3]);
break;
case 2251:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { types: ['T'], typeSet: true };
break;
case 2252:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = $$[$0 - 1];
break;
case 2253:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { types: ['T'] };
break;
case 2256:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], lastType: $$[$0] };
break;
case 2257:
2019-12-31 18:47:24 +08:00
$$[$0 - 1].caseTypes.push($$[$0]);
this.$ = { caseTypes: $$[$0 - 1].caseTypes, lastType: $$[$0] };
break;
case 2261:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
break;
case 2264:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0].suggestFilters };
break;
case 2265:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0 - 1].suggestFilters };
break;
case 2266:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0 - 2].suggestFilters };
break;
case 2267:
case 2268:
2019-12-31 18:47:24 +08:00
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0].suggestFilters };
break;
case 2269:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2270:
2019-12-31 18:47:24 +08:00
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [$$[$0]] };
break;
case 2271:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2272:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['WHEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2273:
case 2275:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2274:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
parser.suggestKeywords(['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
break;
case 2276:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [$$[$0]], suggestFilters: true };
break;
case 2277:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 1], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2278:
2019-12-31 18:47:24 +08:00
parser.suggestValueExpressionKeywords($$[$0 - 2], ['THEN']);
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
case 2279:
case 2280:
case 2281:
case 2282:
2019-12-31 18:47:24 +08:00
parser.valueExpressionSuggest();
this.$ = { caseTypes: [{ types: ['T'] }] };
break;
}
},
table: [o($V0, $V1, { 456: 1, 457: 2 }), { 1: [3] }, o($V2, $V3, { 458: 3, 462: 4, 3: 5, 363: 6, 137: 7, 465: 8, 4: 9, 5: 10, 6: 11, 7: 12, 8: 13, 9: 14, 10: 15, 11: 16, 12: 17, 13: 18, 14: 19, 15: 20, 364: 21, 365: 22, 366: 23, 367: 24, 430: 25, 371: 26, 30: 28, 31: 29, 32: 30, 33: 31, 161: 35, 162: 36, 163: 37, 164: 38, 165: 39, 376: 40, 377: 41, 378: 42, 379: 43, 380: 44, 381: 45, 382: 46, 989: 51, 990: 52, 991: 53, 992: 54, 993: 55, 994: 56, 995: 57, 996: 58, 997: 59, 998: 60, 999: 61, 1000: 62, 373: 65, 43: 71, 135: 72, 312: 75, 313: 76, 426: 80, 428: 81, 437: 82, 438: 83, 26: $V4, 38: $V5, 63: $V6, 86: $V7, 147: $V8, 153: $V9, 155: $Va, 170: $Vb, 307: $Vc, 392: $Vd, 393: $Ve, 402: $Vf, 414: $Vg, 415: $Vh, 418: $Vi, 441: $Vj, 452: $Vk, 471: $Vl, 815: $Vm, 1001: $Vn, 1016: $Vo, 1030: $Vp }), { 459: [1, 86], 463: [1, 87] }, o($V2, [2, 827]), o($V2, [2, 833]), o($V2, [2, 834]), o($V2, [2, 835]), { 3: 88, 4: 9, 5: 10, 6: 11, 7: 12, 8: 13, 9: 14, 10: 15, 11: 16, 12: 17, 13: 18, 14: 19, 15: 20, 26: $V4, 30: 28, 31: 29, 32: 30, 33: 31, 38: $V5, 43: 71, 63: $V6, 86: $V7, 135: 72, 137: 90, 147: $V8, 153: $V9, 155: $Va, 161: 35, 162: 36, 163: 37, 164: 38, 165: 39, 170: $Vb, 307: $Vc, 312: 75, 313: 76, 363: 89, 364: 21, 365: 22, 366: 23, 367: 24, 371: 26, 373: 65, 376: 40, 377: 41, 378: 42, 379: 43, 380: 44, 381: 45, 382: 46, 392: $Vd, 393: $Ve, 402: $Vf, 414: $Vg, 415: $Vh, 418: $Vi, 426: 80, 428: 81, 430: 25, 437: 82, 438: 83, 441: $Vj, 452: $Vk, 815: $Vm, 989: 51, 990: 52, 991: 53, 992: 54, 993: 55, 994: 56, 995: 57, 996: 58, 997: 59, 998: 60, 999: 61, 1000: 62, 1001: $Vn, 1016: $Vo, 1030: $Vp }, o($V2, [2, 1]), o($V2, [2, 2]), o($V2, [2, 3]), o($V2, [2, 4]), o($V2, [2, 5]), o($V2, [2, 6]), o($V2, [2, 7]), o($V2, [2, 8]), o($V2, [2, 9]), o($V2, [2, 10]), o($V2, [2, 11]), o($V2, [2, 12]), o($V2, [2, 616]), o($V2, [2, 617]), o($V2, [2, 618]), o($V2, [2, 619]), o($Vq, $Vr, { 431: 91, 817: 92, 819: 93, 747: $Vs }), { 89: $Vt, 373: 97, 414: $Vg, 415: $Vh, 426: 80, 428: 81, 430: 95, 437: 82, 438: 83, 441: $Vj }, o([26, 38, 63, 86, 147, 153, 155, 170, 307, 392, 393, 402, 414, 415, 418, 441, 452, 815, 1001, 1016, 1030], [2, 862]), o($V2, [2, 25]), o($V2, [2, 26]), o($V2, [2, 27]), o($V2, [2, 28]), { 40: 101, 41: $Vu, 64: $Vv, 130: 98, 149: [1, 99], 151: [1, 100], 172: 102, 242: $Vw, 254: $Vx, 411: $Vy, 412: $Vz, 417: $VA, 468: 106, 469: $VB, 470: $VC, 494: $VD }, { 154: [1, 114] }, { 66: [1, 115], 158: [1, 116] }, o($V2, [2, 231]), o($V2, [2, 232]), o($V2, [2, 233]), o($V2, [2, 234]), o($V2, [2, 235]), o($V2, [2, 626]), o($V2, [2, 627]), o($V2, [2, 628]), o($V2, [2, 629]), o($V2, [2, 630]), o($V2, [2, 631]), o($V2, [2, 632]), { 38: $VE, 63: $VF, 147: $VG, 170: $VH, 360: [1, 117], 404: 118, 413: $VI, 414: $VJ, 415: $VK }, { 38: $VE, 63: $VF, 147: $VG, 170: $VH, 360: [1, 126], 404: 127, 413: $VI, 414: $VJ, 415: $VK }, o($VL, $VM, { 780: 128, 143: [1, 129], 567: $VN, 579: $VO }), { 41: $Vu, 64: $Vv, 172: 134, 242: $Vw, 254: $Vx, 411: $Vy, 412: $Vz, 413: [1, 133], 417: $VA, 468: 106, 469: $VB, 470: $VC, 988: 132 }, o($V2, [2, 2096]), o($V2, [2, 2097]), o($V2, [2, 2098]), o($V2, [2, 2099]), o($V2, [2, 2100]), o($V2, [2, 2101]), o($V2, [2, 2102]), o($V2, [2, 2103]), o($V2, [2, 2104]), o($V2, [2, 2105]), o($V2, [2, 2106]), o($V2, [2, 2107]), { 41: $Vu, 64: $Vv, 172: 135, 242: $Vw, 254: $Vx, 411: $Vy, 412: $Vz, 417: $VA, 468: 106, 469: $VB, 470: $VC }, { 40: 101, 41: $Vu, 64: $Vv, 89: $VP, 130: 143, 172: 102, 242: $Vw, 254: $Vx, 394: 136, 395: [2, 705], 396: 137, 411: $Vy, 412: $Vz, 417: $VA, 468: 106, 469: $VB, 470: $VC, 494: $VD, 874: 144, 906: 138, 908: 139, 909: 140, 920: 141, 921: 142 }, o($V2, [2, 759]), { 453: [1, 146] }, { 40: 151, 41: $Vu, 58: 150, 64: $Vv, 172: 102, 242: $Vw, 254: $Vx, 411: $Vy, 412: $Vz, 417: $VA, 468: 106, 469: $VB, 470: $VC, 494: $VD, 804: 149, 1017: 147, 1023: 148 }, o([41, 64, 73, 89, 138, 146, 179, 180, 224, 236, 241, 242, 254, 362, 392, 411, 412, 417, 469, 470, 473, 474, 475, 479, 483, 493, 494, 508, 509, 524, 566, 569, 570, 586, 592, 604, 631, 634, 641, 719, 720, 721, 722, 728, 745, 750, 751, 754
defaultActions: { 86: [2, 822], 119: [2, 733], 120: [2, 734], 121: [2, 735], 122: [2, 736], 123: [2, 737], 124: [2, 738], 137: [2, 706], 148: [2, 2200], 149: [2, 2202], 176: [2, 165], 187: [2, 1279], 211: [2, 1260], 212: [2, 1277], 213: [2, 1249], 214: [2, 1250], 217: [2, 798], 218: [2, 799], 241: [2, 739], 276: [2, 1400], 303: [2, 164], 424: [2, 1900], 425: [2, 1902], 426: [2, 1904], 427: [2, 1906], 428: [2, 1908], 429: [2, 1910], 430: [2, 1912], 431: [2, 1914], 437: [2, 2214], 461: [2, 1942], 462: [2, 1943], 463: [2, 1944], 464: [2, 1945], 465: [2, 1946], 466: [2, 1947], 467: [2, 1948], 489: [2, 2048], 490: [2, 2049], 491: [2, 2050], 492: [2, 2051], 493: [2, 2052], 494: [2, 2053], 495: [2, 2054], 496: [2, 2055], 497: [2, 2056], 498: [2, 2057], 499: [2, 2058], 500: [2, 2059], 501: [2, 2060], 502: [2, 2061], 626: [2, 821], 837: [2, 1960], 963: [2, 1961], 1029: [2, 576], 1032: [2, 575], 1080: [2, 377], 1111: [2, 1983], 1112: [2, 1988], 1196: [2, 390], 1206: [2, 580], 1210: [2, 1989], 1214: [2, 1990], 1230: [2, 582], 1249: [2, 2013], 1250: [2, 2014] },
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.initSyntaxParser(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 772;
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 413;
2019-12-31 18:47:24 +08:00
break;
case 8:
return 478;
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 479;
2019-12-31 18:47:24 +08:00
break;
case 11:
return 480;
2019-12-31 18:47:24 +08:00
break;
case 12:
return 481;
2019-12-31 18:47:24 +08:00
break;
case 13:
return 482;
2019-12-31 18:47:24 +08:00
break;
case 14:
return 484;
2019-12-31 18:47:24 +08:00
break;
case 15:
return 486;
2019-12-31 18:47:24 +08:00
break;
case 16:
return 487;
2019-12-31 18:47:24 +08:00
break;
case 17:
return 136;
break;
case 18:
return 488;
2019-12-31 18:47:24 +08:00
break;
case 19:
return 489;
2019-12-31 18:47:24 +08:00
break;
case 20:
return 490;
2019-12-31 18:47:24 +08:00
break;
case 21:
return 491;
2019-12-31 18:47:24 +08:00
break;
case 22:
return 492;
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 495;
2019-12-31 18:47:24 +08:00
break;
case 26:
return 496;
2019-12-31 18:47:24 +08:00
break;
case 27:
return 497;
2019-12-31 18:47:24 +08:00
break;
case 28:
return 498;
2019-12-31 18:47:24 +08:00
break;
case 29:
return 499;
2019-12-31 18:47:24 +08:00
break;
case 30:
return 85;
break;
case 31:
return 500;
2019-12-31 18:47:24 +08:00
break;
case 32:
return 501;
2019-12-31 18:47:24 +08:00
break;
case 33:
return 257;
break;
case 34:
return 503;
2019-12-31 18:47:24 +08:00
break;
case 35:
return 504;
2019-12-31 18:47:24 +08:00
break;
case 36:
return 505;
2019-12-31 18:47:24 +08:00
break;
case 37:
return 506;
2019-12-31 18:47:24 +08:00
break;
case 38:
return 507;
2019-12-31 18:47:24 +08:00
break;
case 39:
return 508;
2019-12-31 18:47:24 +08:00
break;
case 40:
return 111;
break;
case 41:
return 510;
2019-12-31 18:47:24 +08:00
break;
case 42:
return 511;
2019-12-31 18:47:24 +08:00
break;
case 43:
return 512;
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 513;
2019-12-31 18:47:24 +08:00
break;
case 46:
return 514;
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 515;
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 516;
2019-12-31 18:47:24 +08:00
break;
case 54:
return 517;
2019-12-31 18:47:24 +08:00
break;
case 55:
return 518;
2019-12-31 18:47:24 +08:00
break;
case 56:
return 519;
2019-12-31 18:47:24 +08:00
break;
case 57:
return 520;
2019-12-31 18:47:24 +08:00
break;
case 58:
return 521;
2019-12-31 18:47:24 +08:00
break;
case 59:
return 522;
2019-12-31 18:47:24 +08:00
break;
case 60:
return 523;
2019-12-31 18:47:24 +08:00
break;
case 61:
return 525;
2019-12-31 18:47:24 +08:00
break;
case 62:
return 526;
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 527;
2019-12-31 18:47:24 +08:00
break;
case 65:
return 528;
2019-12-31 18:47:24 +08:00
break;
case 66:
return 529;
2019-12-31 18:47:24 +08:00
break;
case 67:
return 530;
2019-12-31 18:47:24 +08:00
break;
case 68:
return 531;
2019-12-31 18:47:24 +08:00
break;
case 69:
return 532;
2019-12-31 18:47:24 +08:00
break;
case 70:
return 533;
2019-12-31 18:47:24 +08:00
break;
case 71:
return 534;
2019-12-31 18:47:24 +08:00
break;
case 72:
return 535;
2019-12-31 18:47:24 +08:00
break;
case 73:
return 536;
2019-12-31 18:47:24 +08:00
break;
case 74:
return 537;
2019-12-31 18:47:24 +08:00
break;
case 75:
return 538;
2019-12-31 18:47:24 +08:00
break;
case 76:
return 453;
2019-12-31 18:47:24 +08:00
break;
case 77:
return 143;
break;
case 78:
return 539;
2019-12-31 18:47:24 +08:00
break;
case 79:
return 540;
2019-12-31 18:47:24 +08:00
break;
case 80:
return 541;
2019-12-31 18:47:24 +08:00
break;
case 81:
return 542;
2019-12-31 18:47:24 +08:00
break;
case 82:
return 543;
2019-12-31 18:47:24 +08:00
break;
case 83:
return 544;
2019-12-31 18:47:24 +08:00
break;
case 84:
return 545;
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 546;
2019-12-31 18:47:24 +08:00
break;
case 88:
return 547;
2019-12-31 18:47:24 +08:00
break;
case 89:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('DESCRIBE', yy_.yylloc);
return 815;
2019-12-31 18:47:24 +08:00
break;
case 90:
return 548;
2019-12-31 18:47:24 +08:00
break;
case 91:
return 549;
2019-12-31 18:47:24 +08:00
break;
case 92:
return 550;
2019-12-31 18:47:24 +08:00
break;
case 93:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 94:
return 551;
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 552;
2019-12-31 18:47:24 +08:00
break;
case 97:
return 553;
2019-12-31 18:47:24 +08:00
break;
case 98:
return 554;
2019-12-31 18:47:24 +08:00
break;
case 99:
return 555;
2019-12-31 18:47:24 +08:00
break;
case 100:
return 556;
2019-12-31 18:47:24 +08:00
break;
case 101:
return 88;
break;
case 102:
return 557;
2019-12-31 18:47:24 +08:00
break;
case 103:
return 558;
2019-12-31 18:47:24 +08:00
break;
case 104:
return 559;
2019-12-31 18:47:24 +08:00
break;
case 105:
return 560;
2019-12-31 18:47:24 +08:00
break;
case 106:
return 561;
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 562;
2019-12-31 18:47:24 +08:00
break;
case 109:
return 563;
2019-12-31 18:47:24 +08:00
break;
case 110:
return 564;
2019-12-31 18:47:24 +08:00
break;
case 111:
return 565;
2019-12-31 18:47:24 +08:00
break;
case 112:
parser.yy.correlatedSubQuery = true;
return 566;
2019-12-31 18:47:24 +08:00
break;
case 113:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('EXPLAIN', yy_.yylloc);
return 471;
2019-12-31 18:47:24 +08:00
break;
case 114:
return 567;
2019-12-31 18:47:24 +08:00
break;
case 115:
return 568;
2019-12-31 18:47:24 +08:00
break;
case 116:
return 570;
2019-12-31 18:47:24 +08:00
break;
case 117:
return 571;
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 572;
2019-12-31 18:47:24 +08:00
break;
case 121:
return 573;
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 574;
break;
case 124:
2019-12-31 18:47:24 +08:00
return 575;
break;
case 125:
2019-12-31 18:47:24 +08:00
return 576;
break;
case 126:
2019-12-31 18:47:24 +08:00
return 577;
break;
case 127:
return 578;
break;
2019-12-31 18:47:24 +08:00
case 128:
return 107;
break;
case 129:
return 579;
2019-12-31 18:47:24 +08:00
break;
case 130:
return 580;
2019-12-31 18:47:24 +08:00
break;
case 131:
return 581;
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 582;
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 583;
2019-12-31 18:47:24 +08:00
break;
case 137:
return 584;
2019-12-31 18:47:24 +08:00
break;
case 138:
return 585;
2019-12-31 18:47:24 +08:00
break;
case 139:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('GRANT', yy_.yylloc);
return 402;
2019-12-31 18:47:24 +08:00
break;
case 140:
return 403;
2019-12-31 18:47:24 +08:00
break;
case 141:
return 587;
2019-12-31 18:47:24 +08:00
break;
case 142:
return 588;
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 589;
2019-12-31 18:47:24 +08:00
break;
case 145:
return 591;
2019-12-31 18:47:24 +08:00
break;
case 146:
return 592;
2019-12-31 18:47:24 +08:00
break;
case 147:
return 593;
2019-12-31 18:47:24 +08:00
break;
case 148:
return 594;
2019-12-31 18:47:24 +08:00
break;
case 149:
return 595;
2019-12-31 18:47:24 +08:00
break;
case 150:
return 158;
break;
case 151:
return 596;
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 597;
2019-12-31 18:47:24 +08:00
break;
case 154:
return 598;
2019-12-31 18:47:24 +08:00
break;
case 155:
return 599;
2019-12-31 18:47:24 +08:00
break;
case 156:
this.begin('hdfs');
return 454;
2019-12-31 18:47:24 +08:00
break;
case 157:
return 600;
2019-12-31 18:47:24 +08:00
break;
case 158:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('INSERT', yy_.yylloc);
return 414;
2019-12-31 18:47:24 +08:00
break;
case 159:
return 601;
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 602;
2019-12-31 18:47:24 +08:00
break;
case 162:
return 603;
2019-12-31 18:47:24 +08:00
break;
case 163:
return 604;
2019-12-31 18:47:24 +08:00
break;
case 164:
return 442;
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 605;
2019-12-31 18:47:24 +08:00
break;
case 167:
return 144;
break;
case 168:
return 606;
2019-12-31 18:47:24 +08:00
break;
case 169:
return 607;
2019-12-31 18:47:24 +08:00
break;
case 170:
return 608;
2019-12-31 18:47:24 +08:00
break;
case 171:
return 609;
2019-12-31 18:47:24 +08:00
break;
case 172:
return 610;
2019-12-31 18:47:24 +08:00
break;
case 173:
return 611;
2019-12-31 18:47:24 +08:00
break;
case 174:
return 612;
2019-12-31 18:47:24 +08:00
break;
case 175:
return 613;
2019-12-31 18:47:24 +08:00
break;
case 176:
return 614;
2019-12-31 18:47:24 +08:00
break;
case 177:
return 615;
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 616;
2019-12-31 18:47:24 +08:00
break;
case 181:
return 617;
2019-12-31 18:47:24 +08:00
break;
case 182:
return 618;
2019-12-31 18:47:24 +08:00
break;
case 183:
return 619;
2019-12-31 18:47:24 +08:00
break;
case 184:
return 620;
2019-12-31 18:47:24 +08:00
break;
case 185:
return 208;
break;
case 186:
return 621;
2019-12-31 18:47:24 +08:00
break;
case 187:
return 622;
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 623;
2019-12-31 18:47:24 +08:00
break;
case 191:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('LOAD', yy_.yylloc, yy.lexer.upcomingInput());
return 452;
2019-12-31 18:47:24 +08:00
break;
case 192:
return 624;
2019-12-31 18:47:24 +08:00
break;
case 193:
return 625;
2019-12-31 18:47:24 +08:00
break;
case 194:
this.begin('hdfs');
return 626;
2019-12-31 18:47:24 +08:00
break;
case 195:
return 627;
2019-12-31 18:47:24 +08:00
break;
case 196:
return 628;
2019-12-31 18:47:24 +08:00
break;
case 197:
return 629;
2019-12-31 18:47:24 +08:00
break;
case 198:
return 630;
2019-12-31 18:47:24 +08:00
break;
case 199:
return 632;
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 633;
2019-12-31 18:47:24 +08:00
break;
case 203:
return 635;
2019-12-31 18:47:24 +08:00
break;
case 204:
return 636;
2019-12-31 18:47:24 +08:00
break;
case 205:
return 637;
2019-12-31 18:47:24 +08:00
break;
case 206:
return 638;
2019-12-31 18:47:24 +08:00
break;
case 207:
return 639;
2019-12-31 18:47:24 +08:00
break;
case 208:
return 640;
2019-12-31 18:47:24 +08:00
break;
case 209:
return 642;
2019-12-31 18:47:24 +08:00
break;
case 210:
return 643;
2019-12-31 18:47:24 +08:00
break;
case 211:
return 644;
2019-12-31 18:47:24 +08:00
break;
case 212:
return 224;
break;
case 213:
return 645;
2019-12-31 18:47:24 +08:00
break;
case 214:
return 146;
break;
case 215:
return 646;
2019-12-31 18:47:24 +08:00
break;
case 216:
return 647;
2019-12-31 18:47:24 +08:00
break;
case 217:
return 648;
2019-12-31 18:47:24 +08:00
break;
case 218:
return 649;
2019-12-31 18:47:24 +08:00
break;
case 219:
return 650;
2019-12-31 18:47:24 +08:00
break;
case 220:
return 871;
2019-12-31 18:47:24 +08:00
break;
case 221:
return 651;
2019-12-31 18:47:24 +08:00
break;
case 222:
return 142;
break;
case 223:
return 652;
2019-12-31 18:47:24 +08:00
break;
case 224:
return 653;
2019-12-31 18:47:24 +08:00
break;
case 225:
return 417;
2019-12-31 18:47:24 +08:00
break;
case 226:
return 654;
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 655;
2019-12-31 18:47:24 +08:00
break;
case 229:
return 656;
2019-12-31 18:47:24 +08:00
break;
case 230:
return 657;
2019-12-31 18:47:24 +08:00
break;
case 231:
return 658;
2019-12-31 18:47:24 +08:00
break;
case 232:
return 659;
2019-12-31 18:47:24 +08:00
break;
case 233:
return 660;
2019-12-31 18:47:24 +08:00
break;
case 234:
return 445;
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 661;
2019-12-31 18:47:24 +08:00
break;
case 240:
return 662;
2019-12-31 18:47:24 +08:00
break;
case 241:
return 663;
2019-12-31 18:47:24 +08:00
break;
case 242:
return 664;
2019-12-31 18:47:24 +08:00
break;
case 243:
return 665;
2019-12-31 18:47:24 +08:00
break;
case 244:
return 666;
2019-12-31 18:47:24 +08:00
break;
case 245:
return 667;
2019-12-31 18:47:24 +08:00
break;
case 246:
return 668;
2019-12-31 18:47:24 +08:00
break;
case 247:
return 669;
2019-12-31 18:47:24 +08:00
break;
case 248:
return 670;
2019-12-31 18:47:24 +08:00
break;
case 249:
return 671;
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 672;
2019-12-31 18:47:24 +08:00
break;
case 253:
return 673;
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 674;
2019-12-31 18:47:24 +08:00
break;
case 258:
return 675;
2019-12-31 18:47:24 +08:00
break;
case 259:
return 70;
break;
case 260:
return 676;
2019-12-31 18:47:24 +08:00
break;
case 261:
return 677;
2019-12-31 18:47:24 +08:00
break;
case 262:
return 678;
2019-12-31 18:47:24 +08:00
break;
case 263:
return 679;
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 680;
2019-12-31 18:47:24 +08:00
break;
case 266:
return 681;
2019-12-31 18:47:24 +08:00
break;
case 267:
return 682;
2019-12-31 18:47:24 +08:00
break;
case 268:
return 683;
2019-12-31 18:47:24 +08:00
break;
case 269:
return 684;
2019-12-31 18:47:24 +08:00
break;
case 270:
return 685;
2019-12-31 18:47:24 +08:00
break;
case 271:
return 686;
2019-12-31 18:47:24 +08:00
break;
case 272:
return 687;
2019-12-31 18:47:24 +08:00
break;
case 273:
return 688;
2019-12-31 18:47:24 +08:00
break;
case 274:
return 689;
2019-12-31 18:47:24 +08:00
break;
case 275:
return 56;
break;
case 276:
return 690;
2019-12-31 18:47:24 +08:00
break;
case 277:
return 73;
break;
case 278:
return 691;
2019-12-31 18:47:24 +08:00
break;
case 279:
return 692;
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 418;
2019-12-31 18:47:24 +08:00
break;
case 282:
return 693;
2019-12-31 18:47:24 +08:00
break;
case 283:
return 694;
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 695;
2019-12-31 18:47:24 +08:00
break;
case 286:
return 696;
2019-12-31 18:47:24 +08:00
break;
case 287:
return 697;
2019-12-31 18:47:24 +08:00
break;
case 288:
return 106;
break;
case 289:
return 698;
2019-12-31 18:47:24 +08:00
break;
case 290:
return 699;
2019-12-31 18:47:24 +08:00
break;
case 291:
return 700;
2019-12-31 18:47:24 +08:00
break;
case 292:
return 701;
2019-12-31 18:47:24 +08:00
break;
case 293:
return 702;
2019-12-31 18:47:24 +08:00
break;
case 294:
return 703;
2019-12-31 18:47:24 +08:00
break;
case 295:
return 704;
2019-12-31 18:47:24 +08:00
break;
case 296:
return 705;
2019-12-31 18:47:24 +08:00
break;
case 297:
return 706;
2019-12-31 18:47:24 +08:00
break;
case 298:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('SELECT', yy_.yylloc);
return 415;
2019-12-31 18:47:24 +08:00
break;
case 299:
return 707;
2019-12-31 18:47:24 +08:00
break;
case 300:
return 708;
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 411;
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 1001;
2019-12-31 18:47:24 +08:00
break;
case 307:
return 709;
2019-12-31 18:47:24 +08:00
break;
case 308:
return 710;
2019-12-31 18:47:24 +08:00
break;
case 309:
return 711;
2019-12-31 18:47:24 +08:00
break;
case 310:
return 712;
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 713;
2019-12-31 18:47:24 +08:00
break;
case 313:
return 714;
2019-12-31 18:47:24 +08:00
break;
case 314:
return 715;
2019-12-31 18:47:24 +08:00
break;
case 315:
return 716;
2019-12-31 18:47:24 +08:00
break;
case 316:
return 717;
2019-12-31 18:47:24 +08:00
break;
case 317:
return 718;
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 722;
2019-12-31 18:47:24 +08:00
break;
case 321:
return 723;
2019-12-31 18:47:24 +08:00
break;
case 322:
return 724;
2019-12-31 18:47:24 +08:00
break;
case 323:
return 725;
2019-12-31 18:47:24 +08:00
break;
case 324:
return 726;
2019-12-31 18:47:24 +08:00
break;
case 325:
return 727;
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 729;
2019-12-31 18:47:24 +08:00
break;
case 328:
return 730;
2019-12-31 18:47:24 +08:00
break;
case 329:
return 731;
2019-12-31 18:47:24 +08:00
break;
case 330:
return 129;
break;
case 331:
return 732;
2019-12-31 18:47:24 +08:00
break;
case 332:
return 733;
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 734;
2019-12-31 18:47:24 +08:00
break;
case 337:
return 735;
2019-12-31 18:47:24 +08:00
break;
case 338:
return 736;
2019-12-31 18:47:24 +08:00
break;
case 339:
return 737;
2019-12-31 18:47:24 +08:00
break;
case 340:
return 738;
2019-12-31 18:47:24 +08:00
break;
case 341:
return 57;
break;
case 342:
return 739;
2019-12-31 18:47:24 +08:00
break;
case 343:
return 740;
2019-12-31 18:47:24 +08:00
break;
case 344:
return 741;
2019-12-31 18:47:24 +08:00
break;
case 345:
return 742;
2019-12-31 18:47:24 +08:00
break;
case 346:
return 743;
2019-12-31 18:47:24 +08:00
break;
case 347:
return 744;
2019-12-31 18:47:24 +08:00
break;
case 348:
return 745;
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 746;
2019-12-31 18:47:24 +08:00
break;
case 351:
return 977;
2019-12-31 18:47:24 +08:00
break;
case 352:
return 109;
break;
case 353:
return 747;
2019-12-31 18:47:24 +08:00
break;
case 354:
return 748;
2019-12-31 18:47:24 +08:00
break;
case 355:
return 873;
2019-12-31 18:47:24 +08:00
break;
case 356:
return 749;
2019-12-31 18:47:24 +08:00
break;
case 357:
parser.determineCase(yy_.yytext);
return 1016;
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 441;
2019-12-31 18:47:24 +08:00
break;
case 360:
return 412;
2019-12-31 18:47:24 +08:00
break;
case 361:
parser.determineCase(yy_.yytext);
parser.addStatementTypeLocation('USE', yy_.yylloc);
return 1030;
2019-12-31 18:47:24 +08:00
break;
case 362:
return 751;
2019-12-31 18:47:24 +08:00
break;
case 363:
return 752;
2019-12-31 18:47:24 +08:00
break;
case 364:
return 753;
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 756;
2019-12-31 18:47:24 +08:00
break;
case 367:
return 757;
2019-12-31 18:47:24 +08:00
break;
case 368:
return 761;
2019-12-31 18:47:24 +08:00
break;
case 369:
return 762;
2019-12-31 18:47:24 +08:00
break;
case 370:
return 141;
break;
case 371:
return 763;
2019-12-31 18:47:24 +08:00
break;
case 372:
return 764;
2019-12-31 18:47:24 +08:00
break;
case 373:
return 765;
2019-12-31 18:47:24 +08:00
break;
case 374:
return 766;
2019-12-31 18:47:24 +08:00
break;
case 375:
return 767;
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 768;
2019-12-31 18:47:24 +08:00
break;
case 378:
return 769;
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 658;
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 502;
2019-12-31 18:47:24 +08:00
break;
case 389:
return 447;
2019-12-31 18:47:24 +08:00
break;
case 390:
return 446;
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 483;
2019-12-31 18:47:24 +08:00
break;
case 392:
yy.lexer.unput('(');
yy_.yytext = 'avg';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 493;
2019-12-31 18:47:24 +08:00
break;
case 393:
yy.lexer.unput('(');
yy_.yytext = 'cast';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 509;
2019-12-31 18:47:24 +08:00
break;
case 394:
yy.lexer.unput('(');
yy_.yytext = 'count';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 524;
2019-12-31 18:47:24 +08:00
break;
case 395:
yy.lexer.unput('(');
yy_.yytext = 'extract';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 569;
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 586;
2019-12-31 18:47:24 +08:00
break;
case 397:
yy.lexer.unput('(');
yy_.yytext = 'left';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 957;
2019-12-31 18:47:24 +08:00
break;
case 398:
yy.lexer.unput('(');
yy_.yytext = 'max';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 631;
2019-12-31 18:47:24 +08:00
break;
case 399:
yy.lexer.unput('(');
yy_.yytext = 'min';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 634;
2019-12-31 18:47:24 +08:00
break;
case 400:
yy.lexer.unput('(');
yy_.yytext = 'ndv';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 641;
2019-12-31 18:47:24 +08:00
break;
case 401:
yy.lexer.unput('(');
yy_.yytext = 'stddev';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 719;
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 720;
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 721;
2019-12-31 18:47:24 +08:00
break;
case 404:
yy.lexer.unput('(');
yy_.yytext = 'sum';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 728;
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 754;
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 755;
2019-12-31 18:47:24 +08:00
break;
case 407:
yy.lexer.unput('(');
yy_.yytext = 'variance';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 758;
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 759;
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 760;
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 479;
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 479;
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 479;
2019-12-31 18:47:24 +08:00
break;
case 413:
yy.lexer.unput('(');
yy_.yytext = 'lag';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 479;
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 479;
2019-12-31 18:47:24 +08:00
break;
case 415:
yy.lexer.unput('(');
yy_.yytext = 'lead';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 479;
2019-12-31 18:47:24 +08:00
break;
case 416:
yy.lexer.unput('(');
yy_.yytext = 'ntile';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 479;
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 479;
2019-12-31 18:47:24 +08:00
break;
case 418:
yy.lexer.unput('(');
yy_.yytext = 'rank';
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
return 479;
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 479;
2019-12-31 18:47:24 +08:00
break;
case 420:
yy.lexer.unput('(');
yy_.yytext = 'system';
return 924;
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 750;
2019-12-31 18:47:24 +08:00
break;
case 424:
return 469;
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 772;
2019-12-31 18:47:24 +08:00
break;
case 427:
return 590;
2019-12-31 18:47:24 +08:00
break;
case 428:
parser.addFileLocation(yy_.yylloc, yy_.yytext);
return 982;
2019-12-31 18:47:24 +08:00
break;
case 429:
this.popState();
return 983;
2019-12-31 18:47:24 +08:00
break;
case 430:
return 459;
2019-12-31 18:47:24 +08:00
break;
case 431:
return 480;
2019-12-31 18:47:24 +08:00
break;
case 432:
return 654;
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 475;
2019-12-31 18:47:24 +08:00
break;
case 442:
return 474;
2019-12-31 18:47:24 +08:00
break;
case 443:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 444:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 445:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 446:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 447:
return 485;
2019-12-31 18:47:24 +08:00
break;
case 448:
return 485;
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 463;
2019-12-31 18:47:24 +08:00
break;
case 454:
return 770;
2019-12-31 18:47:24 +08:00
break;
case 455:
return 473;
2019-12-31 18:47:24 +08:00
break;
case 456:
return 89;
break;
case 457:
return 91;
break;
case 458:
return 476;
2019-12-31 18:47:24 +08:00
break;
case 459:
return 477;
2019-12-31 18:47:24 +08:00
break;
case 460:
return 470;
2019-12-31 18:47:24 +08:00
break;
case 461:
this.begin('backtickedValue');
return 494;
2019-12-31 18:47:24 +08:00
break;
case 462:
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '`')) {
return 775;
2019-12-31 18:47:24 +08:00
}
return 181;
break;
case 463:
this.popState();
return 494;
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 775;
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 775;
2019-12-31 18:47:24 +08:00
}
return 181;
break;
case 469:
this.popState();
return 180;
break;
case 470:
return 459;
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 = impalaSyntaxParser;