5365 lines
412 KiB
JavaScript
5365 lines
412 KiB
JavaScript
|
"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, 306, 391, 392, 401, 413, 414, 417, 440, 451, 458, 462, 470, 814, 1000, 1015, 1029], $V1 = [2, 822], $V2 = [458, 462], $V3 = [2, 823], $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, 360, 458, 462], $Vr = [2, 1468], $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, 410, 411, 416, 468, 469, 493], $VM = [2, 1277], $VN = [1, 130], $VO = [1, 131], $VP = [1, 145], $VQ = [2, 1503], $VR = [1, 153], $VS = [1, 154], $VT = [1, 161], $VU = [1, 162], $VV = [1, 174], $VW = [1, 176], $VX = [1, 173], $VY = [275, 414, 445, 446], $VZ = [91, 360, 458, 462, 746], $V_ = [2, 1296], $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, 268, 275, 287, 306, 360, 390, 394, 402, 410, 411, 414, 416, 445, 446, 458, 462, 468, 469, 480, 493, 502, 526, 581, 588, 597, 605, 619, 621, 625, 654, 656, 692, 706, 732, 746, 751, 764, 870], $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, 268, 275, 277, 287, 306, 360, 390, 394, 402, 410, 411, 414, 416, 445, 446, 458, 462, 468, 469, 473, 474, 475, 476, 479, 480, 484, 487, 493, 496, 497, 499, 502, 505, 509, 526, 542, 546, 550, 554, 556, 574, 581, 588, 593, 594, 597, 600, 604, 605, 619, 621, 625, 645, 653, 654, 656, 674, 679, 691, 692, 693, 697, 706, 710, 722, 732, 733, 734, 737, 746, 751, 756, 762, 764, 870], $V11 = [1, 234], $V21 = [1, 235], $V31 = [1, 243], $V41 = [2, 1323], $V51 = [54, 138], $V61 = [91, 95, 360, 394, 402, 458, 462, 588, 621, 654, 746, 764, 870], $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, 360, 394, 402, 458, 462, 480, 526, 581, 588, 597, 605, 619, 621, 654, 656, 692, 706, 732, 746, 751, 764, 870], $Vh1 = [2, 1913], $Vi1 = [1, 265], $Vj1 = [1, 268], $Vk1 = [1, 269], $Vl1 = [41, 64, 91, 95, 136, 142, 179, 180, 242, 254, 360, 394, 402, 410, 411, 416, 458, 462, 468, 469, 480, 493, 526, 581, 588, 597, 605, 619, 621, 654, 656, 692, 706, 732, 746, 751, 764, 870], $Vm1 = [306, 414], $Vn1 = [2, 1891], $Vo1 = [26, 41, 51, 64, 242, 254, 410, 411, 416, 458, 462, 468, 469, 493], $Vp1 = [41, 64, 73, 89, 138, 146, 179, 180, 224, 236, 241, 242, 254, 361, 391, 410, 411, 416, 468, 469, 472, 473, 474, 478, 482, 492, 493, 507, 508, 523, 565, 568, 569, 585, 591, 603, 630, 633, 640, 718, 719, 720, 727, 744, 749, 750, 753, 754, 757, 758, 759, 769, 956], $Vq1 = [41, 64, 73, 89, 91, 138, 146, 179, 180, 224, 236, 241, 242, 254, 361, 391, 410, 411, 414, 416, 468, 469, 472, 473, 474, 478, 482, 492, 493, 507, 508, 523, 565, 568, 569, 585, 591, 603, 630, 633, 640, 718, 719, 720, 721, 727, 744, 749, 750, 753, 754, 757, 758, 759, 769, 956], $Vr1 = [89, 95, 413, 414, 440], $Vs1 = [41, 64, 242, 254, 410, 411, 416, 458, 462, 468, 469, 493, 591], $Vt1 = [50, 51], $Vu1 = [2, 1289], $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, 1286], $VF1 = [1, 307], $VG1 = [1, 342], $VH1 = [1, 341], $VI1 = [1, 343], $VJ1 = [179, 208, 458, 462], $VK1 = [2, 1293], $VL1 = [1, 349], $VM1 = [1, 353], $VN1 = [2, 758], $VO1 = [1, 355], $VP1 = [41, 64, 129, 242, 254, 410, 411, 416, 468, 469, 493], $VQ1 = [1, 367], $VR1 = [1, 366], $VS1 = [1, 368], $VT1 = [1, 369], $VU
|
||
|
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", 264: "HASH", 268: "SORT", 275: "VALUES", 277: "COMPARISON_OPERATOR", 287: "STORED", 288: "AVRO", 289: "KUDU", 290: "ORC", 291: "PARQUET", 292: "RCFILE", 293: "SEQUENCEFILE", 294: "TEXTFILE", 295: "DELIMITED", 300: "FIELDS", 301: "TERMINATED", 303: "ESCAPED", 304: "LINES", 306: "WITH", 315: "FUNCTION", 321: "AGGREGATE", 341: "...", 342: "RETURNS", 343: "SYMBOL", 344: "INIT_FN", 347: "UPDATE_FN", 348: "MERGE_FN", 349: "PREPARE_FN", 350: "CLOSE_FN", 351: "SERIALIZE_FN", 352: "FINALIZE_FN", 353: "INTERMEDIATE", 359: "ROLE", 360: "LIFECYCLE", 361: "UNSIGNED_INTEGER", 390: "PURGE", 391: "TRUNCATE", 392: "DELETE", 394: "FROM", 401: "GRANT", 402: "GROUP", 410: "SERVER", 411: "URI", 412: "ALL", 413: "INSERT", 414: "SELECT", 416: "OPTION", 417: "REVOKE", 440: "UPSERT", 441: "INTO", 444: "OVERWRITE", 445: "SHUFFLE", 446: "NOSHUFFLE", 451: "LOAD", 452: "DATA", 453: "INPATH", 458: "EOF", 462: ";", 466: "SetSpecification_EDIT", 468: "REGULAR_IDENTIFIER", 469: "VARIABLE_REFERENCE", 470: "EXPLAIN", 472: "!", 473: "*", 474: "-", 475: "[", 476: "]", 477: "ALLOCATE", 478: "ANALYTIC", 479: "AND", 480: "ANTI", 481: "ANY", 482: "APPX_MEDIAN", 483: "ARE", 484: "ARITHMETIC_OPERATOR", 485: "ARRAY_AGG", 486: "ARRAY_MAX_CARDINALITY", 487: "ASC", 488: "ASENSITIVE", 489: "ASYMMETRIC", 490: "AT", 491: "ATOMIC", 492: "AVG", 493: "BACKTICK", 494: "BEGIN_FRAME", 495: "BEGIN_PARTITION", 496: "BETWEEN", 497: "BIGINT", 498: "BLOB", 499: "BOOLEAN", 500: "BOTH", 501: "BROADCAST", 502: "CACHED", 503: "CALLED", 504: "CARDINALITY", 505: "CASCADE", 506: "CASCADED", 507: "CASE", 508: "CAST", 509: "CHAR", 510: "CHARACTER", 511: "CLOB", 512: "COLLATE", 513: "COLLECT", 514: "COMMIT", 515: "CONDITION", 516: "CONNECT", 517: "CONSTRAINT", 518: "CONTAINS", 519: "CONVERT", 520: "COPY", 521: "CORR", 522: "CORRESPONDING", 523: "COUNT", 524: "COVAR_POP", 525: "COVAR_SAMP", 526: "CROSS", 527: "CUBE", 528: "CURRENT", 529: "CURRENT_DATE", 530: "CURRENT_DEFAULT_TRANSFORM_GROUP", 531: "CURRENT_PATH", 532: "CURRENT_ROLE", 533: "CURRENT_ROW", 534: "CURRENT_SCHEMA", 535: "CURRENT_TIME", 536: "CURRENT_TRANSFORM_GROUP_FOR_TYPE", 537: "CYCLE", 538: "DATABASES", 539: "DEALLOCATE", 540: "DEC", 541: "DECFLOAT", 542: "DECIMAL", 543: "DECLARE", 544: "DEFINE", 545: "DEREF", 546: "DESC", 547: "DETERMINISTIC", 548: "DISCONNECT", 549: "DISTINCT", 550: "DOUBLE", 551: "DYNAMIC", 552: "EACH", 553: "ELEMENT", 554: "ELSE", 555: "EMPTY", 556: "END", 557: "END_FRAME", 558: "END_PARTITION", 559: "EQUALS", 560: "ESCAPE", 561: "EVERY", 562: "EXCEPT", 563: "EXEC", 564: "EXECUTE", 565: "EXISTS", 566: "EXTENDED", 567: "EXTERNAL", 568: "EXTRACT", 569: "FALSE", 570: "FETCH", 571: "FILES", 572: "FILTER", 573: "FIRST", 574: "FLOAT", 575: "FOLLOWING", 576: "FOR", 577: "FOREIGN", 578: "FORMATTED", 579: "FRAME_ROW", 580: "FREE", 581: "FULL", 582: "FUSION", 583: "GET", 584: "GLOBAL", 585: "GROUP_CONCAT", 586: "GROUPING", 587: "GROUPS", 588: "HAVING", 589: "HDFS_START_QUOTE", 590: "HOLD", 591: "IF", 592: "IGNORE", 593: "ILIKE", 594: "IN", 595: "INDICATOR", 596: "INITIAL", 597: "INNER", 598: "INOUT", 599: "INSENSITIVE", 600: "INT", 601: "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], [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], [260, 1], [260, 3], [260, 5], [262, 4], [263, 3], [263, 2], [263, 4], [263, 4], [259, 3], [261, 2], [261, 2], [261, 3], [261, 3], [261, 3], [189, 0], [189, 1], [267, 3], [197, 2], [197, 3], [265, 3], [266, 3], [266, 3], [269, 1], [269, 3], [270, 1], [270, 3], [270, 5], [270, 3], [270, 5], [271
|
||
|
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 2124:
|
||
|
parser.suggestKeywords(['TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 34:
|
||
|
parser.addDatabaseLocation(_$[$0 - 4], [{ name: $$[$0 - 4] }]);
|
||
|
break;
|
||
|
case 35:
|
||
|
case 196:
|
||
|
case 208:
|
||
|
case 727:
|
||
|
case 1361:
|
||
|
case 2160:
|
||
|
case 2219:
|
||
|
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 422:
|
||
|
case 427:
|
||
|
case 428:
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
break;
|
||
|
case 70:
|
||
|
case 155:
|
||
|
parser.suggestKeywords(['VALUE']);
|
||
|
break;
|
||
|
case 71:
|
||
|
case 156:
|
||
|
case 436:
|
||
|
case 1388:
|
||
|
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 665:
|
||
|
case 2120:
|
||
|
case 2180:
|
||
|
parser.suggestKeywords(['STATS']);
|
||
|
break;
|
||
|
case 79:
|
||
|
case 122:
|
||
|
case 159:
|
||
|
case 461:
|
||
|
case 1328:
|
||
|
case 1332:
|
||
|
case 1336:
|
||
|
case 1371:
|
||
|
case 1372:
|
||
|
case 1417:
|
||
|
case 1420:
|
||
|
case 1548:
|
||
|
case 1593:
|
||
|
case 2210:
|
||
|
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 717:
|
||
|
parser.suggestKeywords(['TO']);
|
||
|
break;
|
||
|
case 93:
|
||
|
case 189:
|
||
|
case 1357:
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 94:
|
||
|
case 406:
|
||
|
parser.suggestKeywords(['PARTITIONS']);
|
||
|
break;
|
||
|
case 111:
|
||
|
parser.suggestIdentifiers(['\'avgSize\'', '\'maxSize\'', '\'numDVs\'', '\'numNulls\'']);
|
||
|
break;
|
||
|
case 125:
|
||
|
case 472:
|
||
|
parser.suggestFileFormats();
|
||
|
break;
|
||
|
case 128:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['WITH REPLICATION =']);
|
||
|
}
|
||
|
break;
|
||
|
case 130:
|
||
|
case 465:
|
||
|
parser.suggestKeywords(['FORMAT']);
|
||
|
break;
|
||
|
case 131:
|
||
|
case 466:
|
||
|
parser.suggestKeywords(['DELIMITED']);
|
||
|
break;
|
||
|
case 132:
|
||
|
case 1823:
|
||
|
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 659:
|
||
|
case 679:
|
||
|
case 683:
|
||
|
case 685:
|
||
|
case 724:
|
||
|
case 1448:
|
||
|
case 2119:
|
||
|
case 2123:
|
||
|
case 2168:
|
||
|
case 2179:
|
||
|
case 2199:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
break;
|
||
|
case 162:
|
||
|
case 674:
|
||
|
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 464:
|
||
|
case 1491:
|
||
|
case 1530:
|
||
|
case 1551:
|
||
|
case 1564:
|
||
|
case 1568:
|
||
|
case 1586:
|
||
|
case 1609:
|
||
|
case 1635:
|
||
|
case 1636:
|
||
|
case 1713:
|
||
|
case 1715:
|
||
|
case 1783:
|
||
|
case 1793:
|
||
|
case 1800:
|
||
|
case 1812:
|
||
|
case 1975:
|
||
|
case 2215:
|
||
|
case 2259:
|
||
|
case 2260:
|
||
|
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 503:
|
||
|
case 512:
|
||
|
case 1501:
|
||
|
case 1896:
|
||
|
parser.suggestKeywords(['SELECT']);
|
||
|
break;
|
||
|
case 191:
|
||
|
case 684:
|
||
|
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 660:
|
||
|
case 670:
|
||
|
case 671:
|
||
|
case 690:
|
||
|
case 806:
|
||
|
case 815:
|
||
|
case 816:
|
||
|
case 2136:
|
||
|
case 2169:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 202:
|
||
|
case 1449:
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 204:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
parser.suggestKeywords(['AUTHORIZATION', 'FUNCTIONS']);
|
||
|
break;
|
||
|
case 206:
|
||
|
case 814:
|
||
|
case 2140:
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
}
|
||
|
break;
|
||
|
case 211:
|
||
|
parser.suggestKeywords(['METADATA']);
|
||
|
break;
|
||
|
case 212:
|
||
|
case 218:
|
||
|
case 227:
|
||
|
case 661:
|
||
|
case 666:
|
||
|
case 696:
|
||
|
case 728:
|
||
|
case 812:
|
||
|
case 1343:
|
||
|
case 2196:
|
||
|
case 2216:
|
||
|
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 664:
|
||
|
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 1349:
|
||
|
case 1352:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 288:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
parser.suggestKeywords(['PARQUET']);
|
||
|
break;
|
||
|
case 290:
|
||
|
case 606:
|
||
|
case 608:
|
||
|
case 1263:
|
||
|
case 1266:
|
||
|
case 1350:
|
||
|
case 1390:
|
||
|
case 1455:
|
||
|
case 1617:
|
||
|
case 1796:
|
||
|
case 1893:
|
||
|
case 1950:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 291:
|
||
|
case 607:
|
||
|
case 609:
|
||
|
this.$ = $$[$0 - 3];
|
||
|
break;
|
||
|
case 294:
|
||
|
parser.suggestKeywords(['PRIMARY KEY']);
|
||
|
break;
|
||
|
case 295:
|
||
|
case 1347:
|
||
|
case 1493:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 296:
|
||
|
this.$ = $$[$0 - 2].concat($$[$0]);
|
||
|
break;
|
||
|
case 301:
|
||
|
case 303:
|
||
|
case 459:
|
||
|
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 1868:
|
||
|
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 563:
|
||
|
case 574:
|
||
|
case 597:
|
||
|
parser.suggestKeywords(parser.getTypeKeywords());
|
||
|
break;
|
||
|
case 358:
|
||
|
case 361:
|
||
|
parser.suggestKeywords(['COMMENT']);
|
||
|
break;
|
||
|
case 382:
|
||
|
parser.suggestKeywords(['KEY']);
|
||
|
break;
|
||
|
case 389:
|
||
|
case 390:
|
||
|
case 393:
|
||
|
case 419:
|
||
|
case 487:
|
||
|
case 488:
|
||
|
case 492:
|
||
|
case 1976:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
break;
|
||
|
case 394:
|
||
|
case 397:
|
||
|
parser.suggestKeywords(['HASH', 'RANGE']);
|
||
|
break;
|
||
|
case 435:
|
||
|
parser.suggestKeywords(['VALUE', 'VALUES']);
|
||
|
break;
|
||
|
case 437:
|
||
|
case 443:
|
||
|
case 446:
|
||
|
case 804:
|
||
|
parser.suggestFunctions();
|
||
|
break;
|
||
|
case 438:
|
||
|
if ($$[$0].endsWithLessThanOrEqual) {
|
||
|
parser.suggestKeywords(['VALUES']);
|
||
|
}
|
||
|
break;
|
||
|
case 439:
|
||
|
case 442:
|
||
|
case 445:
|
||
|
parser.suggestKeywords(['<', '<=']);
|
||
|
break;
|
||
|
case 440:
|
||
|
case 1303:
|
||
|
case 1306:
|
||
|
parser.suggestKeywords(['VALUES']);
|
||
|
break;
|
||
|
case 471:
|
||
|
case 1500:
|
||
|
parser.suggestKeywords(['AS']);
|
||
|
break;
|
||
|
case 480:
|
||
|
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 484:
|
||
|
this.$ = { suggestKeywords: ['ESCAPED BY'] };
|
||
|
break;
|
||
|
case 486:
|
||
|
case 491:
|
||
|
parser.suggestKeywords(['TERMINATED BY']);
|
||
|
break;
|
||
|
case 496:
|
||
|
case 497:
|
||
|
parser.suggestKeywords(['SERDEPROPERTIES']);
|
||
|
break;
|
||
|
case 505:
|
||
|
parser.commitLocations();
|
||
|
break;
|
||
|
case 507:
|
||
|
case 520:
|
||
|
case 536:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 508:
|
||
|
case 521:
|
||
|
if (!$$[$0 - 6]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 511:
|
||
|
var keywords = [{ value: 'AS', weight: 1 }];
|
||
|
if (!$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'COMMENT', weight: 3 });
|
||
|
}
|
||
|
parser.suggestKeywords(keywords);
|
||
|
break;
|
||
|
case 522:
|
||
|
case 541:
|
||
|
parser.suggestKeywords(['RETURNS']);
|
||
|
break;
|
||
|
case 523:
|
||
|
case 542:
|
||
|
parser.suggestKeywords(['LOCATION']);
|
||
|
break;
|
||
|
case 524:
|
||
|
parser.suggestKeywords(['SYMBOL']);
|
||
|
break;
|
||
|
case 534:
|
||
|
case 652:
|
||
|
parser.suggestKeywords(['FUNCTION']);
|
||
|
break;
|
||
|
case 535:
|
||
|
if (!$$[$0 - 13]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 543:
|
||
|
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 544:
|
||
|
parser.suggestKeywords(['MERGE_FN']);
|
||
|
break;
|
||
|
case 545:
|
||
|
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 564:
|
||
|
parser.suggestKeywords(['...']);
|
||
|
break;
|
||
|
case 599:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
break;
|
||
|
case 603:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['COMMENT']);
|
||
|
}
|
||
|
break;
|
||
|
case 619:
|
||
|
parser.addCommonTableExpressions($$[$0 - 1]);
|
||
|
break;
|
||
|
case 636:
|
||
|
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'FUNCTION', 'INCREMENTAL STATS', 'ROLE', 'SCHEMA', 'STATS', 'TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 640:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases();
|
||
|
break;
|
||
|
case 641:
|
||
|
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
|
||
|
break;
|
||
|
case 643:
|
||
|
case 648:
|
||
|
case 653:
|
||
|
if (!$$[$0 - 3]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 646:
|
||
|
case 647:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 650:
|
||
|
parser.suggestKeywords(['AGGREGATE']);
|
||
|
break;
|
||
|
case 663:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['INCREMENTAL']);
|
||
|
break;
|
||
|
case 669:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
break;
|
||
|
case 673:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestTables({ onlyTables: true });
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 676:
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['PURGE']);
|
||
|
}
|
||
|
break;
|
||
|
case 680:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestTables({ onlyViews: true });
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 681:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 686:
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
break;
|
||
|
case 687:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 691:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 694:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
}
|
||
|
break;
|
||
|
case 697:
|
||
|
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 710:
|
||
|
case 747:
|
||
|
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DROP', 'INSERT', 'REFRESH', 'ROLE', 'SELECT']);
|
||
|
break;
|
||
|
case 711:
|
||
|
parser.suggestKeywords(['TO GROUP']);
|
||
|
break;
|
||
|
case 712:
|
||
|
case 749:
|
||
|
case 2176:
|
||
|
case 2177:
|
||
|
parser.suggestKeywords(['GROUP']);
|
||
|
break;
|
||
|
case 714:
|
||
|
case 751:
|
||
|
if ($$[$0 - 1].isCreate) {
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 715:
|
||
|
if ($$[$0 - 2].isCreate) {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 718:
|
||
|
case 755:
|
||
|
case 2156:
|
||
|
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
|
||
|
break;
|
||
|
case 719:
|
||
|
case 721:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['WITH GRANT OPTION']);
|
||
|
}
|
||
|
break;
|
||
|
case 723:
|
||
|
case 2152:
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 732:
|
||
|
this.$ = { isCreate: true };
|
||
|
break;
|
||
|
case 742:
|
||
|
parser.suggestKeywords(['GRANT OPTION']);
|
||
|
break;
|
||
|
case 743:
|
||
|
parser.suggestKeywords(['OPTION']);
|
||
|
break;
|
||
|
case 748:
|
||
|
parser.suggestKeywords(['FROM GROUP']);
|
||
|
break;
|
||
|
case 752:
|
||
|
if ($$[$0 - 2].isCreate) {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 754:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
break;
|
||
|
case 760:
|
||
|
this.$ = { selectList: $$[$0] };
|
||
|
break;
|
||
|
case 761:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
this.$.cursorAtEnd = true;
|
||
|
break;
|
||
|
case 762:
|
||
|
parser.selectListNoTableSuggest($$[$0], $$[$0 - 2]);
|
||
|
break;
|
||
|
case 763:
|
||
|
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 769:
|
||
|
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 779:
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 780:
|
||
|
parser.suggestKeywords(['INTO']);
|
||
|
break;
|
||
|
case 781:
|
||
|
case 787:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 782:
|
||
|
if (!$$[$0 - 3]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 784:
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.owner = 'upsert';
|
||
|
}
|
||
|
break;
|
||
|
case 785:
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0]) {
|
||
|
this.$ = { suggestKeywords: ['PARTITION'] };
|
||
|
}
|
||
|
break;
|
||
|
case 786:
|
||
|
parser.suggestKeywords(['INTO', 'OVERWRITE']);
|
||
|
break;
|
||
|
case 788:
|
||
|
if (!$$[$0 - 4]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
break;
|
||
|
case 790:
|
||
|
case 791:
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.owner = 'insert';
|
||
|
}
|
||
|
break;
|
||
|
case 807:
|
||
|
parser.suggestKeywords(['DATA INPATH']);
|
||
|
break;
|
||
|
case 808:
|
||
|
parser.suggestKeywords(['INPATH']);
|
||
|
break;
|
||
|
case 810:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['INTO TABLE']);
|
||
|
}
|
||
|
break;
|
||
|
case 811:
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
break;
|
||
|
case 820:
|
||
|
case 821:
|
||
|
return parser.yy.result;
|
||
|
break;
|
||
|
case 822:
|
||
|
parser.prepareNewStatement();
|
||
|
break;
|
||
|
case 824:
|
||
|
case 826:
|
||
|
case 828:
|
||
|
parser.addStatementLocation(_$[$0]);
|
||
|
break;
|
||
|
case 827:
|
||
|
case 829:
|
||
|
parser.addStatementLocation(_$[$0 - 3]);
|
||
|
break;
|
||
|
case 836:
|
||
|
parser.suggestDdlAndDmlKeywords(['EXPLAIN']);
|
||
|
break;
|
||
|
case 837:
|
||
|
parser.suggestKeywords(['INSERT', 'SELECT']);
|
||
|
break;
|
||
|
case 860:
|
||
|
parser.suggestDdlAndDmlKeywords();
|
||
|
break;
|
||
|
case 1264:
|
||
|
case 1267:
|
||
|
case 1391:
|
||
|
this.$ = '';
|
||
|
break;
|
||
|
case 1287:
|
||
|
case 1290:
|
||
|
parser.yy.correlatedSubQuery = false;
|
||
|
break;
|
||
|
case 1288:
|
||
|
case 1292:
|
||
|
parser.suggestKeywords(['EXISTS']);
|
||
|
break;
|
||
|
case 1291:
|
||
|
parser.suggestKeywords(['NOT EXISTS']);
|
||
|
break;
|
||
|
case 1302:
|
||
|
case 1304:
|
||
|
case 1305:
|
||
|
case 1307:
|
||
|
parser.suggestKeywords(['<', '<=', '<>', '=', '>', '>=']);
|
||
|
break;
|
||
|
case 1340:
|
||
|
case 1392:
|
||
|
parser.addTableLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
this.$ = { identifierChain: [{ name: $$[$0] }] };
|
||
|
break;
|
||
|
case 1341:
|
||
|
case 1393:
|
||
|
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
|
||
|
parser.addTableLocation(_$[$0], [{ name: $$[$0 - 2] }, { name: $$[$0] }]);
|
||
|
this.$ = { identifierChain: [{ name: $$[$0 - 2] }, { name: $$[$0] }] };
|
||
|
break;
|
||
|
case 1342:
|
||
|
// 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 1344:
|
||
|
case 1358:
|
||
|
parser.suggestDatabases();
|
||
|
this.$ = { identifierChain: [{ name: $$[$0 - 2] }] };
|
||
|
break;
|
||
|
case 1345:
|
||
|
// You can have statements like 'SELECT ... FROM testTable t, t.|'
|
||
|
parser.suggestTablesOrColumns($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1346:
|
||
|
// 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 1348:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 1351:
|
||
|
case 1457:
|
||
|
case 1798:
|
||
|
this.$ = $$[$0 - 2];
|
||
|
break;
|
||
|
case 1353:
|
||
|
this.$ = { name: $$[$0] };
|
||
|
break;
|
||
|
case 1355:
|
||
|
this.$ = [{ name: $$[$0] }];
|
||
|
break;
|
||
|
case 1356:
|
||
|
this.$ = [{ name: $$[$0 - 2] }, { name: $$[$0 - 1] }];
|
||
|
break;
|
||
|
case 1370:
|
||
|
case 1553:
|
||
|
case 1554:
|
||
|
case 1560:
|
||
|
case 1561:
|
||
|
case 1889:
|
||
|
case 1977:
|
||
|
parser.valueExpressionSuggest();
|
||
|
break;
|
||
|
case 1378:
|
||
|
case 1381:
|
||
|
if (!$$[$0]) {
|
||
|
this.$ = { suggestKeywords: ['WITH REPLICATION ='] };
|
||
|
}
|
||
|
break;
|
||
|
case 1383:
|
||
|
case 2137:
|
||
|
parser.suggestKeywords(['IN']);
|
||
|
break;
|
||
|
case 1387:
|
||
|
parser.suggestKeywords(['REPLICATION =']);
|
||
|
break;
|
||
|
case 1394:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ prependDot: true });
|
||
|
break;
|
||
|
case 1395:
|
||
|
parser.suggestTablesOrColumns($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1397:
|
||
|
this.$ = { identifierChain: $$[$0 - 1].identifierChain, alias: $$[$0] };
|
||
|
break;
|
||
|
case 1400:
|
||
|
parser.yy.locations[parser.yy.locations.length - 1].type = 'column';
|
||
|
break;
|
||
|
case 1401:
|
||
|
case 1749:
|
||
|
parser.addAsteriskLocation(_$[$0], $$[$0 - 2].concat({ asterisk: true }));
|
||
|
break;
|
||
|
case 1403:
|
||
|
this.$ = [$$[$0].identifier];
|
||
|
parser.yy.firstChainLocation = parser.addUnknownLocation($$[$0].location, [$$[$0].identifier]);
|
||
|
break;
|
||
|
case 1404:
|
||
|
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 1405:
|
||
|
case 1413:
|
||
|
if ($$[$0].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: [$$[$0].identifier] });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1406:
|
||
|
case 1414:
|
||
|
if ($$[$0].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: $$[$0 - 2].concat([$$[$0].identifier]) });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1409:
|
||
|
parser.suggestColumns({
|
||
|
identifierChain: $$[$0 - 2]
|
||
|
});
|
||
|
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
|
||
|
break;
|
||
|
case 1410:
|
||
|
parser.suggestColumns({
|
||
|
identifierChain: $$[$0 - 4]
|
||
|
});
|
||
|
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
|
||
|
break;
|
||
|
case 1411:
|
||
|
this.$ = [$$[$0].identifier];
|
||
|
break;
|
||
|
case 1412:
|
||
|
$$[$0 - 2].push($$[$0].identifier);
|
||
|
break;
|
||
|
case 1415:
|
||
|
if ($$[$0 - 2].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: $$[$0 - 4].concat([$$[$0 - 2].identifier]) });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1416:
|
||
|
if ($$[$0 - 2].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: [$$[$0 - 2].identifier] });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1418:
|
||
|
parser.suggestColumns({ identifierChain: $$[$0 - 2] });
|
||
|
break;
|
||
|
case 1419:
|
||
|
parser.suggestColumns({ identifierChain: $$[$0 - 4] });
|
||
|
break;
|
||
|
case 1421:
|
||
|
this.$ = { identifier: { name: $$[$0] }, location: _$[$0] };
|
||
|
break;
|
||
|
case 1422:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3], keySet: true }, location: _$[$0 - 3] };
|
||
|
break;
|
||
|
case 1423:
|
||
|
this.$ = { identifier: { name: $$[$0 - 2], keySet: true }, location: _$[$0 - 2] };
|
||
|
break;
|
||
|
case 1424:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3] }, insideKey: true };
|
||
|
break;
|
||
|
case 1425:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3] } };
|
||
|
break;
|
||
|
case 1450:
|
||
|
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 1452:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords([{ value: 'DATABASE', weight: 2 }, { value: 'EXTENDED', weight: 1 }, { value: 'FORMATTED', weight: 1 }]);
|
||
|
}
|
||
|
break;
|
||
|
case 1453:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
|
||
|
}
|
||
|
parser.suggestDatabases();
|
||
|
break;
|
||
|
case 1454:
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
|
||
|
}
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 1460:
|
||
|
parser.addCommonTableExpressions($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1461:
|
||
|
case 1462:
|
||
|
case 1496:
|
||
|
parser.addCommonTableExpressions($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1466:
|
||
|
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0]);
|
||
|
this.$ = { selectList: $$[$0] };
|
||
|
break;
|
||
|
case 1467:
|
||
|
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 1478:
|
||
|
parser.suggestKeywords(['ALL', 'DISTINCT', 'SELECT']);
|
||
|
break;
|
||
|
case 1479:
|
||
|
parser.suggestKeywords(['ALL', 'DISTINCT']);
|
||
|
break;
|
||
|
case 1481:
|
||
|
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 1482:
|
||
|
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 1483:
|
||
|
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1]);
|
||
|
break;
|
||
|
case 1484:
|
||
|
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 1485:
|
||
|
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 1486:
|
||
|
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 1487:
|
||
|
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 1488:
|
||
|
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 1494:
|
||
|
this.$ = $$[$0 - 2].concat([$$[$0]]);
|
||
|
break;
|
||
|
case 1498:
|
||
|
parser.addCommonTableExpressions($$[$0 - 4]);
|
||
|
break;
|
||
|
case 1499:
|
||
|
parser.addCteAliasLocation(_$[$0 - 4], $$[$0 - 4]);
|
||
|
$$[$0 - 1].alias = $$[$0 - 4];
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 1506:
|
||
|
case 1507:
|
||
|
parser.addClauseLocation('whereClause', _$[$0 - 1], $$[$0].whereClauseLocation);
|
||
|
parser.addClauseLocation('limitClause', $$[$0].limitClausePreceding || _$[$0 - 1], $$[$0].limitClauseLocation);
|
||
|
break;
|
||
|
case 1508:
|
||
|
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 1509:
|
||
|
// 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 1513:
|
||
|
this.$ = { tableReferenceList: $$[$0] };
|
||
|
break;
|
||
|
case 1514:
|
||
|
case 1805:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 1516:
|
||
|
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 1517:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'where';
|
||
|
}
|
||
|
break;
|
||
|
case 1518:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'group by';
|
||
|
}
|
||
|
break;
|
||
|
case 1520:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'order by';
|
||
|
}
|
||
|
break;
|
||
|
case 1523:
|
||
|
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 1524:
|
||
|
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 1525:
|
||
|
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 1526:
|
||
|
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 1527:
|
||
|
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 1531:
|
||
|
if ($$[$0].suggestFilters) {
|
||
|
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
}
|
||
|
break;
|
||
|
case 1532:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestKeywords(['EXISTS', 'NOT EXISTS']);
|
||
|
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1535:
|
||
|
this.$ = { valueExpression: $$[$0] };
|
||
|
break;
|
||
|
case 1536:
|
||
|
case 1575:
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1537:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestSelectListAliases();
|
||
|
parser.suggestGroupBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1538:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
parser.suggestGroupBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1565:
|
||
|
if ($$[$0].emptyOrderBy) {
|
||
|
parser.suggestOrderBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
}
|
||
|
break;
|
||
|
case 1566:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
parser.suggestOrderBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1570:
|
||
|
this.$ = { emptyOrderBy: false };
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1571:
|
||
|
case 1572:
|
||
|
case 1573:
|
||
|
this.$ = { emptyOrderBy: false };
|
||
|
break;
|
||
|
case 1574:
|
||
|
this.$ = parser.mergeSuggestKeywords($$[$0 - 1], $$[$0]);
|
||
|
break;
|
||
|
case 1577:
|
||
|
this.$ = { emptyOrderBy: true };
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1578:
|
||
|
this.$ = { suggestKeywords: ['ASC', 'DESC'] };
|
||
|
break;
|
||
|
case 1581:
|
||
|
this.$ = { suggestKeywords: ['NULLS FIRST', 'NULLS LAST'] };
|
||
|
break;
|
||
|
case 1584:
|
||
|
parser.suggestKeywords(['FIRST', 'LAST']);
|
||
|
break;
|
||
|
case 1591:
|
||
|
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 1597:
|
||
|
case 1602:
|
||
|
parser.suggestFunctions({ types: ['BIGINT'] });
|
||
|
break;
|
||
|
case 1598:
|
||
|
case 1603:
|
||
|
delete parser.yy.result.suggestColumns;
|
||
|
break;
|
||
|
case 1607:
|
||
|
case 1608:
|
||
|
// verifyType($$[$0], 'BOOLEAN');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1610:
|
||
|
// verifyType($$[$0], 'NUMBER');
|
||
|
this.$ = $$[$0];
|
||
|
$$[$0].types = ['NUMBER'];
|
||
|
break;
|
||
|
case 1611:
|
||
|
case 1612:
|
||
|
case 1613:
|
||
|
case 1614:
|
||
|
case 1615:
|
||
|
case 1622:
|
||
|
case 1623:
|
||
|
case 1624:
|
||
|
case 1625:
|
||
|
case 1626:
|
||
|
case 1627:
|
||
|
case 1633:
|
||
|
case 1634:
|
||
|
case 1655:
|
||
|
case 1709:
|
||
|
case 1710:
|
||
|
case 1772:
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1616:
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
// clear correlated flag after completed sub-query (set by lexer)
|
||
|
parser.yy.correlatedSubQuery = false;
|
||
|
break;
|
||
|
case 1618:
|
||
|
case 1619:
|
||
|
case 1620:
|
||
|
case 1621:
|
||
|
parser.addColRefToVariableIfExists($$[$0 - 2], $$[$0]);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1628:
|
||
|
case 1629:
|
||
|
// verifyType($$[$0-2], 'BOOLEAN');
|
||
|
// verifyType($$[$0], 'BOOLEAN');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1630:
|
||
|
case 1631:
|
||
|
case 1632:
|
||
|
// verifyType($$[$0-2], 'NUMBER');
|
||
|
// verifyType($$[$0], 'NUMBER');
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1638:
|
||
|
parser.suggestKeywords(['BETWEEN', 'EXISTS', 'IN', 'ILIKE', 'IREGEXP', 'LIKE', 'REGEXP', 'RLIKE']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1639:
|
||
|
case 1641:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1640:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestKeywords(['EXISTS']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1642:
|
||
|
parser.suggestFunctions({ types: ['BOOLEAN'] });
|
||
|
parser.suggestColumns({ types: ['BOOLEAN'] });
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1643:
|
||
|
this.$ = { types: ['T'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1644:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 1645:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions('NUMBER');
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1646:
|
||
|
parser.suggestFunctions({ types: ['NUMBER'] });
|
||
|
parser.suggestColumns({ types: ['NUMBER'] });
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1647:
|
||
|
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 1648:
|
||
|
var keywords = ['FALSE', 'NULL', 'TRUE', 'DISTINCT FROM', 'UNKNOWN'];
|
||
|
parser.suggestKeywords(keywords);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1649:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1650:
|
||
|
case 1651:
|
||
|
case 1652:
|
||
|
parser.suggestKeywords(['NOT']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1653:
|
||
|
parser.valueExpressionSuggest($$[$0 - 5], $$[$0 - 3] ? 'IS NOT DISTINCT FROM' : 'IS DISTINCT FROM');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1654:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1656:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 1657:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1658:
|
||
|
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1659:
|
||
|
case 1660:
|
||
|
case 1661:
|
||
|
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1662:
|
||
|
case 1663:
|
||
|
case 1664:
|
||
|
case 1665:
|
||
|
if (!$$[$0 - 2].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1666:
|
||
|
case 1668:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1667:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: true };
|
||
|
break;
|
||
|
case 1669:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: $$[$0 - 1] === '<=' };
|
||
|
break;
|
||
|
case 1670:
|
||
|
case 1671:
|
||
|
case 1672:
|
||
|
case 1673:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1674:
|
||
|
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 1675:
|
||
|
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 1676:
|
||
|
case 1677:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
|
||
|
break;
|
||
|
case 1678:
|
||
|
case 1679:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
|
||
|
break;
|
||
|
case 1680:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 3].suggestFilters };
|
||
|
break;
|
||
|
case 1681:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1682:
|
||
|
case 1686:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['AND']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1683:
|
||
|
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1684:
|
||
|
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 1685:
|
||
|
if ($$[$0 - 2].types[0] === $$[$0].types[0] && !$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1687:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1688:
|
||
|
case 1690:
|
||
|
case 1692:
|
||
|
case 1694:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, suggestFilters: true };
|
||
|
break;
|
||
|
case 1689:
|
||
|
case 1693:
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1691:
|
||
|
case 1695:
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1696:
|
||
|
case 1697:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
this.$ = { types: ['NUMBER'], typeSet: true };
|
||
|
break;
|
||
|
case 1698:
|
||
|
case 1699:
|
||
|
case 1700:
|
||
|
if (!$$[$0 - 2].typeSet) {
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1701:
|
||
|
case 1702:
|
||
|
case 1703:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
this.$ = { types: ['NUMBER'], typeSet: true };
|
||
|
break;
|
||
|
case 1704:
|
||
|
case 1705:
|
||
|
case 1706:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1707:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 1708:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1711:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0]);
|
||
|
parser.applyTypeToSuggestions(['STRING']);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1712:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1] + ' ' + $$[$0]);
|
||
|
parser.applyTypeToSuggestions(['STRING']);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1714:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1716:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1717:
|
||
|
this.$ = $$[$0];
|
||
|
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
|
||
|
break;
|
||
|
case 1718:
|
||
|
this.$ = { types: ['T'], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 1719:
|
||
|
case 2023:
|
||
|
case 2028:
|
||
|
case 2029:
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 1720:
|
||
|
case 1722:
|
||
|
$$[$0].position = 1;
|
||
|
break;
|
||
|
case 1721:
|
||
|
$$[$0].position = $$[$0 - 2].position + 1;
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 1723:
|
||
|
$$[$0 - 2].position += 1;
|
||
|
break;
|
||
|
case 1724:
|
||
|
$$[$0 - 2].position = 1;
|
||
|
break;
|
||
|
case 1725:
|
||
|
$$[$0 - 4].position += 1;
|
||
|
break;
|
||
|
case 1726:
|
||
|
parser.valueExpressionSuggest();
|
||
|
$$[$0 - 2].position += 1;
|
||
|
break;
|
||
|
case 1727:
|
||
|
parser.valueExpressionSuggest();
|
||
|
$$[$0 - 4].position += 1;
|
||
|
break;
|
||
|
case 1728:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1729:
|
||
|
case 1730:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { cursorAtStart: true, position: 1 };
|
||
|
break;
|
||
|
case 1731:
|
||
|
case 1732:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { position: 2 };
|
||
|
break;
|
||
|
case 1736:
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0].chain };
|
||
|
break;
|
||
|
case 1737:
|
||
|
// 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 1738:
|
||
|
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 1740:
|
||
|
this.$ = { types: ['NULL'] };
|
||
|
break;
|
||
|
case 1741:
|
||
|
this.$ = { types: ['TIMESTAMP'] };
|
||
|
break;
|
||
|
case 1743:
|
||
|
if ($$[$0].suggestKeywords) {
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0], suggestKeywords: $$[$0].suggestKeywords };
|
||
|
}
|
||
|
else {
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0] };
|
||
|
}
|
||
|
break;
|
||
|
case 1744:
|
||
|
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 1745:
|
||
|
case 1937:
|
||
|
case 1938:
|
||
|
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
|
||
|
if ($$[$0].position) {
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 1], $$[$0].position);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 1]) };
|
||
|
break;
|
||
|
case 1748:
|
||
|
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 1752:
|
||
|
parser.suggestKeywords(['DAYS', 'HOURS', 'MICROSECONDS', 'MILLISECONDS', 'MINUTES', 'MONTHS', 'NANOSECONDS', 'SECONDS', 'WEEKS', 'YEARS']);
|
||
|
break;
|
||
|
case 1757:
|
||
|
parser.suggestValues($$[$0]);
|
||
|
break;
|
||
|
case 1758:
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1764:
|
||
|
case 1766:
|
||
|
this.$ = $$[$0 - 1] + $$[$0];
|
||
|
break;
|
||
|
case 1765:
|
||
|
this.$ = $$[$0 - 2] + $$[$0 - 1] + $$[$0];
|
||
|
break;
|
||
|
case 1770:
|
||
|
case 1771:
|
||
|
if (/\$\{[^}]*\}/.test($$[$0])) {
|
||
|
parser.addVariableLocation(_$[$0], $$[$0]);
|
||
|
this.$ = { types: ['STRING'], columnReference: [{ name: $$[$0] }] };
|
||
|
}
|
||
|
else {
|
||
|
this.$ = { types: ['STRING'] };
|
||
|
}
|
||
|
break;
|
||
|
case 1773:
|
||
|
this.$ = { partialQuote: '\'', missingEndQuote: parser.yy.missingEndQuote };
|
||
|
break;
|
||
|
case 1774:
|
||
|
this.$ = { partialQuote: '"', missingEndQuote: parser.yy.missingEndQuote };
|
||
|
break;
|
||
|
case 1779:
|
||
|
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 1780:
|
||
|
parser.addAsteriskLocation(_$[$0], [{ asterisk: true }]);
|
||
|
this.$ = { asterisk: true };
|
||
|
break;
|
||
|
case 1781:
|
||
|
if ($$[$0]) {
|
||
|
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
|
||
|
}
|
||
|
break;
|
||
|
case 1782:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.addColumnAliasLocation(_$[$0], $$[$0], _$[$0 - 2]);
|
||
|
this.$ = { suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 1784:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 1785:
|
||
|
$$[$0 - 2].push($$[$0]);
|
||
|
break;
|
||
|
case 1787:
|
||
|
case 1788:
|
||
|
this.$ = { cursorAtStart: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 1790:
|
||
|
parser.checkForSelectListKeywords($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1791:
|
||
|
parser.checkForSelectListKeywords($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1792:
|
||
|
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestTables: true, suggestDatabases: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 1794:
|
||
|
case 1795:
|
||
|
case 1797:
|
||
|
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true, };
|
||
|
break;
|
||
|
case 1808:
|
||
|
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 1815:
|
||
|
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 1816:
|
||
|
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 1817:
|
||
|
this.$ = { joinType: $$[$0 - 1] };
|
||
|
break;
|
||
|
case 1818:
|
||
|
this.$ = { joinType: $$[$0 - 2] };
|
||
|
break;
|
||
|
case 1822:
|
||
|
if ($$[$0 - 3].suggestKeywords) {
|
||
|
parser.suggestKeywords($$[$0 - 3].suggestKeywords);
|
||
|
}
|
||
|
break;
|
||
|
case 1826:
|
||
|
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 1831:
|
||
|
this.$ = 'JOIN';
|
||
|
break;
|
||
|
case 1832:
|
||
|
this.$ = 'ANTI JOIN';
|
||
|
break;
|
||
|
case 1833:
|
||
|
this.$ = 'CROSS JOIN';
|
||
|
break;
|
||
|
case 1834:
|
||
|
this.$ = 'INNER JOIN';
|
||
|
break;
|
||
|
case 1835:
|
||
|
this.$ = 'OUTER JOIN';
|
||
|
break;
|
||
|
case 1836:
|
||
|
this.$ = 'SEMI JOIN';
|
||
|
break;
|
||
|
case 1837:
|
||
|
this.$ = 'FULL JOIN';
|
||
|
break;
|
||
|
case 1838:
|
||
|
this.$ = 'FULL OUTER JOIN';
|
||
|
break;
|
||
|
case 1839:
|
||
|
this.$ = 'LEFT JOIN';
|
||
|
break;
|
||
|
case 1840:
|
||
|
this.$ = 'LEFT ANTI JOIN';
|
||
|
break;
|
||
|
case 1841:
|
||
|
this.$ = 'LEFT INNER JOIN';
|
||
|
break;
|
||
|
case 1842:
|
||
|
this.$ = 'LEFT OUTER JOIN';
|
||
|
break;
|
||
|
case 1843:
|
||
|
this.$ = 'LEFT SEMI JOIN';
|
||
|
break;
|
||
|
case 1844:
|
||
|
this.$ = 'RIGHT JOIN';
|
||
|
break;
|
||
|
case 1845:
|
||
|
this.$ = 'RIGHT ANTI JOIN';
|
||
|
break;
|
||
|
case 1846:
|
||
|
case 1847:
|
||
|
this.$ = 'RIGHT OUTER JOIN';
|
||
|
break;
|
||
|
case 1848:
|
||
|
this.$ = 'RIGHT SEMI JOIN';
|
||
|
break;
|
||
|
case 1849:
|
||
|
case 1850:
|
||
|
case 1851:
|
||
|
case 1852:
|
||
|
case 1853:
|
||
|
case 1854:
|
||
|
case 1856:
|
||
|
case 1857:
|
||
|
case 1858:
|
||
|
case 1859:
|
||
|
case 1861:
|
||
|
case 1862:
|
||
|
case 1863:
|
||
|
case 1864:
|
||
|
this.$ = { suggestKeywords: ['JOIN'] };
|
||
|
break;
|
||
|
case 1855:
|
||
|
this.$ = { suggestKeywords: ['OUTER'] };
|
||
|
break;
|
||
|
case 1860:
|
||
|
case 1865:
|
||
|
this.$ = { suggestKeywords: ['ANTI', 'INNER', 'OUTER', 'SEMI'] };
|
||
|
break;
|
||
|
case 1866:
|
||
|
this.$ = { noJoinCondition: true, suggestKeywords: ['ON', 'USING'] };
|
||
|
break;
|
||
|
case 1867:
|
||
|
this.$ = { valueExpression: $$[$0] };
|
||
|
break;
|
||
|
case 1872:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestJoinConditions({ prependOn: false });
|
||
|
break;
|
||
|
case 1873:
|
||
|
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 1874:
|
||
|
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 1875:
|
||
|
if ($$[$0 - 1]) {
|
||
|
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
|
||
|
}
|
||
|
break;
|
||
|
case 1876:
|
||
|
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 1877:
|
||
|
if ($$[$0 - 1]) {
|
||
|
parser.addTablePrimary({ subQueryAlias: $$[$0 - 1].alias });
|
||
|
parser.addSubqueryAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias);
|
||
|
}
|
||
|
break;
|
||
|
case 1884:
|
||
|
this.$ = { suggestKeywords: ['REPEATABLE()'] };
|
||
|
break;
|
||
|
case 1886:
|
||
|
parser.suggestKeywords(['SYSTEM()']);
|
||
|
break;
|
||
|
case 1891:
|
||
|
parser.pushQueryState();
|
||
|
break;
|
||
|
case 1892:
|
||
|
parser.popQueryState();
|
||
|
break;
|
||
|
case 1894:
|
||
|
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 1897:
|
||
|
var subQuery = parser.getSubQuery($$[$0]);
|
||
|
subQuery.columns.forEach(function (column) {
|
||
|
parser.expandIdentifierChain({ wrapper: column });
|
||
|
delete column.linked;
|
||
|
});
|
||
|
parser.popQueryState(subQuery);
|
||
|
this.$ = subQuery;
|
||
|
break;
|
||
|
case 1914:
|
||
|
case 1915:
|
||
|
case 1916:
|
||
|
case 1917:
|
||
|
this.$ = { alias: $$[$0], location: _$[$0] };
|
||
|
break;
|
||
|
case 1923:
|
||
|
if (!$$[$0]) {
|
||
|
$$[$0 - 1].suggestKeywords = ['OVER'];
|
||
|
}
|
||
|
break;
|
||
|
case 1931:
|
||
|
parser.suggestKeywords(['OVER']);
|
||
|
break;
|
||
|
case 1935:
|
||
|
case 1936:
|
||
|
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 1947:
|
||
|
this.$ = { expression: $$[$0 - 1] };
|
||
|
break;
|
||
|
case 1948:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { position: 1 };
|
||
|
break;
|
||
|
case 1949:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1]);
|
||
|
break;
|
||
|
case 1957:
|
||
|
case 2035:
|
||
|
case 2076:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 2]) };
|
||
|
break;
|
||
|
case 1958:
|
||
|
this.$ = { function: $$[$0 - 3], expression: $$[$0 - 2], types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 1959:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 3], 1);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 1960:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 1961:
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 3], $$[$0 - 1].position);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 1969:
|
||
|
case 1970:
|
||
|
if (parser.yy.result.suggestFunctions) {
|
||
|
parser.suggestAggregateFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1971:
|
||
|
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 1972:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'ORDER BY', weight: 2 }]);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
}
|
||
|
break;
|
||
|
case 1981:
|
||
|
// Only allowed in last order by
|
||
|
delete parser.yy.result.suggestAnalyticFunctions;
|
||
|
break;
|
||
|
case 1982:
|
||
|
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 1988:
|
||
|
parser.suggestKeywords(['BETWEEN']);
|
||
|
break;
|
||
|
case 1989:
|
||
|
if (!$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED PRECEDING']);
|
||
|
}
|
||
|
else if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['AND']);
|
||
|
}
|
||
|
break;
|
||
|
case 1994:
|
||
|
lexer.popState();
|
||
|
break;
|
||
|
case 1995:
|
||
|
lexer.begin('hdfs');
|
||
|
break;
|
||
|
case 1997:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 3] });
|
||
|
break;
|
||
|
case 1998:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 2] });
|
||
|
break;
|
||
|
case 1999:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 1] });
|
||
|
break;
|
||
|
case 2000:
|
||
|
parser.suggestHdfs({ path: '' });
|
||
|
break;
|
||
|
case 2001:
|
||
|
parser.suggestHdfs({ path: '' });
|
||
|
break;
|
||
|
case 2007:
|
||
|
parser.suggestKeywords(['PRECEDING']);
|
||
|
break;
|
||
|
case 2008:
|
||
|
case 2013:
|
||
|
parser.suggestKeywords(['ROW']);
|
||
|
break;
|
||
|
case 2012:
|
||
|
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED FOLLOWING']);
|
||
|
break;
|
||
|
case 2014:
|
||
|
parser.suggestKeywords(['FOLLOWING']);
|
||
|
break;
|
||
|
case 2020:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestSelectListAliases(true);
|
||
|
break;
|
||
|
case 2021:
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestSelectListAliases(true);
|
||
|
break;
|
||
|
case 2022:
|
||
|
case 2027:
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2024:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2025:
|
||
|
case 2026:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2030:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'AS', weight: 2 }]);
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2031:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'AS', weight: 2 }]);
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2032:
|
||
|
case 2033:
|
||
|
parser.suggestKeywords(parser.getTypeKeywords());
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2034:
|
||
|
case 2040:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2036:
|
||
|
case 2041:
|
||
|
case 2075:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2037:
|
||
|
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 2038:
|
||
|
case 2043:
|
||
|
case 2078:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2039:
|
||
|
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 2042:
|
||
|
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 2044:
|
||
|
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 2061:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2062:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2063:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2064:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2065:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2066:
|
||
|
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2067:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2068:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2069:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2070:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2071:
|
||
|
if ($$[$0 - 3].types[0] === 'STRING') {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], ['FROM']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2072:
|
||
|
if ($$[$0 - 2].types[0] === 'STRING') {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['FROM']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2077:
|
||
|
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 2079:
|
||
|
if (parser.yy.result.suggestFunctions && !parser.yy.result.suggestFunctions.types) {
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2105:
|
||
|
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 2106:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['COLUMN STATS', 'CREATE TABLE', 'CREATE VIEW', 'FILES IN', 'PARTITIONS', 'RANGE PARTITIONS', 'TABLE STATS']);
|
||
|
break;
|
||
|
case 2107:
|
||
|
parser.suggestKeywords(['AGGREGATE FUNCTIONS', 'ANALYTIC FUNCTIONS', 'DATABASES', 'FUNCTIONS', 'SCHEMAS', 'TABLES']);
|
||
|
break;
|
||
|
case 2121:
|
||
|
case 2138:
|
||
|
case 2170:
|
||
|
case 2172:
|
||
|
case 2181:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 2125:
|
||
|
if ($$[$0 - 1].isView) {
|
||
|
parser.suggestTables({ onlyViews: true });
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestTables();
|
||
|
}
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 2126:
|
||
|
if (parser.yy.result.suggestTables && $$[$0 - 1].isView) {
|
||
|
parser.yy.result.suggestTables.onlyViews = true;
|
||
|
}
|
||
|
break;
|
||
|
case 2127:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 2129:
|
||
|
this.$ = { isView: true };
|
||
|
break;
|
||
|
case 2131:
|
||
|
parser.suggestKeywords(['ROLES']);
|
||
|
break;
|
||
|
case 2132:
|
||
|
parser.suggestKeywords(['CURRENT']);
|
||
|
break;
|
||
|
case 2135:
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
break;
|
||
|
case 2142:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['IN']);
|
||
|
break;
|
||
|
case 2145:
|
||
|
case 2148:
|
||
|
parser.suggestKeywords(['FUNCTIONS']);
|
||
|
break;
|
||
|
case 2146:
|
||
|
case 2149:
|
||
|
parser.suggestKeywords(['AGGREGATE', 'ANALYTICAL']);
|
||
|
break;
|
||
|
case 2147:
|
||
|
case 2186:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IN', 'LIKE']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
}
|
||
|
break;
|
||
|
case 2150:
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords([{ value: 'IN', weight: 2 }, { value: 'LIKE', weight: 1 }]);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
}
|
||
|
break;
|
||
|
case 2158:
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
|
||
|
break;
|
||
|
case 2159:
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
break;
|
||
|
case 2161:
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
parser.suggestTables();
|
||
|
break;
|
||
|
case 2175:
|
||
|
parser.suggestKeywords(['GRANT']);
|
||
|
break;
|
||
|
case 2192:
|
||
|
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 2193:
|
||
|
parser.suggestKeywords(['SET']);
|
||
|
break;
|
||
|
case 2209:
|
||
|
parser.suggestKeywords(['=']);
|
||
|
break;
|
||
|
case 2218:
|
||
|
if (!parser.yy.cursorFound) {
|
||
|
parser.yy.result.useDatabase = $$[$0];
|
||
|
}
|
||
|
break;
|
||
|
case 2221:
|
||
|
this.$ = { inValueEdit: true };
|
||
|
break;
|
||
|
case 2222:
|
||
|
this.$ = { inValueEdit: true, cursorAtStart: true };
|
||
|
break;
|
||
|
case 2223:
|
||
|
case 2224:
|
||
|
case 2225:
|
||
|
case 2226:
|
||
|
case 2227:
|
||
|
this.$ = { suggestKeywords: ['NOT'] };
|
||
|
break;
|
||
|
case 2233:
|
||
|
case 2234:
|
||
|
case 2235:
|
||
|
case 2236:
|
||
|
case 2237:
|
||
|
parser.suggestFunctions({ types: ['STRING'] });
|
||
|
parser.suggestColumns({ types: ['STRING'] });
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 2238:
|
||
|
case 2240:
|
||
|
this.$ = parser.findCaseType($$[$0 - 1]);
|
||
|
break;
|
||
|
case 2239:
|
||
|
case 2242:
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2241:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['END']);
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2243:
|
||
|
this.$ = parser.findCaseType($$[$0 - 2]);
|
||
|
break;
|
||
|
case 2244:
|
||
|
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 2245:
|
||
|
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 2246:
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
|
||
|
break;
|
||
|
case 2247:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2248:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 2249:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 2250:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2253:
|
||
|
this.$ = { caseTypes: [$$[$0]], lastType: $$[$0] };
|
||
|
break;
|
||
|
case 2254:
|
||
|
$$[$0 - 1].caseTypes.push($$[$0]);
|
||
|
this.$ = { caseTypes: $$[$0 - 1].caseTypes, lastType: $$[$0] };
|
||
|
break;
|
||
|
case 2258:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
|
||
|
break;
|
||
|
case 2261:
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 2262:
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 2263:
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 2264:
|
||
|
case 2265:
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 2266:
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2267:
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [$$[$0]] };
|
||
|
break;
|
||
|
case 2268:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2269:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2270:
|
||
|
case 2272:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
|
||
|
break;
|
||
|
case 2271:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
|
||
|
break;
|
||
|
case 2273:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: true };
|
||
|
break;
|
||
|
case 2274:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2275:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2276:
|
||
|
case 2277:
|
||
|
case 2278:
|
||
|
case 2279:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
}
|
||
|
},
|
||
|
table: [o($V0, $V1, { 455: 1, 456: 2 }), { 1: [3] }, o($V2, $V3, { 457: 3, 461: 4, 3: 5, 362: 6, 137: 7, 464: 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, 363: 21, 364: 22, 365: 23, 366: 24, 429: 25, 370: 26, 30: 28, 31: 29, 32: 30, 33: 31, 161: 35, 162: 36, 163: 37, 164: 38, 165: 39, 375: 40, 376: 41, 377: 42, 378: 43, 379: 44, 380: 45, 381: 46, 988: 51, 989: 52, 990: 53, 991: 54, 992: 55, 993: 56, 994: 57, 995: 58, 996: 59, 997: 60, 998: 61, 999: 62, 372: 65, 43: 71, 135: 72, 311: 75, 312: 76, 425: 80, 427: 81, 436: 82, 437: 83, 26: $V4, 38: $V5, 63: $V6, 86: $V7, 147: $V8, 153: $V9, 155: $Va, 170: $Vb, 306: $Vc, 391: $Vd, 392: $Ve, 401: $Vf, 413: $Vg, 414: $Vh, 417: $Vi, 440: $Vj, 451: $Vk, 470: $Vl, 814: $Vm, 1000: $Vn, 1015: $Vo, 1029: $Vp }), { 458: [1, 86], 462: [1, 87] }, o($V2, [2, 824]), o($V2, [2, 830]), o($V2, [2, 831]), o($V2, [2, 832]), { 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, 306: $Vc, 311: 75, 312: 76, 362: 89, 363: 21, 364: 22, 365: 23, 366: 24, 370: 26, 372: 65, 375: 40, 376: 41, 377: 42, 378: 43, 379: 44, 380: 45, 381: 46, 391: $Vd, 392: $Ve, 401: $Vf, 413: $Vg, 414: $Vh, 417: $Vi, 425: 80, 427: 81, 429: 25, 436: 82, 437: 83, 440: $Vj, 451: $Vk, 814: $Vm, 988: 51, 989: 52, 990: 53, 991: 54, 992: 55, 993: 56, 994: 57, 995: 58, 996: 59, 997: 60, 998: 61, 999: 62, 1000: $Vn, 1015: $Vo, 1029: $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, 613]), o($V2, [2, 614]), o($V2, [2, 615]), o($V2, [2, 616]), o($Vq, $Vr, { 430: 91, 816: 92, 818: 93, 746: $Vs }), { 89: $Vt, 372: 97, 413: $Vg, 414: $Vh, 425: 80, 427: 81, 429: 95, 436: 82, 437: 83, 440: $Vj }, o([26, 38, 63, 86, 147, 153, 155, 170, 306, 391, 392, 401, 413, 414, 417, 440, 451, 814, 1000, 1015, 1029], [2, 859]), 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, 410: $Vy, 411: $Vz, 416: $VA, 467: 106, 468: $VB, 469: $VC, 493: $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, 623]), o($V2, [2, 624]), o($V2, [2, 625]), o($V2, [2, 626]), o($V2, [2, 627]), o($V2, [2, 628]), o($V2, [2, 629]), { 38: $VE, 63: $VF, 147: $VG, 170: $VH, 359: [1, 117], 403: 118, 412: $VI, 413: $VJ, 414: $VK }, { 38: $VE, 63: $VF, 147: $VG, 170: $VH, 359: [1, 126], 403: 127, 412: $VI, 413: $VJ, 414: $VK }, o($VL, $VM, { 779: 128, 143: [1, 129], 566: $VN, 578: $VO }), { 41: $Vu, 64: $Vv, 172: 134, 242: $Vw, 254: $Vx, 410: $Vy, 411: $Vz, 412: [1, 133], 416: $VA, 467: 106, 468: $VB, 469: $VC, 987: 132 }, o($V2, [2, 2093]), o($V2, [2, 2094]), o($V2, [2, 2095]), 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]), { 41: $Vu, 64: $Vv, 172: 135, 242: $Vw, 254: $Vx, 410: $Vy, 411: $Vz, 416: $VA, 467: 106, 468: $VB, 469: $VC }, { 40: 101, 41: $Vu, 64: $Vv, 89: $VP, 130: 143, 172: 102, 242: $Vw, 254: $Vx, 393: 136, 394: [2, 702], 395: 137, 410: $Vy, 411: $Vz, 416: $VA, 467: 106, 468: $VB, 469: $VC, 493: $VD, 873: 144, 905: 138, 907: 139, 908: 140, 919: 141, 920: 142 }, o($V2, [2, 756]), { 452: [1, 146] }, { 40: 151, 41: $Vu, 58: 150, 64: $Vv, 172: 102, 242: $Vw, 254: $Vx, 410: $Vy, 411: $Vz, 416: $VA, 467: 106, 468: $VB, 469: $VC, 493: $VD, 803: 149, 1016: 147, 1022: 148 }, o([41, 64, 73, 89, 138, 146, 179, 180, 224, 236, 241, 242, 254, 361, 391, 410, 411, 416, 468, 469, 472, 473, 474, 478, 482, 492, 493, 507, 508, 523, 565, 568, 569, 585, 591, 603, 630, 633, 640, 718, 719, 720, 721, 727, 744, 749, 750, 753,
|
||
|
defaultActions: { 86: [2, 819], 119: [2, 730], 120: [2, 731], 121: [2, 732], 122: [2, 733], 123: [2, 734], 124: [2, 735], 137: [2, 703], 148: [2, 2197], 149: [2, 2199], 176: [2, 165], 187: [2, 1276], 211: [2, 1257], 212: [2, 1274], 213: [2, 1246], 214: [2, 1247], 217: [2, 795], 218: [2, 796], 241: [2, 736], 276: [2, 1397], 303: [2, 164], 424: [2, 1897], 425: [2, 1899], 426: [2, 1901], 427: [2, 1903], 428: [2, 1905], 429: [2, 1907], 430: [2, 1909], 431: [2, 1911], 437: [2, 2211], 461: [2, 1939], 462: [2, 1940], 463: [2, 1941], 464: [2, 1942], 465: [2, 1943], 466: [2, 1944], 467: [2, 1945], 489: [2, 2045], 490: [2, 2046], 491: [2, 2047], 492: [2, 2048], 493: [2, 2049], 494: [2, 2050], 495: [2, 2051], 496: [2, 2052], 497: [2, 2053], 498: [2, 2054], 499: [2, 2055], 500: [2, 2056], 501: [2, 2057], 502: [2, 2058], 626: [2, 818], 837: [2, 1957], 963: [2, 1958], 1029: [2, 573], 1032: [2, 572], 1080: [2, 377], 1110: [2, 1980], 1111: [2, 1985], 1199: [2, 577], 1203: [2, 1986], 1207: [2, 1987], 1223: [2, 579], 1242: [2, 2010], 1243: [2, 2011] },
|
||
|
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 771;
|
||
|
break;
|
||
|
case 5:
|
||
|
return 44;
|
||
|
break;
|
||
|
case 6:
|
||
|
return 321;
|
||
|
break;
|
||
|
case 7:
|
||
|
return 412;
|
||
|
break;
|
||
|
case 8:
|
||
|
return 477;
|
||
|
break;
|
||
|
case 9:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('ALTER', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 38;
|
||
|
break;
|
||
|
case 10:
|
||
|
return 478;
|
||
|
break;
|
||
|
case 11:
|
||
|
return 479;
|
||
|
break;
|
||
|
case 12:
|
||
|
return 480;
|
||
|
break;
|
||
|
case 13:
|
||
|
return 481;
|
||
|
break;
|
||
|
case 14:
|
||
|
return 483;
|
||
|
break;
|
||
|
case 15:
|
||
|
return 485;
|
||
|
break;
|
||
|
case 16:
|
||
|
return 486;
|
||
|
break;
|
||
|
case 17:
|
||
|
return 136;
|
||
|
break;
|
||
|
case 18:
|
||
|
return 487;
|
||
|
break;
|
||
|
case 19:
|
||
|
return 488;
|
||
|
break;
|
||
|
case 20:
|
||
|
return 489;
|
||
|
break;
|
||
|
case 21:
|
||
|
return 490;
|
||
|
break;
|
||
|
case 22:
|
||
|
return 491;
|
||
|
break;
|
||
|
case 23:
|
||
|
return 151;
|
||
|
break;
|
||
|
case 24:
|
||
|
return 288;
|
||
|
break;
|
||
|
case 25:
|
||
|
return 494;
|
||
|
break;
|
||
|
case 26:
|
||
|
return 495;
|
||
|
break;
|
||
|
case 27:
|
||
|
return 496;
|
||
|
break;
|
||
|
case 28:
|
||
|
return 497;
|
||
|
break;
|
||
|
case 29:
|
||
|
return 498;
|
||
|
break;
|
||
|
case 30:
|
||
|
return 85;
|
||
|
break;
|
||
|
case 31:
|
||
|
return 499;
|
||
|
break;
|
||
|
case 32:
|
||
|
return 500;
|
||
|
break;
|
||
|
case 33:
|
||
|
return 257;
|
||
|
break;
|
||
|
case 34:
|
||
|
return 502;
|
||
|
break;
|
||
|
case 35:
|
||
|
return 503;
|
||
|
break;
|
||
|
case 36:
|
||
|
return 504;
|
||
|
break;
|
||
|
case 37:
|
||
|
return 505;
|
||
|
break;
|
||
|
case 38:
|
||
|
return 506;
|
||
|
break;
|
||
|
case 39:
|
||
|
return 507;
|
||
|
break;
|
||
|
case 40:
|
||
|
return 111;
|
||
|
break;
|
||
|
case 41:
|
||
|
return 509;
|
||
|
break;
|
||
|
case 42:
|
||
|
return 510;
|
||
|
break;
|
||
|
case 43:
|
||
|
return 511;
|
||
|
break;
|
||
|
case 44:
|
||
|
return 350;
|
||
|
break;
|
||
|
case 45:
|
||
|
return 512;
|
||
|
break;
|
||
|
case 46:
|
||
|
return 513;
|
||
|
break;
|
||
|
case 47:
|
||
|
return 65;
|
||
|
break;
|
||
|
case 48:
|
||
|
return 117;
|
||
|
break;
|
||
|
case 49:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 86;
|
||
|
break;
|
||
|
case 50:
|
||
|
return 514;
|
||
|
break;
|
||
|
case 51:
|
||
|
return 87;
|
||
|
break;
|
||
|
case 52:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 155;
|
||
|
break;
|
||
|
case 53:
|
||
|
return 515;
|
||
|
break;
|
||
|
case 54:
|
||
|
return 516;
|
||
|
break;
|
||
|
case 55:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 56:
|
||
|
return 518;
|
||
|
break;
|
||
|
case 57:
|
||
|
return 519;
|
||
|
break;
|
||
|
case 58:
|
||
|
return 520;
|
||
|
break;
|
||
|
case 59:
|
||
|
return 521;
|
||
|
break;
|
||
|
case 60:
|
||
|
return 522;
|
||
|
break;
|
||
|
case 61:
|
||
|
return 524;
|
||
|
break;
|
||
|
case 62:
|
||
|
return 525;
|
||
|
break;
|
||
|
case 63:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('CREATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 170;
|
||
|
break;
|
||
|
case 64:
|
||
|
return 526;
|
||
|
break;
|
||
|
case 65:
|
||
|
return 527;
|
||
|
break;
|
||
|
case 66:
|
||
|
return 528;
|
||
|
break;
|
||
|
case 67:
|
||
|
return 529;
|
||
|
break;
|
||
|
case 68:
|
||
|
return 530;
|
||
|
break;
|
||
|
case 69:
|
||
|
return 531;
|
||
|
break;
|
||
|
case 70:
|
||
|
return 532;
|
||
|
break;
|
||
|
case 71:
|
||
|
return 533;
|
||
|
break;
|
||
|
case 72:
|
||
|
return 534;
|
||
|
break;
|
||
|
case 73:
|
||
|
return 535;
|
||
|
break;
|
||
|
case 74:
|
||
|
return 536;
|
||
|
break;
|
||
|
case 75:
|
||
|
return 537;
|
||
|
break;
|
||
|
case 76:
|
||
|
return 452;
|
||
|
break;
|
||
|
case 77:
|
||
|
return 143;
|
||
|
break;
|
||
|
case 78:
|
||
|
return 538;
|
||
|
break;
|
||
|
case 79:
|
||
|
return 539;
|
||
|
break;
|
||
|
case 80:
|
||
|
return 540;
|
||
|
break;
|
||
|
case 81:
|
||
|
return 541;
|
||
|
break;
|
||
|
case 82:
|
||
|
return 542;
|
||
|
break;
|
||
|
case 83:
|
||
|
return 543;
|
||
|
break;
|
||
|
case 84:
|
||
|
return 544;
|
||
|
break;
|
||
|
case 85:
|
||
|
return 392;
|
||
|
break;
|
||
|
case 86:
|
||
|
return 295;
|
||
|
break;
|
||
|
case 87:
|
||
|
return 545;
|
||
|
break;
|
||
|
case 88:
|
||
|
return 546;
|
||
|
break;
|
||
|
case 89:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('DESCRIBE', yy_.yylloc);
|
||
|
return 814;
|
||
|
break;
|
||
|
case 90:
|
||
|
return 547;
|
||
|
break;
|
||
|
case 91:
|
||
|
return 548;
|
||
|
break;
|
||
|
case 92:
|
||
|
return 549;
|
||
|
break;
|
||
|
case 93:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 94:
|
||
|
return 550;
|
||
|
break;
|
||
|
case 95:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('DROP', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 63;
|
||
|
break;
|
||
|
case 96:
|
||
|
return 551;
|
||
|
break;
|
||
|
case 97:
|
||
|
return 552;
|
||
|
break;
|
||
|
case 98:
|
||
|
return 553;
|
||
|
break;
|
||
|
case 99:
|
||
|
return 554;
|
||
|
break;
|
||
|
case 100:
|
||
|
return 555;
|
||
|
break;
|
||
|
case 101:
|
||
|
return 88;
|
||
|
break;
|
||
|
case 102:
|
||
|
return 556;
|
||
|
break;
|
||
|
case 103:
|
||
|
return 557;
|
||
|
break;
|
||
|
case 104:
|
||
|
return 558;
|
||
|
break;
|
||
|
case 105:
|
||
|
return 559;
|
||
|
break;
|
||
|
case 106:
|
||
|
return 560;
|
||
|
break;
|
||
|
case 107:
|
||
|
return 303;
|
||
|
break;
|
||
|
case 108:
|
||
|
return 561;
|
||
|
break;
|
||
|
case 109:
|
||
|
return 562;
|
||
|
break;
|
||
|
case 110:
|
||
|
return 563;
|
||
|
break;
|
||
|
case 111:
|
||
|
return 564;
|
||
|
break;
|
||
|
case 112:
|
||
|
parser.yy.correlatedSubQuery = true;
|
||
|
return 565;
|
||
|
break;
|
||
|
case 113:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('EXPLAIN', yy_.yylloc);
|
||
|
return 470;
|
||
|
break;
|
||
|
case 114:
|
||
|
return 566;
|
||
|
break;
|
||
|
case 115:
|
||
|
return 567;
|
||
|
break;
|
||
|
case 116:
|
||
|
return 569;
|
||
|
break;
|
||
|
case 117:
|
||
|
return 570;
|
||
|
break;
|
||
|
case 118:
|
||
|
return 300;
|
||
|
break;
|
||
|
case 119:
|
||
|
return 98;
|
||
|
break;
|
||
|
case 120:
|
||
|
return 571;
|
||
|
break;
|
||
|
case 121:
|
||
|
return 572;
|
||
|
break;
|
||
|
case 122:
|
||
|
return 352;
|
||
|
break;
|
||
|
case 123:
|
||
|
return 573;
|
||
|
break;
|
||
|
case 124:
|
||
|
return 574;
|
||
|
break;
|
||
|
case 125:
|
||
|
return 575;
|
||
|
break;
|
||
|
case 126:
|
||
|
return 576;
|
||
|
break;
|
||
|
case 127:
|
||
|
return 577;
|
||
|
break;
|
||
|
case 128:
|
||
|
return 107;
|
||
|
break;
|
||
|
case 129:
|
||
|
return 578;
|
||
|
break;
|
||
|
case 130:
|
||
|
return 579;
|
||
|
break;
|
||
|
case 131:
|
||
|
return 580;
|
||
|
break;
|
||
|
case 132:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 394;
|
||
|
break;
|
||
|
case 133:
|
||
|
return 581;
|
||
|
break;
|
||
|
case 134:
|
||
|
return 315;
|
||
|
break;
|
||
|
case 135:
|
||
|
return 149;
|
||
|
break;
|
||
|
case 136:
|
||
|
return 582;
|
||
|
break;
|
||
|
case 137:
|
||
|
return 583;
|
||
|
break;
|
||
|
case 138:
|
||
|
return 584;
|
||
|
break;
|
||
|
case 139:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('GRANT', yy_.yylloc);
|
||
|
return 401;
|
||
|
break;
|
||
|
case 140:
|
||
|
return 402;
|
||
|
break;
|
||
|
case 141:
|
||
|
return 586;
|
||
|
break;
|
||
|
case 142:
|
||
|
return 587;
|
||
|
break;
|
||
|
case 143:
|
||
|
return 264;
|
||
|
break;
|
||
|
case 144:
|
||
|
return 588;
|
||
|
break;
|
||
|
case 145:
|
||
|
return 590;
|
||
|
break;
|
||
|
case 146:
|
||
|
return 591;
|
||
|
break;
|
||
|
case 147:
|
||
|
return 592;
|
||
|
break;
|
||
|
case 148:
|
||
|
return 593;
|
||
|
break;
|
||
|
case 149:
|
||
|
return 594;
|
||
|
break;
|
||
|
case 150:
|
||
|
return 158;
|
||
|
break;
|
||
|
case 151:
|
||
|
return 595;
|
||
|
break;
|
||
|
case 152:
|
||
|
return 344;
|
||
|
break;
|
||
|
case 153:
|
||
|
return 596;
|
||
|
break;
|
||
|
case 154:
|
||
|
return 597;
|
||
|
break;
|
||
|
case 155:
|
||
|
return 598;
|
||
|
break;
|
||
|
case 156:
|
||
|
this.begin('hdfs');
|
||
|
return 453;
|
||
|
break;
|
||
|
case 157:
|
||
|
return 599;
|
||
|
break;
|
||
|
case 158:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('INSERT', yy_.yylloc);
|
||
|
return 413;
|
||
|
break;
|
||
|
case 159:
|
||
|
return 600;
|
||
|
break;
|
||
|
case 160:
|
||
|
return 353;
|
||
|
break;
|
||
|
case 161:
|
||
|
return 601;
|
||
|
break;
|
||
|
case 162:
|
||
|
return 602;
|
||
|
break;
|
||
|
case 163:
|
||
|
return 603;
|
||
|
break;
|
||
|
case 164:
|
||
|
return 441;
|
||
|
break;
|
||
|
case 165:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('INVALIDATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 153;
|
||
|
break;
|
||
|
case 166:
|
||
|
return 604;
|
||
|
break;
|
||
|
case 167:
|
||
|
return 144;
|
||
|
break;
|
||
|
case 168:
|
||
|
return 605;
|
||
|
break;
|
||
|
case 169:
|
||
|
return 606;
|
||
|
break;
|
||
|
case 170:
|
||
|
return 607;
|
||
|
break;
|
||
|
case 171:
|
||
|
return 608;
|
||
|
break;
|
||
|
case 172:
|
||
|
return 609;
|
||
|
break;
|
||
|
case 173:
|
||
|
return 610;
|
||
|
break;
|
||
|
case 174:
|
||
|
return 611;
|
||
|
break;
|
||
|
case 175:
|
||
|
return 612;
|
||
|
break;
|
||
|
case 176:
|
||
|
return 613;
|
||
|
break;
|
||
|
case 177:
|
||
|
return 614;
|
||
|
break;
|
||
|
case 178:
|
||
|
return 254;
|
||
|
break;
|
||
|
case 179:
|
||
|
return 289;
|
||
|
break;
|
||
|
case 180:
|
||
|
return 615;
|
||
|
break;
|
||
|
case 181:
|
||
|
return 616;
|
||
|
break;
|
||
|
case 182:
|
||
|
return 617;
|
||
|
break;
|
||
|
case 183:
|
||
|
return 618;
|
||
|
break;
|
||
|
case 184:
|
||
|
return 619;
|
||
|
break;
|
||
|
case 185:
|
||
|
return 208;
|
||
|
break;
|
||
|
case 186:
|
||
|
return 620;
|
||
|
break;
|
||
|
case 187:
|
||
|
return 621;
|
||
|
break;
|
||
|
case 188:
|
||
|
return 360;
|
||
|
break;
|
||
|
case 189:
|
||
|
return 304;
|
||
|
break;
|
||
|
case 190:
|
||
|
return 622;
|
||
|
break;
|
||
|
case 191:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('LOAD', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 451;
|
||
|
break;
|
||
|
case 192:
|
||
|
return 623;
|
||
|
break;
|
||
|
case 193:
|
||
|
return 624;
|
||
|
break;
|
||
|
case 194:
|
||
|
this.begin('hdfs');
|
||
|
return 625;
|
||
|
break;
|
||
|
case 195:
|
||
|
return 626;
|
||
|
break;
|
||
|
case 196:
|
||
|
return 627;
|
||
|
break;
|
||
|
case 197:
|
||
|
return 628;
|
||
|
break;
|
||
|
case 198:
|
||
|
return 629;
|
||
|
break;
|
||
|
case 199:
|
||
|
return 631;
|
||
|
break;
|
||
|
case 200:
|
||
|
return 348;
|
||
|
break;
|
||
|
case 201:
|
||
|
return 154;
|
||
|
break;
|
||
|
case 202:
|
||
|
return 632;
|
||
|
break;
|
||
|
case 203:
|
||
|
return 634;
|
||
|
break;
|
||
|
case 204:
|
||
|
return 635;
|
||
|
break;
|
||
|
case 205:
|
||
|
return 636;
|
||
|
break;
|
||
|
case 206:
|
||
|
return 637;
|
||
|
break;
|
||
|
case 207:
|
||
|
return 638;
|
||
|
break;
|
||
|
case 208:
|
||
|
return 639;
|
||
|
break;
|
||
|
case 209:
|
||
|
return 641;
|
||
|
break;
|
||
|
case 210:
|
||
|
return 642;
|
||
|
break;
|
||
|
case 211:
|
||
|
return 643;
|
||
|
break;
|
||
|
case 212:
|
||
|
return 224;
|
||
|
break;
|
||
|
case 213:
|
||
|
return 644;
|
||
|
break;
|
||
|
case 214:
|
||
|
return 146;
|
||
|
break;
|
||
|
case 215:
|
||
|
return 645;
|
||
|
break;
|
||
|
case 216:
|
||
|
return 646;
|
||
|
break;
|
||
|
case 217:
|
||
|
return 647;
|
||
|
break;
|
||
|
case 218:
|
||
|
return 648;
|
||
|
break;
|
||
|
case 219:
|
||
|
return 649;
|
||
|
break;
|
||
|
case 220:
|
||
|
return 870;
|
||
|
break;
|
||
|
case 221:
|
||
|
return 650;
|
||
|
break;
|
||
|
case 222:
|
||
|
return 142;
|
||
|
break;
|
||
|
case 223:
|
||
|
return 651;
|
||
|
break;
|
||
|
case 224:
|
||
|
return 652;
|
||
|
break;
|
||
|
case 225:
|
||
|
return 416;
|
||
|
break;
|
||
|
case 226:
|
||
|
return 653;
|
||
|
break;
|
||
|
case 227:
|
||
|
return 290;
|
||
|
break;
|
||
|
case 228:
|
||
|
return 654;
|
||
|
break;
|
||
|
case 229:
|
||
|
return 655;
|
||
|
break;
|
||
|
case 230:
|
||
|
return 656;
|
||
|
break;
|
||
|
case 231:
|
||
|
return 657;
|
||
|
break;
|
||
|
case 232:
|
||
|
return 658;
|
||
|
break;
|
||
|
case 233:
|
||
|
return 659;
|
||
|
break;
|
||
|
case 234:
|
||
|
return 444;
|
||
|
break;
|
||
|
case 235:
|
||
|
return 291;
|
||
|
break;
|
||
|
case 236:
|
||
|
return 51;
|
||
|
break;
|
||
|
case 237:
|
||
|
return 256;
|
||
|
break;
|
||
|
case 238:
|
||
|
return 71;
|
||
|
break;
|
||
|
case 239:
|
||
|
return 660;
|
||
|
break;
|
||
|
case 240:
|
||
|
return 661;
|
||
|
break;
|
||
|
case 241:
|
||
|
return 662;
|
||
|
break;
|
||
|
case 242:
|
||
|
return 663;
|
||
|
break;
|
||
|
case 243:
|
||
|
return 664;
|
||
|
break;
|
||
|
case 244:
|
||
|
return 665;
|
||
|
break;
|
||
|
case 245:
|
||
|
return 666;
|
||
|
break;
|
||
|
case 246:
|
||
|
return 667;
|
||
|
break;
|
||
|
case 247:
|
||
|
return 668;
|
||
|
break;
|
||
|
case 248:
|
||
|
return 669;
|
||
|
break;
|
||
|
case 249:
|
||
|
return 670;
|
||
|
break;
|
||
|
case 250:
|
||
|
return 349;
|
||
|
break;
|
||
|
case 251:
|
||
|
return 253;
|
||
|
break;
|
||
|
case 252:
|
||
|
return 671;
|
||
|
break;
|
||
|
case 253:
|
||
|
return 672;
|
||
|
break;
|
||
|
case 254:
|
||
|
return 390;
|
||
|
break;
|
||
|
case 255:
|
||
|
return 50;
|
||
|
break;
|
||
|
case 256:
|
||
|
return 292;
|
||
|
break;
|
||
|
case 257:
|
||
|
return 673;
|
||
|
break;
|
||
|
case 258:
|
||
|
return 674;
|
||
|
break;
|
||
|
case 259:
|
||
|
return 70;
|
||
|
break;
|
||
|
case 260:
|
||
|
return 675;
|
||
|
break;
|
||
|
case 261:
|
||
|
return 676;
|
||
|
break;
|
||
|
case 262:
|
||
|
return 677;
|
||
|
break;
|
||
|
case 263:
|
||
|
return 678;
|
||
|
break;
|
||
|
case 264:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('REFRESH', yy_.yylloc);
|
||
|
return 147;
|
||
|
break;
|
||
|
case 265:
|
||
|
return 679;
|
||
|
break;
|
||
|
case 266:
|
||
|
return 680;
|
||
|
break;
|
||
|
case 267:
|
||
|
return 681;
|
||
|
break;
|
||
|
case 268:
|
||
|
return 682;
|
||
|
break;
|
||
|
case 269:
|
||
|
return 683;
|
||
|
break;
|
||
|
case 270:
|
||
|
return 684;
|
||
|
break;
|
||
|
case 271:
|
||
|
return 685;
|
||
|
break;
|
||
|
case 272:
|
||
|
return 686;
|
||
|
break;
|
||
|
case 273:
|
||
|
return 687;
|
||
|
break;
|
||
|
case 274:
|
||
|
return 688;
|
||
|
break;
|
||
|
case 275:
|
||
|
return 56;
|
||
|
break;
|
||
|
case 276:
|
||
|
return 689;
|
||
|
break;
|
||
|
case 277:
|
||
|
return 73;
|
||
|
break;
|
||
|
case 278:
|
||
|
return 690;
|
||
|
break;
|
||
|
case 279:
|
||
|
return 691;
|
||
|
break;
|
||
|
case 280:
|
||
|
return 342;
|
||
|
break;
|
||
|
case 281:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('REVOKE', yy_.yylloc);
|
||
|
return 417;
|
||
|
break;
|
||
|
case 282:
|
||
|
return 692;
|
||
|
break;
|
||
|
case 283:
|
||
|
return 693;
|
||
|
break;
|
||
|
case 284:
|
||
|
return 359;
|
||
|
break;
|
||
|
case 285:
|
||
|
return 694;
|
||
|
break;
|
||
|
case 286:
|
||
|
return 695;
|
||
|
break;
|
||
|
case 287:
|
||
|
return 696;
|
||
|
break;
|
||
|
case 288:
|
||
|
return 106;
|
||
|
break;
|
||
|
case 289:
|
||
|
return 697;
|
||
|
break;
|
||
|
case 290:
|
||
|
return 698;
|
||
|
break;
|
||
|
case 291:
|
||
|
return 699;
|
||
|
break;
|
||
|
case 292:
|
||
|
return 700;
|
||
|
break;
|
||
|
case 293:
|
||
|
return 701;
|
||
|
break;
|
||
|
case 294:
|
||
|
return 702;
|
||
|
break;
|
||
|
case 295:
|
||
|
return 703;
|
||
|
break;
|
||
|
case 296:
|
||
|
return 704;
|
||
|
break;
|
||
|
case 297:
|
||
|
return 705;
|
||
|
break;
|
||
|
case 298:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('SELECT', yy_.yylloc);
|
||
|
return 414;
|
||
|
break;
|
||
|
case 299:
|
||
|
return 706;
|
||
|
break;
|
||
|
case 300:
|
||
|
return 707;
|
||
|
break;
|
||
|
case 301:
|
||
|
return 293;
|
||
|
break;
|
||
|
case 302:
|
||
|
return 103;
|
||
|
break;
|
||
|
case 303:
|
||
|
return 351;
|
||
|
break;
|
||
|
case 304:
|
||
|
return 410;
|
||
|
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 1000;
|
||
|
break;
|
||
|
case 307:
|
||
|
return 708;
|
||
|
break;
|
||
|
case 308:
|
||
|
return 709;
|
||
|
break;
|
||
|
case 309:
|
||
|
return 710;
|
||
|
break;
|
||
|
case 310:
|
||
|
return 711;
|
||
|
break;
|
||
|
case 311:
|
||
|
return 268;
|
||
|
break;
|
||
|
case 312:
|
||
|
return 712;
|
||
|
break;
|
||
|
case 313:
|
||
|
return 713;
|
||
|
break;
|
||
|
case 314:
|
||
|
return 714;
|
||
|
break;
|
||
|
case 315:
|
||
|
return 715;
|
||
|
break;
|
||
|
case 316:
|
||
|
return 716;
|
||
|
break;
|
||
|
case 317:
|
||
|
return 717;
|
||
|
break;
|
||
|
case 318:
|
||
|
return 66;
|
||
|
break;
|
||
|
case 319:
|
||
|
return 287;
|
||
|
break;
|
||
|
case 320:
|
||
|
return 721;
|
||
|
break;
|
||
|
case 321:
|
||
|
return 722;
|
||
|
break;
|
||
|
case 322:
|
||
|
return 723;
|
||
|
break;
|
||
|
case 323:
|
||
|
return 724;
|
||
|
break;
|
||
|
case 324:
|
||
|
return 725;
|
||
|
break;
|
||
|
case 325:
|
||
|
return 726;
|
||
|
break;
|
||
|
case 326:
|
||
|
return 343;
|
||
|
break;
|
||
|
case 327:
|
||
|
return 728;
|
||
|
break;
|
||
|
case 328:
|
||
|
return 729;
|
||
|
break;
|
||
|
case 329:
|
||
|
return 730;
|
||
|
break;
|
||
|
case 330:
|
||
|
return 129;
|
||
|
break;
|
||
|
case 331:
|
||
|
return 731;
|
||
|
break;
|
||
|
case 332:
|
||
|
return 732;
|
||
|
break;
|
||
|
case 333:
|
||
|
return 101;
|
||
|
break;
|
||
|
case 334:
|
||
|
return 301;
|
||
|
break;
|
||
|
case 335:
|
||
|
return 294;
|
||
|
break;
|
||
|
case 336:
|
||
|
return 733;
|
||
|
break;
|
||
|
case 337:
|
||
|
return 734;
|
||
|
break;
|
||
|
case 338:
|
||
|
return 735;
|
||
|
break;
|
||
|
case 339:
|
||
|
return 736;
|
||
|
break;
|
||
|
case 340:
|
||
|
return 737;
|
||
|
break;
|
||
|
case 341:
|
||
|
return 57;
|
||
|
break;
|
||
|
case 342:
|
||
|
return 738;
|
||
|
break;
|
||
|
case 343:
|
||
|
return 739;
|
||
|
break;
|
||
|
case 344:
|
||
|
return 740;
|
||
|
break;
|
||
|
case 345:
|
||
|
return 741;
|
||
|
break;
|
||
|
case 346:
|
||
|
return 742;
|
||
|
break;
|
||
|
case 347:
|
||
|
return 743;
|
||
|
break;
|
||
|
case 348:
|
||
|
return 744;
|
||
|
break;
|
||
|
case 349:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('TRUNCATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 391;
|
||
|
break;
|
||
|
case 350:
|
||
|
return 745;
|
||
|
break;
|
||
|
case 351:
|
||
|
return 976;
|
||
|
break;
|
||
|
case 352:
|
||
|
return 109;
|
||
|
break;
|
||
|
case 353:
|
||
|
return 746;
|
||
|
break;
|
||
|
case 354:
|
||
|
return 747;
|
||
|
break;
|
||
|
case 355:
|
||
|
return 872;
|
||
|
break;
|
||
|
case 356:
|
||
|
return 748;
|
||
|
break;
|
||
|
case 357:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 1015;
|
||
|
break;
|
||
|
case 358:
|
||
|
return 347;
|
||
|
break;
|
||
|
case 359:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('UPSERT', yy_.yylloc);
|
||
|
return 440;
|
||
|
break;
|
||
|
case 360:
|
||
|
return 411;
|
||
|
break;
|
||
|
case 361:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('USE', yy_.yylloc);
|
||
|
return 1029;
|
||
|
break;
|
||
|
case 362:
|
||
|
return 750;
|
||
|
break;
|
||
|
case 363:
|
||
|
return 751;
|
||
|
break;
|
||
|
case 364:
|
||
|
return 752;
|
||
|
break;
|
||
|
case 365:
|
||
|
return 275;
|
||
|
break;
|
||
|
case 366:
|
||
|
return 755;
|
||
|
break;
|
||
|
case 367:
|
||
|
return 756;
|
||
|
break;
|
||
|
case 368:
|
||
|
return 760;
|
||
|
break;
|
||
|
case 369:
|
||
|
return 761;
|
||
|
break;
|
||
|
case 370:
|
||
|
return 141;
|
||
|
break;
|
||
|
case 371:
|
||
|
return 762;
|
||
|
break;
|
||
|
case 372:
|
||
|
return 763;
|
||
|
break;
|
||
|
case 373:
|
||
|
return 764;
|
||
|
break;
|
||
|
case 374:
|
||
|
return 765;
|
||
|
break;
|
||
|
case 375:
|
||
|
return 766;
|
||
|
break;
|
||
|
case 376:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('WITH', yy_.yylloc);
|
||
|
return 306;
|
||
|
break;
|
||
|
case 377:
|
||
|
return 767;
|
||
|
break;
|
||
|
case 378:
|
||
|
return 768;
|
||
|
break;
|
||
|
case 379:
|
||
|
this.begin('hdfs');
|
||
|
return 206;
|
||
|
break;
|
||
|
case 380:
|
||
|
return 53;
|
||
|
break;
|
||
|
case 381:
|
||
|
return 657;
|
||
|
break;
|
||
|
case 382:
|
||
|
return 359;
|
||
|
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 501;
|
||
|
break;
|
||
|
case 389:
|
||
|
return 446;
|
||
|
break;
|
||
|
case 390:
|
||
|
return 445;
|
||
|
break;
|
||
|
case 391:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'appx_median';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 482;
|
||
|
break;
|
||
|
case 392:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'avg';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 492;
|
||
|
break;
|
||
|
case 393:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'cast';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 508;
|
||
|
break;
|
||
|
case 394:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'count';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 523;
|
||
|
break;
|
||
|
case 395:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'extract';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 568;
|
||
|
break;
|
||
|
case 396:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'group_concat';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 585;
|
||
|
break;
|
||
|
case 397:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'left';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 956;
|
||
|
break;
|
||
|
case 398:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'max';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 630;
|
||
|
break;
|
||
|
case 399:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'min';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 633;
|
||
|
break;
|
||
|
case 400:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'ndv';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 640;
|
||
|
break;
|
||
|
case 401:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 718;
|
||
|
break;
|
||
|
case 402:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 719;
|
||
|
break;
|
||
|
case 403:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 720;
|
||
|
break;
|
||
|
case 404:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'sum';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 727;
|
||
|
break;
|
||
|
case 405:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'var_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 753;
|
||
|
break;
|
||
|
case 406:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'var_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 754;
|
||
|
break;
|
||
|
case 407:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 757;
|
||
|
break;
|
||
|
case 408:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 758;
|
||
|
break;
|
||
|
case 409:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 759;
|
||
|
break;
|
||
|
case 410:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'cume_dist';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 411:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'dense_rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 412:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'first_value';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 413:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'lag';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 414:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'last_value';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 415:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'lead';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 416:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'ntile';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 417:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'percent_rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 418:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 419:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'row_number';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 478;
|
||
|
break;
|
||
|
case 420:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'system';
|
||
|
return 923;
|
||
|
break;
|
||
|
case 421:
|
||
|
return 361;
|
||
|
break;
|
||
|
case 422:
|
||
|
return 361;
|
||
|
break;
|
||
|
case 423:
|
||
|
return 749;
|
||
|
break;
|
||
|
case 424:
|
||
|
return 468;
|
||
|
break;
|
||
|
case 425:
|
||
|
parser.yy.cursorFound = true;
|
||
|
return 27;
|
||
|
break;
|
||
|
case 426:
|
||
|
parser.yy.cursorFound = true;
|
||
|
return 771;
|
||
|
break;
|
||
|
case 427:
|
||
|
return 589;
|
||
|
break;
|
||
|
case 428:
|
||
|
parser.addFileLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 981;
|
||
|
break;
|
||
|
case 429:
|
||
|
this.popState();
|
||
|
return 982;
|
||
|
break;
|
||
|
case 430:
|
||
|
return 458;
|
||
|
break;
|
||
|
case 431:
|
||
|
return 479;
|
||
|
break;
|
||
|
case 432:
|
||
|
return 653;
|
||
|
break;
|
||
|
case 433:
|
||
|
return 54;
|
||
|
break;
|
||
|
case 434:
|
||
|
return 237;
|
||
|
break;
|
||
|
case 435:
|
||
|
return 238;
|
||
|
break;
|
||
|
case 436:
|
||
|
return 277;
|
||
|
break;
|
||
|
case 437:
|
||
|
return 277;
|
||
|
break;
|
||
|
case 438:
|
||
|
return 277;
|
||
|
break;
|
||
|
case 439:
|
||
|
return 277;
|
||
|
break;
|
||
|
case 440:
|
||
|
return 277;
|
||
|
break;
|
||
|
case 441:
|
||
|
return 474;
|
||
|
break;
|
||
|
case 442:
|
||
|
return 473;
|
||
|
break;
|
||
|
case 443:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 444:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 445:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 446:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 447:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 448:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 449:
|
||
|
return 95;
|
||
|
break;
|
||
|
case 450:
|
||
|
return 138;
|
||
|
break;
|
||
|
case 451:
|
||
|
return 341;
|
||
|
break;
|
||
|
case 452:
|
||
|
return 248;
|
||
|
break;
|
||
|
case 453:
|
||
|
return 462;
|
||
|
break;
|
||
|
case 454:
|
||
|
return 769;
|
||
|
break;
|
||
|
case 455:
|
||
|
return 472;
|
||
|
break;
|
||
|
case 456:
|
||
|
return 89;
|
||
|
break;
|
||
|
case 457:
|
||
|
return 91;
|
||
|
break;
|
||
|
case 458:
|
||
|
return 475;
|
||
|
break;
|
||
|
case 459:
|
||
|
return 476;
|
||
|
break;
|
||
|
case 460:
|
||
|
return 469;
|
||
|
break;
|
||
|
case 461:
|
||
|
this.begin('backtickedValue');
|
||
|
return 493;
|
||
|
break;
|
||
|
case 462:
|
||
|
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '`')) {
|
||
|
return 774;
|
||
|
}
|
||
|
return 181;
|
||
|
break;
|
||
|
case 463:
|
||
|
this.popState();
|
||
|
return 493;
|
||
|
break;
|
||
|
case 464:
|
||
|
this.begin('singleQuotedValue');
|
||
|
return 179;
|
||
|
break;
|
||
|
case 465:
|
||
|
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '\'')) {
|
||
|
return 774;
|
||
|
}
|
||
|
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 774;
|
||
|
}
|
||
|
return 181;
|
||
|
break;
|
||
|
case 469:
|
||
|
this.popState();
|
||
|
return 180;
|
||
|
break;
|
||
|
case 470:
|
||
|
return 458;
|
||
|
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;
|