5408 lines
758 KiB
JavaScript
5408 lines
758 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 impalaAutocompleteParser = (function () {
|
||
|
var o = function (k, v, o, l) { for (o = o || {}, l = k.length; l--; o[k[l]] = v)
|
||
|
; return o; }, $V0 = [2, 26, 27, 38, 41, 50, 51, 54, 63, 65, 66, 70, 71, 85, 86, 89, 91, 95, 101, 103, 106, 107, 129, 136, 138, 142, 143, 144, 146, 147, 149, 151, 153, 155, 158, 170, 179, 180, 208, 224, 236, 237, 238, 241, 242, 253, 254, 256, 257, 264, 268, 275, 277, 287, 288, 289, 291, 292, 293, 294, 295, 300, 301, 303, 304, 306, 315, 321, 341, 342, 343, 344, 347, 348, 349, 350, 351, 352, 353, 359, 361, 390, 391, 392, 394, 404, 408, 411, 425, 427, 428, 429, 430, 431, 432, 433, 434, 435, 452, 453, 461, 462, 463, 465, 466, 483, 484, 488, 489, 494, 495, 496, 499, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 796, 839, 1005, 1020, 1034], $V1 = [2, 921], $V2 = [404, 499], $V3 = [2, 710], $V4 = [1, 5], $V5 = [1, 315], $V6 = [1, 423], $V7 = [1, 485], $V8 = [1, 248], $V9 = [1, 269], $Va = [1, 250], $Vb = [1, 18], $Vc = [1, 497], $Vd = [1, 68], $Ve = [1, 329], $Vf = [1, 273], $Vg = [1, 252], $Vh = [1, 50], $Vi = [1, 513], $Vj = [1, 10], $Vk = [1, 11], $Vl = [1, 13], $Vm = [1, 349], $Vn = [1, 312], $Vo = [1, 299], $Vp = [1, 142], $Vq = [1, 346], $Vr = [1, 35], $Vs = [1, 15], $Vt = [1, 237], $Vu = [1, 95], $Vv = [1, 181], $Vw = [1, 230], $Vx = [1, 447], $Vy = [1, 149], $Vz = [1, 41], $VA = [1, 448], $VB = [1, 449], $VC = [1, 166], $VD = [1, 490], $VE = [1, 318], $VF = [1, 111], $VG = [1, 199], $VH = [1, 228], $VI = [1, 32], $VJ = [1, 17], $VK = [1, 19], $VL = [1, 207], $VM = [1, 336], $VN = [1, 265], $VO = [1, 192], $VP = [1, 251], $VQ = [1, 54], $VR = [1, 158], $VS = [1, 322], $VT = [1, 375], $VU = [1, 70], $VV = [1, 333], $VW = [1, 43], $VX = [1, 193], $VY = [1, 249], $VZ = [1, 270], $V_ = [1, 311], $V$ = [1, 351], $V01 = [1, 104], $V11 = [1, 133], $V21 = [1, 350], $V31 = [1, 122], $V41 = [1, 202], $V51 = [1, 425], $V61 = [1, 148], $V71 = [1, 22], $V81 = [1, 16], $V91 = [1, 292], $Va1 = [1, 342], $Vb1 = [1, 168], $Vc1 = [1, 370], $Vd1 = [1, 214], $Ve1 = [1, 264], $Vf1 = [1, 65], $Vg1 = [1, 313], $Vh1 = [1, 136], $Vi1 = [1, 175], $Vj1 = [1, 295], $Vk1 = [1, 368], $Vl1 = [1, 268], $Vm1 = [1, 516], $Vn1 = [1, 103], $Vo1 = [1, 146], $Vp1 = [1, 404], $Vq1 = [1, 480], $Vr1 = [1, 23], $Vs1 = [1, 147], $Vt1 = [1, 198], $Vu1 = [1, 293], $Vv1 = [1, 27], $Vw1 = [1, 82], $Vx1 = [1, 170], $Vy1 = [1, 244], $Vz1 = [1, 309], $VA1 = [1, 182], $VB1 = [1, 153], $VC1 = [1, 154], $VD1 = [1, 314], $VE1 = [1, 371], $VF1 = [1, 529], $VG1 = [1, 240], $VH1 = [1, 462], $VI1 = [1, 528], $VJ1 = [1, 179], $VK1 = [1, 316], $VL1 = [1, 227], $VM1 = [1, 478], $VN1 = [1, 94], $VO1 = [1, 172], $VP1 = [1, 287], $VQ1 = [1, 380], $VR1 = [1, 422], $VS1 = [1, 9], $VT1 = [1, 12], $VU1 = [1, 14], $VV1 = [1, 20], $VW1 = [1, 21], $VX1 = [1, 24], $VY1 = [1, 25], $VZ1 = [1, 26],
|
||
|
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", 404: ";", 408: "SetSpecification_EDIT", 411: "SELECT", 417: "TableExpression_ERROR", 423: "Errors", 425: "ALL", 427: "FULL", 428: "LEFT", 429: "RIGHT", 430: "ANTI", 431: "CROSS", 432: "INNER", 433: "OUTER", 434: "SEMI", 435: "JOIN", 452: "GRANT", 453: "GROUP", 461: "SERVER", 462: "URI", 463: "INSERT", 465: "OPTION", 466: "REVOKE", 483: "UPSERT", 484: "INTO", 487: "OVERWRITE", 488: "SHUFFLE", 489: "NOSHUFFLE", 494: "LOAD", 495: "DATA", 496: "INPATH", 499: "EOF", 503: "REGULAR_IDENTIFIER", 504: "VARIABLE_REFERENCE", 505: "EXPLAIN", 506: "!", 507: "*", 508: "-", 509: "[", 510: "]", 511: "ALLOCATE", 512: "ANALYTIC", 513: "AND", 514: "ANY", 515: "APPX_MEDIAN", 516: "ARE", 517: "ARITHMETIC_OPERATOR", 518: "ARRAY_AGG", 519: "ARRAY_MAX_CARDINALITY", 520: "ASC", 521: "ASENSITIVE", 522: "ASYMMETRIC", 523: "AT", 524: "ATOMIC", 525: "AVG", 526: "BACKTICK", 527: "BEGIN_FRAME", 528: "BEGIN_PARTITION", 529: "BETWEEN", 530: "BIGINT", 531: "BLOB", 532: "BOOLEAN", 533: "BOTH", 534: "BROADCAST", 535: "CACHED", 536: "CALLED", 537: "CARDINALITY", 538: "CASCADE", 539: "CASCADED", 540: "CASE", 541: "CAST", 542: "CHAR", 543: "CHARACTER", 544: "CLOB", 545: "COLLATE", 546: "COLLECT", 547: "COMMIT", 548: "CONDITION", 549: "CONNECT", 550: "CONSTRAINT", 551: "CONTAINS", 552: "CONVERT", 553: "COPY", 554: "CORR", 555: "CORRESPONDING", 556: "COUNT", 557: "COVAR_POP", 558: "COVAR_SAMP", 559: "CUBE", 560: "CURRENT", 561: "CURRENT_DATE", 562: "CURRENT_DEFAULT_TRANSFORM_GROUP", 563: "CURRENT_PATH", 564: "CURRENT_ROLE", 565: "CURRENT_ROW", 566: "CURRENT_SCHEMA", 567: "CURRENT_TIME", 568: "CURRENT_TRANSFORM_GROUP_FOR_TYPE", 569: "CYCLE", 570: "DATABASES", 571: "DEALLOCATE", 572: "DEC", 573: "DECFLOAT", 574: "DECIMAL", 575: "DECLARE", 576: "DEFINE", 577: "DEREF", 578: "DESC", 579: "DETERMINISTIC", 580: "DISCONNECT", 581: "DISTINCT", 582: "DOUBLE", 583: "DYNAMIC", 584: "EACH", 585: "ELEMENT", 586: "ELSE", 587: "EMPTY", 588: "END", 589: "END_FRAME", 590: "END_PARTITION", 591: "EQUALS", 592: "ESCAPE", 593: "EVERY", 594: "EXCEPT", 595: "EXEC", 596: "EXECUTE", 597: "EXISTS", 598: "EXTENDED", 599: "EXTERNAL", 600: "EXTRACT", 601: "FALSE", 602: "FETCH", 603: "FILES", 604: "FILTER", 605: "FIRST", 606: "FLOAT", 607: "FOLLOWING", 608: "FOR", 609: "FOREIGN", 610: "FORMATTED", 611: "FRAME_ROW", 612: "FREE", 613: "FUSION", 614: "GET", 615: "GLOBAL", 616: "GROUP_CONCAT", 617: "GROUPING", 618: "GROUPS", 619: "HAVING", 620: "HDFS_START_QUOTE", 621: "HOLD", 622: "IF", 623: "IGNORE", 62
|
||
|
productions_: [0, [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 1], [16, 2], [16, 1], [16, 1], [4, 1], [4, 1], [4, 1], [4, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 2], [30, 7], [34, 3], [34, 4], [34, 5], [34, 6], [31, 7], [31, 6], [31, 7], [31, 4], [31, 7], [31, 6], [31, 6], [31, 5], [31, 2], [31, 2], [31, 3], [31, 3], [35, 1], [35, 7], [35, 4], [35, 7], [35, 6], [35, 6], [35, 5], [35, 2], [35, 2], [35, 3], [35, 4], [35, 3], [35, 3], [35, 7], [35, 7], [35, 7], [35, 8], [35, 7], [35, 5], [35, 6], [35, 6], [35, 6], [35, 4], [35, 5], [35, 6], [35, 6], [35, 7], [35, 4], [35, 5], [35, 6], [35, 6], [35, 4], [35, 5], [35, 2], [35, 2], [35, 2], [35, 3], [35, 4], [35, 4], [35, 3], [35, 3], [35, 3], [35, 4], [35, 3], [61, 1], [61, 1], [61, 1], [61, 1], [61, 1], [59, 0], [59, 1], [67, 3], [81, 3], [90, 1], [90, 3], [92, 1], [92, 3], [92, 5], [92, 3], [94, 3], [96, 1], [69, 3], [69, 2], [69, 3], [69, 3], [69, 3], [69, 4], [69, 2], [69, 1], [69, 3], [82, 1], [82, 2], [82, 3], [82, 4], [82, 3], [82, 2], [82, 2], [82, 4], [82, 3], [82, 3], [82, 4], [82, 5], [82, 4], [110, 3], [113, 3], [113, 4], [120, 4], [120, 4], [123, 4], [123, 4], [121, 3], [121, 5], [124, 3], [124, 5], [68, 3], [68, 3], [68, 5], [68, 6], [68, 3], [83, 3], [83, 3], [83, 4], [83, 2], [83, 4], [83, 5], [83, 5], [83, 5], [83, 2], [83, 3], [83, 3], [43, 3], [72, 3], [72, 3], [84, 1], [84, 1], [48, 0], [48, 1], [132, 1], [132, 2], [76, 1], [76, 2], [76, 2], [76, 3], [134, 2], [134, 2], [133, 2], [32, 5], [32, 3], [32, 4], [32, 6], [36, 1], [36, 2], [36, 3], [36, 4], [36, 5], [36, 3], [36, 3], [36, 3], [36, 4], [135, 3], [139, 3], [139, 3], [33, 6], [37, 2], [37, 3], [37, 4], [37, 5], [37, 6], [145, 1], [145, 1], [5, 3], [5, 3], [5, 2], [18, 2], [18, 3], [18, 4], [18, 3], [18, 3], [6, 2], [6, 3], [19, 2], [19, 3], [19, 3], [19, 3], [7, 5], [7, 5], [20, 2], [20, 3], [20, 3], [20, 4], [20, 6], [20, 5], [20, 5], [20, 5], [20, 3], [20, 5], [20, 4], [20, 5], [20, 6], [20, 5], [8, 1], [8, 1], [8, 1], [8, 1], [8, 1], [21, 1], [21, 1], [21, 1], [21, 1], [21, 3], [161, 3], [161, 5], [166, 4], [166, 3], [166, 5], [166, 4], [166, 6], [166, 6], [173, 2], [174, 2], [174, 2], [175, 0], [175, 1], [177, 2], [176, 1], [178, 2], [178, 2], [178, 3], [178, 3], [102, 3], [182, 1], [182, 3], [183, 3], [162, 6], [167, 5], [167, 5], [167, 4], [184, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 11], [186, 12], [186, 11], [186, 11], [187, 2], [195, 2], [195, 2], [203, 0], [203, 1], [203, 2], [203, 2], [204, 1], [204, 2], [204, 2], [204, 2], [118, 3], [118, 5], [119, 3], [119, 5], [119, 5], [210, 1], [210, 3], [212, 1], [212, 3], [212, 3], [212, 5], [212, 2], [212, 4], [212, 4], [212, 6], [112, 3], [114, 3], [114, 3], [114, 3], [215, 0], [215, 1], [218, 1], [218, 2], [217, 1], [217, 2], [217, 2], [217, 3], [219, 1], [219, 2], [219, 2], [219, 2], [219, 2], [219, 2], [219, 1], [219, 1], [220, 1], [220, 2], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [214, 1], [216, 1], [216, 1], [216, 1], [227, 4], [230, 3], [233, 4], [233, 4], [228, 6], [231, 3], [234, 6], [234, 4], [234, 6], [234, 5], [229, 4], [232, 3], [235, 4], [243, 1], [243, 3], [244, 1], [244, 2], [244, 3], [244, 3], [244, 5], [245, 4], [246, 5], [246, 4], [246, 4], [246, 4], [246, 3], [246, 3], [249, 1], [249, 3], [250, 1], [250, 2], [250, 3], [250, 3], [250, 5], [251, 2], [251, 2], [251, 1], [251, 1], [240, 1], [240, 1], [211, 2], [213, 1], [213, 2], [213, 2], [221, 2], [225, 2], [188, 0], [188, 1], [255, 3], [255, 3], [255, 5], [255, 3], [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
|
||
|
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 2167:
|
||
|
parser.suggestKeywords(['TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 34:
|
||
|
parser.addDatabaseLocation(_$[$0 - 4], [{ name: $$[$0 - 4] }]);
|
||
|
break;
|
||
|
case 35:
|
||
|
case 196:
|
||
|
case 208:
|
||
|
case 826:
|
||
|
case 1444:
|
||
|
case 2203:
|
||
|
case 2262:
|
||
|
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 423:
|
||
|
case 428:
|
||
|
case 429:
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
break;
|
||
|
case 70:
|
||
|
case 155:
|
||
|
parser.suggestKeywords(['VALUE']);
|
||
|
break;
|
||
|
case 71:
|
||
|
case 156:
|
||
|
case 437:
|
||
|
case 1471:
|
||
|
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 666:
|
||
|
case 2163:
|
||
|
case 2223:
|
||
|
parser.suggestKeywords(['STATS']);
|
||
|
break;
|
||
|
case 79:
|
||
|
case 122:
|
||
|
case 159:
|
||
|
case 462:
|
||
|
case 1411:
|
||
|
case 1415:
|
||
|
case 1419:
|
||
|
case 1454:
|
||
|
case 1455:
|
||
|
case 1500:
|
||
|
case 1503:
|
||
|
case 1610:
|
||
|
case 1655:
|
||
|
case 2253:
|
||
|
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 816:
|
||
|
parser.suggestKeywords(['TO']);
|
||
|
break;
|
||
|
case 93:
|
||
|
case 189:
|
||
|
case 1440:
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 94:
|
||
|
case 407:
|
||
|
parser.suggestKeywords(['PARTITIONS']);
|
||
|
break;
|
||
|
case 111:
|
||
|
parser.suggestIdentifiers(['\'avgSize\'', '\'maxSize\'', '\'numDVs\'', '\'numNulls\'']);
|
||
|
break;
|
||
|
case 125:
|
||
|
case 473:
|
||
|
parser.suggestFileFormats();
|
||
|
break;
|
||
|
case 128:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['WITH REPLICATION =']);
|
||
|
}
|
||
|
break;
|
||
|
case 130:
|
||
|
case 466:
|
||
|
parser.suggestKeywords(['FORMAT']);
|
||
|
break;
|
||
|
case 131:
|
||
|
case 467:
|
||
|
parser.suggestKeywords(['DELIMITED']);
|
||
|
break;
|
||
|
case 132:
|
||
|
case 1885:
|
||
|
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 660:
|
||
|
case 680:
|
||
|
case 684:
|
||
|
case 686:
|
||
|
case 823:
|
||
|
case 1531:
|
||
|
case 2162:
|
||
|
case 2166:
|
||
|
case 2211:
|
||
|
case 2222:
|
||
|
case 2242:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
break;
|
||
|
case 162:
|
||
|
case 675:
|
||
|
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 465:
|
||
|
case 746:
|
||
|
case 747:
|
||
|
case 748:
|
||
|
case 1564:
|
||
|
case 1592:
|
||
|
case 1613:
|
||
|
case 1626:
|
||
|
case 1630:
|
||
|
case 1648:
|
||
|
case 1671:
|
||
|
case 1697:
|
||
|
case 1698:
|
||
|
case 1775:
|
||
|
case 1777:
|
||
|
case 1845:
|
||
|
case 1855:
|
||
|
case 1862:
|
||
|
case 1874:
|
||
|
case 2020:
|
||
|
case 2258:
|
||
|
case 2302:
|
||
|
case 2303:
|
||
|
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 504:
|
||
|
case 513:
|
||
|
case 1574:
|
||
|
case 1941:
|
||
|
parser.suggestKeywords(['SELECT']);
|
||
|
break;
|
||
|
case 191:
|
||
|
case 685:
|
||
|
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 661:
|
||
|
case 671:
|
||
|
case 672:
|
||
|
case 691:
|
||
|
case 905:
|
||
|
case 914:
|
||
|
case 915:
|
||
|
case 2179:
|
||
|
case 2212:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 202:
|
||
|
case 1532:
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 204:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
parser.suggestKeywords(['AUTHORIZATION', 'FUNCTIONS']);
|
||
|
break;
|
||
|
case 206:
|
||
|
case 913:
|
||
|
case 2183:
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
}
|
||
|
break;
|
||
|
case 211:
|
||
|
parser.suggestKeywords(['METADATA']);
|
||
|
break;
|
||
|
case 212:
|
||
|
case 218:
|
||
|
case 227:
|
||
|
case 662:
|
||
|
case 667:
|
||
|
case 697:
|
||
|
case 827:
|
||
|
case 911:
|
||
|
case 1426:
|
||
|
case 2239:
|
||
|
case 2259:
|
||
|
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 665:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['INCREMENTAL']);
|
||
|
break;
|
||
|
case 226:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['STATS']);
|
||
|
break;
|
||
|
case 229:
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0]) {
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
}
|
||
|
break;
|
||
|
case 240:
|
||
|
if ($$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'EXTERNAL TABLE', 'FUNCTION', 'ROLE', 'SCHEMA', 'TABLE', 'VIEW']);
|
||
|
}
|
||
|
break;
|
||
|
case 242:
|
||
|
parser.addNewDatabaseLocation(_$[$0 - 1], [{ name: $$[$0 - 1] }]);
|
||
|
break;
|
||
|
case 243:
|
||
|
case 266:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 245:
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 246:
|
||
|
parser.addNewDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 247:
|
||
|
parser.addNewDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
|
||
|
break;
|
||
|
case 249:
|
||
|
var keywords = [];
|
||
|
if (!$$[$0]) {
|
||
|
keywords.push('LOCATION');
|
||
|
}
|
||
|
if (!$$[$0 - 1] && !$$[$0]) {
|
||
|
keywords.push('COMMENT');
|
||
|
}
|
||
|
if (keywords.length > 0) {
|
||
|
parser.suggestKeywords(keywords);
|
||
|
}
|
||
|
break;
|
||
|
case 279:
|
||
|
var keywords = [];
|
||
|
if (!$$[$0 - 10] && !$$[$0 - 9] && !$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'LIKE', weight: 1 });
|
||
|
keywords.push({ value: 'LIKE PARQUET', weight: 1 });
|
||
|
}
|
||
|
else {
|
||
|
if (!$$[$0 - 9] && !$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'PARTITIONED BY', weight: 12 });
|
||
|
keywords.push({ value: 'PARTITION BY', weight: 12 });
|
||
|
}
|
||
|
if (!$$[$0 - 8] && !$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'SORT BY', weight: 11 });
|
||
|
}
|
||
|
if (!$$[$0 - 7] && !$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'COMMENT', weight: 10 });
|
||
|
}
|
||
|
if (!$$[$0 - 6] && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'ROW FORMAT', weight: 7 });
|
||
|
}
|
||
|
else if ($$[$0 - 6] && $$[$0 - 6].suggestKeywords && !$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 6].suggestKeywords, 7));
|
||
|
}
|
||
|
if (!$$[$0 - 5] && !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'WITH SERDEPROPERTIES', weight: 6 });
|
||
|
}
|
||
|
if (!$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'STORED AS', weight: 5 });
|
||
|
}
|
||
|
if (!$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'LOCATION', weight: 4 });
|
||
|
}
|
||
|
if (!$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'CACHED IN', weight: 3 }, { value: 'UNCACHED', weight: 3 });
|
||
|
}
|
||
|
else if ($$[$0 - 2] && $$[$0 - 2].suggestKeywords && !$$[$0 - 1]) {
|
||
|
keywords = keywords.concat(parser.createWeightedKeywords($$[$0 - 2].suggestKeywords, 3));
|
||
|
}
|
||
|
if (!$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'TBLPROPERTIES', weight: 2 });
|
||
|
}
|
||
|
keywords.push({ value: 'AS', weight: 1 });
|
||
|
}
|
||
|
parser.suggestKeywords(keywords);
|
||
|
break;
|
||
|
case 280:
|
||
|
parser.addNewTableLocation(_$[$0 - 1], $$[$0 - 1], $$[$0]);
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 285:
|
||
|
case 286:
|
||
|
case 1432:
|
||
|
case 1435:
|
||
|
this.$ = [];
|
||
|
break;
|
||
|
case 289:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
parser.suggestKeywords(['PARQUET']);
|
||
|
break;
|
||
|
case 291:
|
||
|
case 607:
|
||
|
case 609:
|
||
|
case 1346:
|
||
|
case 1349:
|
||
|
case 1433:
|
||
|
case 1473:
|
||
|
case 1538:
|
||
|
case 1679:
|
||
|
case 1858:
|
||
|
case 1938:
|
||
|
case 1995:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 292:
|
||
|
case 608:
|
||
|
case 610:
|
||
|
this.$ = $$[$0 - 3];
|
||
|
break;
|
||
|
case 295:
|
||
|
parser.suggestKeywords(['PRIMARY KEY']);
|
||
|
break;
|
||
|
case 296:
|
||
|
case 1430:
|
||
|
case 1566:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 297:
|
||
|
this.$ = $$[$0 - 2].concat($$[$0]);
|
||
|
break;
|
||
|
case 302:
|
||
|
case 304:
|
||
|
case 460:
|
||
|
parser.checkForKeywords($$[$0 - 1]);
|
||
|
break;
|
||
|
case 303:
|
||
|
case 305:
|
||
|
parser.checkForKeywords($$[$0 - 3]);
|
||
|
break;
|
||
|
case 306:
|
||
|
this.$ = $$[$0 - 2];
|
||
|
this.$.type = $$[$0 - 1];
|
||
|
var keywords = [];
|
||
|
if (!$$[$0]['primary']) {
|
||
|
keywords.push('PRIMARY KEY');
|
||
|
}
|
||
|
if (!$$[$0]['encoding']) {
|
||
|
keywords.push('ENCODING');
|
||
|
}
|
||
|
if (!$$[$0]['compression']) {
|
||
|
keywords.push('COMPRESSION');
|
||
|
}
|
||
|
if (!$$[$0]['default']) {
|
||
|
keywords.push('DEFAULT');
|
||
|
}
|
||
|
if (!$$[$0]['block_size']) {
|
||
|
keywords.push('BLOCK_SIZE');
|
||
|
}
|
||
|
if (!$$[$0]['null']) {
|
||
|
keywords.push('NOT NULL');
|
||
|
keywords.push('NULL');
|
||
|
}
|
||
|
if (!$$[$0]['comment']) {
|
||
|
keywords.push('COMMENT');
|
||
|
}
|
||
|
if (keywords.length > 0) {
|
||
|
this.$.suggestKeywords = keywords;
|
||
|
}
|
||
|
break;
|
||
|
case 307:
|
||
|
case 340:
|
||
|
case 346:
|
||
|
case 347:
|
||
|
case 360:
|
||
|
case 363:
|
||
|
case 372:
|
||
|
case 374:
|
||
|
parser.suggestKeywords(parser.getColumnDataTypeKeywords());
|
||
|
break;
|
||
|
case 310:
|
||
|
case 1913:
|
||
|
this.$ = {};
|
||
|
break;
|
||
|
case 312:
|
||
|
this.$ = {};
|
||
|
this.$[$$[$0]] = true;
|
||
|
break;
|
||
|
case 313:
|
||
|
$$[$0 - 1][$$[$0]] = true;
|
||
|
break;
|
||
|
case 318:
|
||
|
this.$ = 'primary';
|
||
|
break;
|
||
|
case 319:
|
||
|
this.$ = 'encoding';
|
||
|
break;
|
||
|
case 320:
|
||
|
this.$ = 'compression';
|
||
|
break;
|
||
|
case 321:
|
||
|
this.$ = 'default';
|
||
|
break;
|
||
|
case 322:
|
||
|
this.$ = 'block_size';
|
||
|
break;
|
||
|
case 323:
|
||
|
case 324:
|
||
|
this.$ = 'null';
|
||
|
break;
|
||
|
case 325:
|
||
|
this.$ = 'comment';
|
||
|
break;
|
||
|
case 327:
|
||
|
parser.suggestKeywords(['NULL']);
|
||
|
break;
|
||
|
case 345:
|
||
|
case 564:
|
||
|
case 575:
|
||
|
case 598:
|
||
|
parser.suggestKeywords(parser.getTypeKeywords());
|
||
|
break;
|
||
|
case 359:
|
||
|
case 362:
|
||
|
parser.suggestKeywords(['COMMENT']);
|
||
|
break;
|
||
|
case 383:
|
||
|
parser.suggestKeywords(['KEY']);
|
||
|
break;
|
||
|
case 390:
|
||
|
case 391:
|
||
|
case 394:
|
||
|
case 420:
|
||
|
case 488:
|
||
|
case 489:
|
||
|
case 493:
|
||
|
case 2021:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
break;
|
||
|
case 395:
|
||
|
case 398:
|
||
|
parser.suggestKeywords(['HASH', 'RANGE']);
|
||
|
break;
|
||
|
case 436:
|
||
|
parser.suggestKeywords(['VALUE', 'VALUES']);
|
||
|
break;
|
||
|
case 438:
|
||
|
case 444:
|
||
|
case 447:
|
||
|
case 903:
|
||
|
parser.suggestFunctions();
|
||
|
break;
|
||
|
case 439:
|
||
|
if ($$[$0].endsWithLessThanOrEqual) {
|
||
|
parser.suggestKeywords(['VALUES']);
|
||
|
}
|
||
|
break;
|
||
|
case 440:
|
||
|
case 443:
|
||
|
case 446:
|
||
|
parser.suggestKeywords(['<', '<=']);
|
||
|
break;
|
||
|
case 441:
|
||
|
case 1386:
|
||
|
case 1389:
|
||
|
parser.suggestKeywords(['VALUES']);
|
||
|
break;
|
||
|
case 472:
|
||
|
case 1573:
|
||
|
parser.suggestKeywords(['AS']);
|
||
|
break;
|
||
|
case 481:
|
||
|
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 485:
|
||
|
this.$ = { suggestKeywords: ['ESCAPED BY'] };
|
||
|
break;
|
||
|
case 487:
|
||
|
case 492:
|
||
|
parser.suggestKeywords(['TERMINATED BY']);
|
||
|
break;
|
||
|
case 497:
|
||
|
case 498:
|
||
|
parser.suggestKeywords(['SERDEPROPERTIES']);
|
||
|
break;
|
||
|
case 506:
|
||
|
parser.commitLocations();
|
||
|
break;
|
||
|
case 508:
|
||
|
case 521:
|
||
|
case 537:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 509:
|
||
|
case 522:
|
||
|
if (!$$[$0 - 6]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 512:
|
||
|
var keywords = [{ value: 'AS', weight: 1 }];
|
||
|
if (!$$[$0 - 1]) {
|
||
|
keywords.push({ value: 'COMMENT', weight: 3 });
|
||
|
}
|
||
|
parser.suggestKeywords(keywords);
|
||
|
break;
|
||
|
case 523:
|
||
|
case 542:
|
||
|
parser.suggestKeywords(['RETURNS']);
|
||
|
break;
|
||
|
case 524:
|
||
|
case 543:
|
||
|
parser.suggestKeywords(['LOCATION']);
|
||
|
break;
|
||
|
case 525:
|
||
|
parser.suggestKeywords(['SYMBOL']);
|
||
|
break;
|
||
|
case 535:
|
||
|
case 653:
|
||
|
parser.suggestKeywords(['FUNCTION']);
|
||
|
break;
|
||
|
case 536:
|
||
|
if (!$$[$0 - 13]) {
|
||
|
parser.suggestKeywords(['IF NOT EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 544:
|
||
|
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 545:
|
||
|
parser.suggestKeywords(['MERGE_FN']);
|
||
|
break;
|
||
|
case 546:
|
||
|
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 565:
|
||
|
parser.suggestKeywords(['...']);
|
||
|
break;
|
||
|
case 600:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
break;
|
||
|
case 604:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['COMMENT']);
|
||
|
}
|
||
|
break;
|
||
|
case 620:
|
||
|
parser.addCommonTableExpressions($$[$0 - 1]);
|
||
|
break;
|
||
|
case 637:
|
||
|
parser.suggestKeywords(['AGGREGATE FUNCTION', 'DATABASE', 'FUNCTION', 'INCREMENTAL STATS', 'ROLE', 'SCHEMA', 'STATS', 'TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 641:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases();
|
||
|
break;
|
||
|
case 642:
|
||
|
parser.suggestKeywords(['CASCADE', 'RESTRICT']);
|
||
|
break;
|
||
|
case 644:
|
||
|
case 649:
|
||
|
case 654:
|
||
|
if (!$$[$0 - 3]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 647:
|
||
|
case 648:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 651:
|
||
|
parser.suggestKeywords(['AGGREGATE']);
|
||
|
break;
|
||
|
case 664:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['INCREMENTAL']);
|
||
|
break;
|
||
|
case 670:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['PARTITION']);
|
||
|
break;
|
||
|
case 674:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestTables({ onlyTables: true });
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 677:
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['PURGE']);
|
||
|
}
|
||
|
break;
|
||
|
case 681:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
parser.suggestTables({ onlyViews: true });
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 682:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 687:
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
break;
|
||
|
case 688:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 692:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['IF EXISTS']);
|
||
|
}
|
||
|
break;
|
||
|
case 695:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
}
|
||
|
break;
|
||
|
case 698:
|
||
|
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 711:
|
||
|
case 922:
|
||
|
case 924:
|
||
|
parser.addStatementLocation(_$[$0]);
|
||
|
break;
|
||
|
case 713:
|
||
|
case 714:
|
||
|
parser.suggestDdlAndDmlKeywords(['EXPLAIN']);
|
||
|
break;
|
||
|
case 715:
|
||
|
parser.suggestKeywords(['INSERT', 'SELECT']);
|
||
|
break;
|
||
|
case 729:
|
||
|
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 1], _$[$0 - 1], $$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3]), _$[$0]);
|
||
|
this.$ = { selectList: $$[$0] };
|
||
|
break;
|
||
|
case 730:
|
||
|
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 731:
|
||
|
parser.selectListNoTableSuggest($$[$0 - 1], $$[$0 - 3]);
|
||
|
break;
|
||
|
case 733:
|
||
|
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 734:
|
||
|
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 735:
|
||
|
parser.addClauseLocation('selectList', parser.firstDefined($$[$0 - 2], _$[$0 - 2], $$[$0 - 3], _$[$0 - 3], $$[$0 - 4], _$[$0 - 4]), _$[$0 - 1]);
|
||
|
break;
|
||
|
case 736:
|
||
|
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 737:
|
||
|
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 738:
|
||
|
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 739:
|
||
|
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 740:
|
||
|
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 749:
|
||
|
case 750:
|
||
|
this.$ = { cursorAtStart: false, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 751:
|
||
|
case 1849:
|
||
|
case 1850:
|
||
|
this.$ = { cursorAtStart: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 757:
|
||
|
parser.suggestKeywords(['JOIN', 'OUTER JOIN']);
|
||
|
break;
|
||
|
case 758:
|
||
|
case 759:
|
||
|
parser.suggestKeywords(['ANTI JOIN', 'INNER JOIN', 'JOIN', 'OUTER JOIN', 'SEMI JOIN']);
|
||
|
break;
|
||
|
case 760:
|
||
|
case 761:
|
||
|
case 762:
|
||
|
case 763:
|
||
|
case 764:
|
||
|
case 765:
|
||
|
case 767:
|
||
|
case 768:
|
||
|
case 769:
|
||
|
case 770:
|
||
|
case 772:
|
||
|
case 773:
|
||
|
case 774:
|
||
|
case 775:
|
||
|
this.$ = { suggestKeywords: ['JOIN'] };
|
||
|
break;
|
||
|
case 766:
|
||
|
this.$ = { suggestKeywords: ['OUTER'] };
|
||
|
break;
|
||
|
case 771:
|
||
|
case 776:
|
||
|
this.$ = { suggestKeywords: ['ANTI', 'INNER', 'OUTER', 'SEMI'] };
|
||
|
break;
|
||
|
case 777:
|
||
|
this.$ = {
|
||
|
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 4], $$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'GROUP BY', weight: 6 }, { value: 'HAVING', weight: 5 }, { value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true, true, true]),
|
||
|
cursorAtEnd: !$$[$0 - 4] && !$$[$0 - 3] && !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
|
||
|
};
|
||
|
break;
|
||
|
case 778:
|
||
|
this.$ = {
|
||
|
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 2], $$[$0 - 1], $$[$0]], [{ value: 'ORDER BY', weight: 4 }, { value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true, true]),
|
||
|
cursorAtEnd: !$$[$0 - 2] && !$$[$0 - 1] && !$$[$0]
|
||
|
};
|
||
|
break;
|
||
|
case 779:
|
||
|
this.$ = {
|
||
|
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0 - 1], $$[$0]], [{ value: 'LIMIT', weight: 3 }, { value: 'OFFSET', weight: 2 }], [true, true]),
|
||
|
cursorAtEnd: !$$[$0 - 1] && !$$[$0]
|
||
|
};
|
||
|
break;
|
||
|
case 780:
|
||
|
this.$ = {
|
||
|
suggestKeywords: parser.getKeywordsForOptionalsLR([$$[$0]], [{ value: 'OFFSET', weight: 2 }], [true]),
|
||
|
cursorAtEnd: !$$[$0]
|
||
|
};
|
||
|
break;
|
||
|
case 795:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'where';
|
||
|
}
|
||
|
break;
|
||
|
case 796:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'group by';
|
||
|
}
|
||
|
break;
|
||
|
case 798:
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.source = 'order by';
|
||
|
}
|
||
|
break;
|
||
|
case 801:
|
||
|
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 802:
|
||
|
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 803:
|
||
|
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 804:
|
||
|
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 805:
|
||
|
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 809:
|
||
|
case 846:
|
||
|
parser.suggestKeywords(['ALL', 'ALTER', 'CREATE', 'DROP', 'INSERT', 'REFRESH', 'ROLE', 'SELECT']);
|
||
|
break;
|
||
|
case 810:
|
||
|
parser.suggestKeywords(['TO GROUP']);
|
||
|
break;
|
||
|
case 811:
|
||
|
case 848:
|
||
|
case 2219:
|
||
|
case 2220:
|
||
|
parser.suggestKeywords(['GROUP']);
|
||
|
break;
|
||
|
case 813:
|
||
|
case 850:
|
||
|
if ($$[$0 - 1].isCreate) {
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 814:
|
||
|
if ($$[$0 - 2].isCreate) {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 817:
|
||
|
case 854:
|
||
|
case 2199:
|
||
|
parser.suggestKeywords(['GROUP', 'ROLE', 'USER']);
|
||
|
break;
|
||
|
case 818:
|
||
|
case 820:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['WITH GRANT OPTION']);
|
||
|
}
|
||
|
break;
|
||
|
case 822:
|
||
|
case 2195:
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 831:
|
||
|
this.$ = { isCreate: true };
|
||
|
break;
|
||
|
case 841:
|
||
|
parser.suggestKeywords(['GRANT OPTION']);
|
||
|
break;
|
||
|
case 842:
|
||
|
parser.suggestKeywords(['OPTION']);
|
||
|
break;
|
||
|
case 847:
|
||
|
parser.suggestKeywords(['FROM GROUP']);
|
||
|
break;
|
||
|
case 851:
|
||
|
if ($$[$0 - 2].isCreate) {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
}
|
||
|
break;
|
||
|
case 853:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
break;
|
||
|
case 859:
|
||
|
this.$ = { selectList: $$[$0] };
|
||
|
break;
|
||
|
case 860:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
this.$.cursorAtEnd = true;
|
||
|
break;
|
||
|
case 861:
|
||
|
parser.selectListNoTableSuggest($$[$0], $$[$0 - 2]);
|
||
|
break;
|
||
|
case 862:
|
||
|
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 868:
|
||
|
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 878:
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 879:
|
||
|
parser.suggestKeywords(['INTO']);
|
||
|
break;
|
||
|
case 880:
|
||
|
case 886:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 881:
|
||
|
if (!$$[$0 - 3]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
break;
|
||
|
case 883:
|
||
|
$$[$0 - 1].owner = 'upsert';
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.owner = 'upsert';
|
||
|
}
|
||
|
break;
|
||
|
case 884:
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (!$$[$0]) {
|
||
|
this.$ = { suggestKeywords: ['PARTITION'] };
|
||
|
}
|
||
|
break;
|
||
|
case 885:
|
||
|
parser.suggestKeywords(['INTO', 'OVERWRITE']);
|
||
|
break;
|
||
|
case 887:
|
||
|
if (!$$[$0 - 4]) {
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
}
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
break;
|
||
|
case 889:
|
||
|
case 890:
|
||
|
$$[$0 - 2].owner = 'insert';
|
||
|
parser.addTablePrimary($$[$0 - 2]);
|
||
|
if (parser.yy.result.suggestColumns) {
|
||
|
parser.yy.result.suggestColumns.owner = 'insert';
|
||
|
}
|
||
|
break;
|
||
|
case 906:
|
||
|
parser.suggestKeywords(['DATA INPATH']);
|
||
|
break;
|
||
|
case 907:
|
||
|
parser.suggestKeywords(['INPATH']);
|
||
|
break;
|
||
|
case 909:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['OVERWRITE INTO TABLE', 'INTO TABLE']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['INTO TABLE']);
|
||
|
}
|
||
|
break;
|
||
|
case 910:
|
||
|
parser.suggestKeywords(['TABLE']);
|
||
|
break;
|
||
|
case 919:
|
||
|
case 920:
|
||
|
return parser.yy.result;
|
||
|
break;
|
||
|
case 921:
|
||
|
parser.prepareNewStatement();
|
||
|
break;
|
||
|
case 923:
|
||
|
case 925:
|
||
|
parser.addStatementLocation(_$[$0 - 3]);
|
||
|
break;
|
||
|
case 943:
|
||
|
parser.suggestDdlAndDmlKeywords();
|
||
|
break;
|
||
|
case 1347:
|
||
|
case 1350:
|
||
|
case 1474:
|
||
|
this.$ = '';
|
||
|
break;
|
||
|
case 1370:
|
||
|
case 1373:
|
||
|
parser.yy.correlatedSubQuery = false;
|
||
|
break;
|
||
|
case 1371:
|
||
|
case 1375:
|
||
|
parser.suggestKeywords(['EXISTS']);
|
||
|
break;
|
||
|
case 1374:
|
||
|
parser.suggestKeywords(['NOT EXISTS']);
|
||
|
break;
|
||
|
case 1385:
|
||
|
case 1387:
|
||
|
case 1388:
|
||
|
case 1390:
|
||
|
parser.suggestKeywords(['<', '<=', '<>', '=', '>', '>=']);
|
||
|
break;
|
||
|
case 1423:
|
||
|
case 1475:
|
||
|
parser.addTableLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
this.$ = { identifierChain: [{ name: $$[$0] }] };
|
||
|
break;
|
||
|
case 1424:
|
||
|
case 1476:
|
||
|
parser.addDatabaseLocation(_$[$0 - 2], [{ name: $$[$0 - 2] }]);
|
||
|
parser.addTableLocation(_$[$0], [{ name: $$[$0 - 2] }, { name: $$[$0] }]);
|
||
|
this.$ = { identifierChain: [{ name: $$[$0 - 2] }, { name: $$[$0] }] };
|
||
|
break;
|
||
|
case 1425:
|
||
|
// 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 1427:
|
||
|
case 1441:
|
||
|
parser.suggestDatabases();
|
||
|
this.$ = { identifierChain: [{ name: $$[$0 - 2] }] };
|
||
|
break;
|
||
|
case 1428:
|
||
|
// You can have statements like 'SELECT ... FROM testTable t, t.|'
|
||
|
parser.suggestTablesOrColumns($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1429:
|
||
|
// 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 1431:
|
||
|
$$[$0 - 1].push($$[$0]);
|
||
|
break;
|
||
|
case 1434:
|
||
|
case 1540:
|
||
|
case 1860:
|
||
|
this.$ = $$[$0 - 2];
|
||
|
break;
|
||
|
case 1436:
|
||
|
this.$ = { name: $$[$0] };
|
||
|
break;
|
||
|
case 1438:
|
||
|
this.$ = [{ name: $$[$0] }];
|
||
|
break;
|
||
|
case 1439:
|
||
|
this.$ = [{ name: $$[$0 - 2] }, { name: $$[$0 - 1] }];
|
||
|
break;
|
||
|
case 1453:
|
||
|
case 1615:
|
||
|
case 1616:
|
||
|
case 1622:
|
||
|
case 1623:
|
||
|
case 1934:
|
||
|
case 2022:
|
||
|
parser.valueExpressionSuggest();
|
||
|
break;
|
||
|
case 1461:
|
||
|
case 1464:
|
||
|
if (!$$[$0]) {
|
||
|
this.$ = { suggestKeywords: ['WITH REPLICATION ='] };
|
||
|
}
|
||
|
break;
|
||
|
case 1466:
|
||
|
case 2180:
|
||
|
parser.suggestKeywords(['IN']);
|
||
|
break;
|
||
|
case 1470:
|
||
|
parser.suggestKeywords(['REPLICATION =']);
|
||
|
break;
|
||
|
case 1477:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ prependDot: true });
|
||
|
break;
|
||
|
case 1478:
|
||
|
parser.suggestTablesOrColumns($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1480:
|
||
|
this.$ = { identifierChain: $$[$0 - 1].identifierChain, alias: $$[$0] };
|
||
|
break;
|
||
|
case 1483:
|
||
|
parser.yy.locations[parser.yy.locations.length - 1].type = 'column';
|
||
|
break;
|
||
|
case 1484:
|
||
|
case 1811:
|
||
|
parser.addAsteriskLocation(_$[$0], $$[$0 - 2].concat({ asterisk: true }));
|
||
|
break;
|
||
|
case 1486:
|
||
|
this.$ = [$$[$0].identifier];
|
||
|
parser.yy.firstChainLocation = parser.addUnknownLocation($$[$0].location, [$$[$0].identifier]);
|
||
|
break;
|
||
|
case 1487:
|
||
|
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 1488:
|
||
|
case 1496:
|
||
|
if ($$[$0].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: [$$[$0].identifier] });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1489:
|
||
|
case 1497:
|
||
|
if ($$[$0].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: $$[$0 - 2].concat([$$[$0].identifier]) });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1492:
|
||
|
parser.suggestColumns({
|
||
|
identifierChain: $$[$0 - 2]
|
||
|
});
|
||
|
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
|
||
|
break;
|
||
|
case 1493:
|
||
|
parser.suggestColumns({
|
||
|
identifierChain: $$[$0 - 4]
|
||
|
});
|
||
|
this.$ = { suggestKeywords: [{ value: '*', weight: 10000 }] };
|
||
|
break;
|
||
|
case 1494:
|
||
|
this.$ = [$$[$0].identifier];
|
||
|
break;
|
||
|
case 1495:
|
||
|
$$[$0 - 2].push($$[$0].identifier);
|
||
|
break;
|
||
|
case 1498:
|
||
|
if ($$[$0 - 2].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: $$[$0 - 4].concat([$$[$0 - 2].identifier]) });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1499:
|
||
|
if ($$[$0 - 2].insideKey) {
|
||
|
parser.suggestKeyValues({ identifierChain: [$$[$0 - 2].identifier] });
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 1501:
|
||
|
parser.suggestColumns({ identifierChain: $$[$0 - 2] });
|
||
|
break;
|
||
|
case 1502:
|
||
|
parser.suggestColumns({ identifierChain: $$[$0 - 4] });
|
||
|
break;
|
||
|
case 1504:
|
||
|
this.$ = { identifier: { name: $$[$0] }, location: _$[$0] };
|
||
|
break;
|
||
|
case 1505:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3], keySet: true }, location: _$[$0 - 3] };
|
||
|
break;
|
||
|
case 1506:
|
||
|
this.$ = { identifier: { name: $$[$0 - 2], keySet: true }, location: _$[$0 - 2] };
|
||
|
break;
|
||
|
case 1507:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3] }, insideKey: true };
|
||
|
break;
|
||
|
case 1508:
|
||
|
this.$ = { identifier: { name: $$[$0 - 3] } };
|
||
|
break;
|
||
|
case 1533:
|
||
|
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 1535:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords([{ value: 'DATABASE', weight: 2 }, { value: 'EXTENDED', weight: 1 }, { value: 'FORMATTED', weight: 1 }]);
|
||
|
}
|
||
|
break;
|
||
|
case 1536:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
|
||
|
}
|
||
|
parser.suggestDatabases();
|
||
|
break;
|
||
|
case 1537:
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords(['EXTENDED', 'FORMATTED']);
|
||
|
}
|
||
|
parser.addDatabaseLocation(_$[$0], [{ name: $$[$0] }]);
|
||
|
break;
|
||
|
case 1543:
|
||
|
parser.addCommonTableExpressions($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1544:
|
||
|
case 1545:
|
||
|
case 1569:
|
||
|
parser.addCommonTableExpressions($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1559:
|
||
|
parser.suggestKeywords(['ALL', 'DISTINCT', 'SELECT']);
|
||
|
break;
|
||
|
case 1560:
|
||
|
parser.suggestKeywords(['ALL', 'DISTINCT']);
|
||
|
break;
|
||
|
case 1567:
|
||
|
this.$ = $$[$0 - 2].concat([$$[$0]]);
|
||
|
break;
|
||
|
case 1571:
|
||
|
parser.addCommonTableExpressions($$[$0 - 4]);
|
||
|
break;
|
||
|
case 1572:
|
||
|
parser.addCteAliasLocation(_$[$0 - 4], $$[$0 - 4]);
|
||
|
$$[$0 - 1].alias = $$[$0 - 4];
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 1579:
|
||
|
case 1580:
|
||
|
parser.addClauseLocation('whereClause', _$[$0 - 1], $$[$0].whereClauseLocation);
|
||
|
parser.addClauseLocation('limitClause', $$[$0].limitClausePreceding || _$[$0 - 1], $$[$0].limitClauseLocation);
|
||
|
break;
|
||
|
case 1581:
|
||
|
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 1582:
|
||
|
// 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 1586:
|
||
|
this.$ = { tableReferenceList: $$[$0] };
|
||
|
break;
|
||
|
case 1587:
|
||
|
case 1867:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({ appendDot: true });
|
||
|
break;
|
||
|
case 1589:
|
||
|
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 1593:
|
||
|
if ($$[$0].suggestFilters) {
|
||
|
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
}
|
||
|
break;
|
||
|
case 1594:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestKeywords(['EXISTS', 'NOT EXISTS']);
|
||
|
parser.suggestFilters({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1597:
|
||
|
this.$ = { valueExpression: $$[$0] };
|
||
|
break;
|
||
|
case 1598:
|
||
|
case 1637:
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1599:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestSelectListAliases();
|
||
|
parser.suggestGroupBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1600:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
parser.suggestGroupBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1627:
|
||
|
if ($$[$0].emptyOrderBy) {
|
||
|
parser.suggestOrderBys({ tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
}
|
||
|
break;
|
||
|
case 1628:
|
||
|
parser.suggestKeywords(['BY']);
|
||
|
parser.suggestOrderBys({ prefix: 'BY', tablePrimaries: parser.yy.latestTablePrimaries.concat() });
|
||
|
break;
|
||
|
case 1632:
|
||
|
this.$ = { emptyOrderBy: false };
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1633:
|
||
|
case 1634:
|
||
|
case 1635:
|
||
|
this.$ = { emptyOrderBy: false };
|
||
|
break;
|
||
|
case 1636:
|
||
|
this.$ = parser.mergeSuggestKeywords($$[$0 - 1], $$[$0]);
|
||
|
break;
|
||
|
case 1639:
|
||
|
this.$ = { emptyOrderBy: true };
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAnalyticFunctions();
|
||
|
parser.suggestSelectListAliases();
|
||
|
break;
|
||
|
case 1640:
|
||
|
this.$ = { suggestKeywords: ['ASC', 'DESC'] };
|
||
|
break;
|
||
|
case 1643:
|
||
|
this.$ = { suggestKeywords: ['NULLS FIRST', 'NULLS LAST'] };
|
||
|
break;
|
||
|
case 1646:
|
||
|
parser.suggestKeywords(['FIRST', 'LAST']);
|
||
|
break;
|
||
|
case 1653:
|
||
|
parser.addColumnLocation($$[$0 - 1].location, [$$[$0 - 1].identifier]);
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 1659:
|
||
|
case 1664:
|
||
|
parser.suggestFunctions({ types: ['BIGINT'] });
|
||
|
break;
|
||
|
case 1660:
|
||
|
case 1665:
|
||
|
delete parser.yy.result.suggestColumns;
|
||
|
break;
|
||
|
case 1669:
|
||
|
case 1670:
|
||
|
// verifyType($$[$0], 'BOOLEAN');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1672:
|
||
|
// verifyType($$[$0], 'NUMBER');
|
||
|
this.$ = $$[$0];
|
||
|
$$[$0].types = ['NUMBER'];
|
||
|
break;
|
||
|
case 1673:
|
||
|
case 1674:
|
||
|
case 1675:
|
||
|
case 1676:
|
||
|
case 1677:
|
||
|
case 1684:
|
||
|
case 1685:
|
||
|
case 1686:
|
||
|
case 1687:
|
||
|
case 1688:
|
||
|
case 1689:
|
||
|
case 1695:
|
||
|
case 1696:
|
||
|
case 1717:
|
||
|
case 1771:
|
||
|
case 1772:
|
||
|
case 1834:
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1678:
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
// clear correlated flag after completed sub-query (set by lexer)
|
||
|
parser.yy.correlatedSubQuery = false;
|
||
|
break;
|
||
|
case 1680:
|
||
|
case 1681:
|
||
|
case 1682:
|
||
|
case 1683:
|
||
|
parser.addColRefToVariableIfExists($$[$0 - 2], $$[$0]);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1690:
|
||
|
case 1691:
|
||
|
// verifyType($$[$0-2], 'BOOLEAN');
|
||
|
// verifyType($$[$0], 'BOOLEAN');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1692:
|
||
|
case 1693:
|
||
|
case 1694:
|
||
|
// verifyType($$[$0-2], 'NUMBER');
|
||
|
// verifyType($$[$0], 'NUMBER');
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1700:
|
||
|
parser.suggestKeywords(['BETWEEN', 'EXISTS', 'IN', 'ILIKE', 'IREGEXP', 'LIKE', 'REGEXP', 'RLIKE']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1701:
|
||
|
case 1703:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1702:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.suggestKeywords(['EXISTS']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1704:
|
||
|
parser.suggestFunctions({ types: ['BOOLEAN'] });
|
||
|
parser.suggestColumns({ types: ['BOOLEAN'] });
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1705:
|
||
|
this.$ = { types: ['T'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1706:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 1707:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions('NUMBER');
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1708:
|
||
|
parser.suggestFunctions({ types: ['NUMBER'] });
|
||
|
parser.suggestColumns({ types: ['NUMBER'] });
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1709:
|
||
|
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 1710:
|
||
|
var keywords = ['FALSE', 'NULL', 'TRUE', 'DISTINCT FROM', 'UNKNOWN'];
|
||
|
parser.suggestKeywords(keywords);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1711:
|
||
|
parser.suggestKeywords(['FROM']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1712:
|
||
|
case 1713:
|
||
|
case 1714:
|
||
|
parser.suggestKeywords(['NOT']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1715:
|
||
|
parser.valueExpressionSuggest($$[$0 - 5], $$[$0 - 3] ? 'IS NOT DISTINCT FROM' : 'IS DISTINCT FROM');
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1716:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1718:
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 1719:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1720:
|
||
|
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1721:
|
||
|
case 1722:
|
||
|
case 1723:
|
||
|
parser.valueExpressionSuggest($$[$0], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1724:
|
||
|
case 1725:
|
||
|
case 1726:
|
||
|
case 1727:
|
||
|
if (!$$[$0 - 2].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0].types);
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1728:
|
||
|
case 1730:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1729:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: true };
|
||
|
break;
|
||
|
case 1731:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, endsWithLessThanOrEqual: $$[$0 - 1] === '<=' };
|
||
|
break;
|
||
|
case 1732:
|
||
|
case 1733:
|
||
|
case 1734:
|
||
|
case 1735:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1736:
|
||
|
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 1737:
|
||
|
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 1738:
|
||
|
case 1739:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 5].suggestFilters };
|
||
|
break;
|
||
|
case 1740:
|
||
|
case 1741:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 4].suggestFilters };
|
||
|
break;
|
||
|
case 1742:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 3].suggestFilters };
|
||
|
break;
|
||
|
case 1743:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1744:
|
||
|
case 1748:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['AND']);
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 1745:
|
||
|
parser.valueExpressionSuggest($$[$0 - 3], $$[$0 - 2] + ' ' + $$[$0 - 1]);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1746:
|
||
|
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 1747:
|
||
|
if ($$[$0 - 2].types[0] === $$[$0].types[0] && !$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
}
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1749:
|
||
|
parser.valueExpressionSuggest($$[$0 - 2], $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].types);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1750:
|
||
|
case 1752:
|
||
|
case 1754:
|
||
|
case 1756:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true, suggestFilters: true };
|
||
|
break;
|
||
|
case 1751:
|
||
|
case 1755:
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1753:
|
||
|
case 1757:
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1758:
|
||
|
case 1759:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
this.$ = { types: ['NUMBER'], typeSet: true };
|
||
|
break;
|
||
|
case 1760:
|
||
|
case 1761:
|
||
|
case 1762:
|
||
|
if (!$$[$0 - 2].typeSet) {
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
parser.addColRefIfExists($$[$0]);
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1763:
|
||
|
case 1764:
|
||
|
case 1765:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1]);
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
this.$ = { types: ['NUMBER'], typeSet: true };
|
||
|
break;
|
||
|
case 1766:
|
||
|
case 1767:
|
||
|
case 1768:
|
||
|
if (!$$[$0].typeSet) {
|
||
|
parser.applyTypeToSuggestions(['NUMBER']);
|
||
|
parser.addColRefIfExists($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: ['NUMBER'], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 1769:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 1770:
|
||
|
this.$ = { types: ['BOOLEAN'], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 1773:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0]);
|
||
|
parser.applyTypeToSuggestions(['STRING']);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1774:
|
||
|
parser.valueExpressionSuggest(undefined, $$[$0 - 1] + ' ' + $$[$0]);
|
||
|
parser.applyTypeToSuggestions(['STRING']);
|
||
|
this.$ = { types: ['BOOLEAN'], typeSet: true };
|
||
|
break;
|
||
|
case 1776:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1778:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 1779:
|
||
|
this.$ = $$[$0];
|
||
|
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
|
||
|
break;
|
||
|
case 1780:
|
||
|
this.$ = { types: ['T'], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 1781:
|
||
|
case 2068:
|
||
|
case 2073:
|
||
|
case 2074:
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 1782:
|
||
|
case 1784:
|
||
|
$$[$0].position = 1;
|
||
|
break;
|
||
|
case 1783:
|
||
|
$$[$0].position = $$[$0 - 2].position + 1;
|
||
|
this.$ = $$[$0];
|
||
|
break;
|
||
|
case 1785:
|
||
|
$$[$0 - 2].position += 1;
|
||
|
break;
|
||
|
case 1786:
|
||
|
$$[$0 - 2].position = 1;
|
||
|
break;
|
||
|
case 1787:
|
||
|
$$[$0 - 4].position += 1;
|
||
|
break;
|
||
|
case 1788:
|
||
|
parser.valueExpressionSuggest();
|
||
|
$$[$0 - 2].position += 1;
|
||
|
break;
|
||
|
case 1789:
|
||
|
parser.valueExpressionSuggest();
|
||
|
$$[$0 - 4].position += 1;
|
||
|
break;
|
||
|
case 1790:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1791:
|
||
|
case 1792:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { cursorAtStart: true, position: 1 };
|
||
|
break;
|
||
|
case 1793:
|
||
|
case 1794:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { position: 2 };
|
||
|
break;
|
||
|
case 1798:
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0].chain };
|
||
|
break;
|
||
|
case 1799:
|
||
|
// 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 1800:
|
||
|
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 1802:
|
||
|
this.$ = { types: ['NULL'] };
|
||
|
break;
|
||
|
case 1803:
|
||
|
this.$ = { types: ['TIMESTAMP'] };
|
||
|
break;
|
||
|
case 1805:
|
||
|
if ($$[$0].suggestKeywords) {
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0], suggestKeywords: $$[$0].suggestKeywords };
|
||
|
}
|
||
|
else {
|
||
|
this.$ = { types: ['COLREF'], columnReference: $$[$0] };
|
||
|
}
|
||
|
break;
|
||
|
case 1806:
|
||
|
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 1807:
|
||
|
case 1982:
|
||
|
case 1983:
|
||
|
parser.addFunctionLocation(_$[$0 - 1], $$[$0 - 1]);
|
||
|
if ($$[$0].position) {
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 1], $$[$0].position);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 1]) };
|
||
|
break;
|
||
|
case 1810:
|
||
|
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 1814:
|
||
|
parser.suggestKeywords(['DAYS', 'HOURS', 'MICROSECONDS', 'MILLISECONDS', 'MINUTES', 'MONTHS', 'NANOSECONDS', 'SECONDS', 'WEEKS', 'YEARS']);
|
||
|
break;
|
||
|
case 1819:
|
||
|
parser.suggestValues($$[$0]);
|
||
|
break;
|
||
|
case 1820:
|
||
|
this.$ = { types: ['NUMBER'] };
|
||
|
break;
|
||
|
case 1826:
|
||
|
case 1828:
|
||
|
this.$ = $$[$0 - 1] + $$[$0];
|
||
|
break;
|
||
|
case 1827:
|
||
|
this.$ = $$[$0 - 2] + $$[$0 - 1] + $$[$0];
|
||
|
break;
|
||
|
case 1832:
|
||
|
case 1833:
|
||
|
if (/\$\{[^}]*\}/.test($$[$0])) {
|
||
|
parser.addVariableLocation(_$[$0], $$[$0]);
|
||
|
this.$ = { types: ['STRING'], columnReference: [{ name: $$[$0] }] };
|
||
|
}
|
||
|
else {
|
||
|
this.$ = { types: ['STRING'] };
|
||
|
}
|
||
|
break;
|
||
|
case 1835:
|
||
|
this.$ = { partialQuote: '\'', missingEndQuote: parser.yy.missingEndQuote };
|
||
|
break;
|
||
|
case 1836:
|
||
|
this.$ = { partialQuote: '"', missingEndQuote: parser.yy.missingEndQuote };
|
||
|
break;
|
||
|
case 1841:
|
||
|
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 1842:
|
||
|
parser.addAsteriskLocation(_$[$0], [{ asterisk: true }]);
|
||
|
this.$ = { asterisk: true };
|
||
|
break;
|
||
|
case 1843:
|
||
|
if ($$[$0]) {
|
||
|
parser.addColumnAliasLocation($$[$0].location, $$[$0].alias, _$[$0 - 1]);
|
||
|
}
|
||
|
break;
|
||
|
case 1844:
|
||
|
parser.suggestFunctions();
|
||
|
parser.suggestColumns();
|
||
|
parser.addColumnAliasLocation(_$[$0], $$[$0], _$[$0 - 2]);
|
||
|
this.$ = { suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 1846:
|
||
|
this.$ = [$$[$0]];
|
||
|
break;
|
||
|
case 1847:
|
||
|
$$[$0 - 2].push($$[$0]);
|
||
|
break;
|
||
|
case 1852:
|
||
|
parser.checkForSelectListKeywords($$[$0 - 2]);
|
||
|
break;
|
||
|
case 1853:
|
||
|
parser.checkForSelectListKeywords($$[$0 - 3]);
|
||
|
break;
|
||
|
case 1854:
|
||
|
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestTables: true, suggestDatabases: true, suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true };
|
||
|
break;
|
||
|
case 1856:
|
||
|
case 1857:
|
||
|
case 1859:
|
||
|
this.$ = { suggestKeywords: parser.getSelectListKeywords(), suggestFunctions: true, suggestColumns: true, suggestAggregateFunctions: true, };
|
||
|
break;
|
||
|
case 1870:
|
||
|
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 1877:
|
||
|
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 1878:
|
||
|
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 1879:
|
||
|
this.$ = { joinType: $$[$0 - 1] };
|
||
|
break;
|
||
|
case 1880:
|
||
|
this.$ = { joinType: $$[$0 - 2] };
|
||
|
break;
|
||
|
case 1884:
|
||
|
if ($$[$0 - 3].suggestKeywords) {
|
||
|
parser.suggestKeywords($$[$0 - 3].suggestKeywords);
|
||
|
}
|
||
|
break;
|
||
|
case 1888:
|
||
|
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 1893:
|
||
|
this.$ = 'JOIN';
|
||
|
break;
|
||
|
case 1894:
|
||
|
this.$ = 'ANTI JOIN';
|
||
|
break;
|
||
|
case 1895:
|
||
|
this.$ = 'CROSS JOIN';
|
||
|
break;
|
||
|
case 1896:
|
||
|
this.$ = 'INNER JOIN';
|
||
|
break;
|
||
|
case 1897:
|
||
|
this.$ = 'OUTER JOIN';
|
||
|
break;
|
||
|
case 1898:
|
||
|
this.$ = 'SEMI JOIN';
|
||
|
break;
|
||
|
case 1899:
|
||
|
this.$ = 'FULL JOIN';
|
||
|
break;
|
||
|
case 1900:
|
||
|
this.$ = 'FULL OUTER JOIN';
|
||
|
break;
|
||
|
case 1901:
|
||
|
this.$ = 'LEFT JOIN';
|
||
|
break;
|
||
|
case 1902:
|
||
|
this.$ = 'LEFT ANTI JOIN';
|
||
|
break;
|
||
|
case 1903:
|
||
|
this.$ = 'LEFT INNER JOIN';
|
||
|
break;
|
||
|
case 1904:
|
||
|
this.$ = 'LEFT OUTER JOIN';
|
||
|
break;
|
||
|
case 1905:
|
||
|
this.$ = 'LEFT SEMI JOIN';
|
||
|
break;
|
||
|
case 1906:
|
||
|
this.$ = 'RIGHT JOIN';
|
||
|
break;
|
||
|
case 1907:
|
||
|
this.$ = 'RIGHT ANTI JOIN';
|
||
|
break;
|
||
|
case 1908:
|
||
|
case 1909:
|
||
|
this.$ = 'RIGHT OUTER JOIN';
|
||
|
break;
|
||
|
case 1910:
|
||
|
this.$ = 'RIGHT SEMI JOIN';
|
||
|
break;
|
||
|
case 1911:
|
||
|
this.$ = { noJoinCondition: true, suggestKeywords: ['ON', 'USING'] };
|
||
|
break;
|
||
|
case 1912:
|
||
|
this.$ = { valueExpression: $$[$0] };
|
||
|
break;
|
||
|
case 1917:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestJoinConditions({ prependOn: false });
|
||
|
break;
|
||
|
case 1918:
|
||
|
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 1919:
|
||
|
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 1920:
|
||
|
if ($$[$0 - 1]) {
|
||
|
parser.addTableAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias, $$[$0 - 2].identifierChain);
|
||
|
}
|
||
|
break;
|
||
|
case 1921:
|
||
|
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 1922:
|
||
|
if ($$[$0 - 1]) {
|
||
|
parser.addTablePrimary({ subQueryAlias: $$[$0 - 1].alias });
|
||
|
parser.addSubqueryAliasLocation($$[$0 - 1].location, $$[$0 - 1].alias);
|
||
|
}
|
||
|
break;
|
||
|
case 1929:
|
||
|
this.$ = { suggestKeywords: ['REPEATABLE()'] };
|
||
|
break;
|
||
|
case 1931:
|
||
|
parser.suggestKeywords(['SYSTEM()']);
|
||
|
break;
|
||
|
case 1936:
|
||
|
parser.pushQueryState();
|
||
|
break;
|
||
|
case 1937:
|
||
|
parser.popQueryState();
|
||
|
break;
|
||
|
case 1939:
|
||
|
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 1942:
|
||
|
var subQuery = parser.getSubQuery($$[$0]);
|
||
|
subQuery.columns.forEach(function (column) {
|
||
|
parser.expandIdentifierChain({ wrapper: column });
|
||
|
delete column.linked;
|
||
|
});
|
||
|
parser.popQueryState(subQuery);
|
||
|
this.$ = subQuery;
|
||
|
break;
|
||
|
case 1959:
|
||
|
case 1960:
|
||
|
case 1961:
|
||
|
case 1962:
|
||
|
this.$ = { alias: $$[$0], location: _$[$0] };
|
||
|
break;
|
||
|
case 1968:
|
||
|
if (!$$[$0]) {
|
||
|
$$[$0 - 1].suggestKeywords = ['OVER'];
|
||
|
}
|
||
|
break;
|
||
|
case 1976:
|
||
|
parser.suggestKeywords(['OVER']);
|
||
|
break;
|
||
|
case 1980:
|
||
|
case 1981:
|
||
|
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 1992:
|
||
|
this.$ = { expression: $$[$0 - 1] };
|
||
|
break;
|
||
|
case 1993:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { position: 1 };
|
||
|
break;
|
||
|
case 1994:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1]);
|
||
|
break;
|
||
|
case 2002:
|
||
|
case 2080:
|
||
|
case 2121:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 2]) };
|
||
|
break;
|
||
|
case 2003:
|
||
|
this.$ = { function: $$[$0 - 3], expression: $$[$0 - 2], types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2004:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 3], 1);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2005:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2006:
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 3], $$[$0 - 1].position);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2014:
|
||
|
case 2015:
|
||
|
if (parser.yy.result.suggestFunctions) {
|
||
|
parser.suggestAggregateFunctions();
|
||
|
}
|
||
|
break;
|
||
|
case 2016:
|
||
|
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 2017:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'ORDER BY', weight: 2 }]);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
}
|
||
|
break;
|
||
|
case 2026:
|
||
|
// Only allowed in last order by
|
||
|
delete parser.yy.result.suggestAnalyticFunctions;
|
||
|
break;
|
||
|
case 2027:
|
||
|
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 2033:
|
||
|
parser.suggestKeywords(['BETWEEN']);
|
||
|
break;
|
||
|
case 2034:
|
||
|
if (!$$[$0 - 2] && !$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED PRECEDING']);
|
||
|
}
|
||
|
else if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['AND']);
|
||
|
}
|
||
|
break;
|
||
|
case 2039:
|
||
|
lexer.popState();
|
||
|
break;
|
||
|
case 2040:
|
||
|
lexer.begin('hdfs');
|
||
|
break;
|
||
|
case 2042:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 3] });
|
||
|
break;
|
||
|
case 2043:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 2] });
|
||
|
break;
|
||
|
case 2044:
|
||
|
parser.suggestHdfs({ path: $$[$0 - 1] });
|
||
|
break;
|
||
|
case 2045:
|
||
|
parser.suggestHdfs({ path: '' });
|
||
|
break;
|
||
|
case 2046:
|
||
|
parser.suggestHdfs({ path: '' });
|
||
|
break;
|
||
|
case 2052:
|
||
|
parser.suggestKeywords(['PRECEDING']);
|
||
|
break;
|
||
|
case 2053:
|
||
|
case 2058:
|
||
|
parser.suggestKeywords(['ROW']);
|
||
|
break;
|
||
|
case 2057:
|
||
|
parser.suggestKeywords(['CURRENT ROW', 'UNBOUNDED FOLLOWING']);
|
||
|
break;
|
||
|
case 2059:
|
||
|
parser.suggestKeywords(['FOLLOWING']);
|
||
|
break;
|
||
|
case 2065:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestSelectListAliases(true);
|
||
|
break;
|
||
|
case 2066:
|
||
|
parser.suggestAggregateFunctions();
|
||
|
parser.suggestSelectListAliases(true);
|
||
|
break;
|
||
|
case 2067:
|
||
|
case 2072:
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2069:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2070:
|
||
|
case 2071:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2075:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], [{ value: 'AS', weight: 2 }]);
|
||
|
this.$ = { types: [$$[$0 - 1].toUpperCase()] };
|
||
|
break;
|
||
|
case 2076:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], [{ value: 'AS', weight: 2 }]);
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2077:
|
||
|
case 2078:
|
||
|
parser.suggestKeywords(parser.getTypeKeywords());
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2079:
|
||
|
case 2085:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2081:
|
||
|
case 2086:
|
||
|
case 2120:
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2082:
|
||
|
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 2083:
|
||
|
case 2088:
|
||
|
case 2123:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2084:
|
||
|
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 2087:
|
||
|
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 2089:
|
||
|
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 2106:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2107:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2108:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2109:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2110:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['STRING'] : ['TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2111:
|
||
|
parser.applyTypeToSuggestions(['STRING', 'TIMESTAMP']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 3]) };
|
||
|
break;
|
||
|
case 2112:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2113:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2114:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 2].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2115:
|
||
|
parser.applyTypeToSuggestions($$[$0 - 1].toLowerCase() === 'from' ? ['TIMESTAMP'] : ['STRING']);
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2116:
|
||
|
if ($$[$0 - 3].types[0] === 'STRING') {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3], ['FROM']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 3]);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 5]) };
|
||
|
break;
|
||
|
case 2117:
|
||
|
if ($$[$0 - 2].types[0] === 'STRING') {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['FROM']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2]);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2122:
|
||
|
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 2124:
|
||
|
if (parser.yy.result.suggestFunctions && !parser.yy.result.suggestFunctions.types) {
|
||
|
parser.applyArgumentTypesToSuggestions($$[$0 - 4], 1);
|
||
|
}
|
||
|
this.$ = { types: parser.findReturnTypes($$[$0 - 4]) };
|
||
|
break;
|
||
|
case 2148:
|
||
|
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 2149:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['COLUMN STATS', 'CREATE TABLE', 'CREATE VIEW', 'FILES IN', 'PARTITIONS', 'RANGE PARTITIONS', 'TABLE STATS']);
|
||
|
break;
|
||
|
case 2150:
|
||
|
parser.suggestKeywords(['AGGREGATE FUNCTIONS', 'ANALYTIC FUNCTIONS', 'DATABASES', 'FUNCTIONS', 'SCHEMAS', 'TABLES']);
|
||
|
break;
|
||
|
case 2164:
|
||
|
case 2181:
|
||
|
case 2213:
|
||
|
case 2215:
|
||
|
case 2224:
|
||
|
parser.suggestTables();
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 2168:
|
||
|
if ($$[$0 - 1].isView) {
|
||
|
parser.suggestTables({ onlyViews: true });
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestTables();
|
||
|
}
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
break;
|
||
|
case 2169:
|
||
|
if (parser.yy.result.suggestTables && $$[$0 - 1].isView) {
|
||
|
parser.yy.result.suggestTables.onlyViews = true;
|
||
|
}
|
||
|
break;
|
||
|
case 2170:
|
||
|
parser.addTablePrimary($$[$0]);
|
||
|
parser.suggestKeywords(['TABLE', 'VIEW']);
|
||
|
break;
|
||
|
case 2172:
|
||
|
this.$ = { isView: true };
|
||
|
break;
|
||
|
case 2174:
|
||
|
parser.suggestKeywords(['ROLES']);
|
||
|
break;
|
||
|
case 2175:
|
||
|
parser.suggestKeywords(['CURRENT']);
|
||
|
break;
|
||
|
case 2178:
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
break;
|
||
|
case 2185:
|
||
|
parser.addTablePrimary($$[$0 - 1]);
|
||
|
parser.suggestKeywords(['IN']);
|
||
|
break;
|
||
|
case 2188:
|
||
|
case 2191:
|
||
|
parser.suggestKeywords(['FUNCTIONS']);
|
||
|
break;
|
||
|
case 2189:
|
||
|
case 2192:
|
||
|
parser.suggestKeywords(['AGGREGATE', 'ANALYTICAL']);
|
||
|
break;
|
||
|
case 2190:
|
||
|
case 2229:
|
||
|
if (!$$[$0 - 1]) {
|
||
|
parser.suggestKeywords(['IN', 'LIKE']);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
}
|
||
|
break;
|
||
|
case 2193:
|
||
|
if (!$$[$0 - 2]) {
|
||
|
parser.suggestKeywords([{ value: 'IN', weight: 2 }, { value: 'LIKE', weight: 1 }]);
|
||
|
}
|
||
|
else {
|
||
|
parser.suggestKeywords(['LIKE']);
|
||
|
}
|
||
|
break;
|
||
|
case 2201:
|
||
|
parser.suggestKeywords(['ON DATABASE', 'ON SERVER', 'ON TABLE', 'ON URI']);
|
||
|
break;
|
||
|
case 2202:
|
||
|
parser.suggestKeywords(['DATABASE', 'SERVER', 'TABLE', 'URI']);
|
||
|
break;
|
||
|
case 2204:
|
||
|
parser.suggestDatabases({
|
||
|
appendDot: true
|
||
|
});
|
||
|
parser.suggestTables();
|
||
|
break;
|
||
|
case 2218:
|
||
|
parser.suggestKeywords(['GRANT']);
|
||
|
break;
|
||
|
case 2235:
|
||
|
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 2236:
|
||
|
parser.suggestKeywords(['SET']);
|
||
|
break;
|
||
|
case 2252:
|
||
|
parser.suggestKeywords(['=']);
|
||
|
break;
|
||
|
case 2261:
|
||
|
if (!parser.yy.cursorFound) {
|
||
|
parser.yy.result.useDatabase = $$[$0];
|
||
|
}
|
||
|
break;
|
||
|
case 2264:
|
||
|
this.$ = { inValueEdit: true };
|
||
|
break;
|
||
|
case 2265:
|
||
|
this.$ = { inValueEdit: true, cursorAtStart: true };
|
||
|
break;
|
||
|
case 2266:
|
||
|
case 2267:
|
||
|
case 2268:
|
||
|
case 2269:
|
||
|
case 2270:
|
||
|
this.$ = { suggestKeywords: ['NOT'] };
|
||
|
break;
|
||
|
case 2276:
|
||
|
case 2277:
|
||
|
case 2278:
|
||
|
case 2279:
|
||
|
case 2280:
|
||
|
parser.suggestFunctions({ types: ['STRING'] });
|
||
|
parser.suggestColumns({ types: ['STRING'] });
|
||
|
this.$ = { types: ['BOOLEAN'] };
|
||
|
break;
|
||
|
case 2281:
|
||
|
case 2283:
|
||
|
this.$ = parser.findCaseType($$[$0 - 1]);
|
||
|
break;
|
||
|
case 2282:
|
||
|
case 2285:
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2284:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['END']);
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2286:
|
||
|
this.$ = parser.findCaseType($$[$0 - 2]);
|
||
|
break;
|
||
|
case 2287:
|
||
|
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 2288:
|
||
|
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 2289:
|
||
|
$$[$0 - 3].caseTypes.push($$[$0 - 1]);
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
this.$.suggestFilters = $$[$0 - 1].suggestFilters;
|
||
|
break;
|
||
|
case 2290:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = parser.findCaseType($$[$0 - 3]);
|
||
|
break;
|
||
|
case 2291:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { types: ['T'], typeSet: true };
|
||
|
break;
|
||
|
case 2292:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = $$[$0 - 1];
|
||
|
break;
|
||
|
case 2293:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { types: ['T'] };
|
||
|
break;
|
||
|
case 2296:
|
||
|
this.$ = { caseTypes: [$$[$0]], lastType: $$[$0] };
|
||
|
break;
|
||
|
case 2297:
|
||
|
$$[$0 - 1].caseTypes.push($$[$0]);
|
||
|
this.$ = { caseTypes: $$[$0 - 1].caseTypes, lastType: $$[$0] };
|
||
|
break;
|
||
|
case 2301:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['WHEN']);
|
||
|
break;
|
||
|
case 2304:
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 2305:
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: $$[$0 - 1].suggestFilters };
|
||
|
break;
|
||
|
case 2306:
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0 - 2].suggestFilters };
|
||
|
break;
|
||
|
case 2307:
|
||
|
case 2308:
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: $$[$0].suggestFilters };
|
||
|
break;
|
||
|
case 2309:
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2310:
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [$$[$0]] };
|
||
|
break;
|
||
|
case 2311:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2312:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['WHEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2313:
|
||
|
case 2315:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
|
||
|
break;
|
||
|
case 2314:
|
||
|
parser.valueExpressionSuggest();
|
||
|
parser.suggestKeywords(['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }], suggestFilters: true };
|
||
|
break;
|
||
|
case 2316:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [$$[$0]], suggestFilters: true };
|
||
|
break;
|
||
|
case 2317:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 1], ['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2318:
|
||
|
parser.suggestValueExpressionKeywords($$[$0 - 2], ['THEN']);
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
case 2319:
|
||
|
case 2320:
|
||
|
case 2321:
|
||
|
case 2322:
|
||
|
parser.valueExpressionSuggest();
|
||
|
this.$ = { caseTypes: [{ types: ['T'] }] };
|
||
|
break;
|
||
|
}
|
||
|
},
|
||
|
table: [o($V0, $V1, { 500: 1, 405: 2 }), { 1: [3] }, o($V2, $V3, { 401: 3, 501: 4, 402: 6, 403: 7, 406: 8, 3: 394, 362: 395, 137: 396, 409: 397, 239: 398, 370: 399, 407: 400, 16: 401, 367: 402, 140: 403, 4: 405, 5: 406, 6: 407, 7: 408, 8: 409, 9: 410, 10: 411, 11: 412, 12: 413, 13: 414, 14: 415, 15: 416, 363: 417, 364: 418, 365: 419, 366: 420, 410: 421, 17: 426, 18: 427, 19: 428, 20: 429, 21: 430, 22: 431, 23: 432, 24: 433, 25: 434, 28: 435, 29: 436, 368: 437, 369: 438, 371: 439, 373: 440, 374: 441, 418: 442, 30: 443, 31: 444, 32: 445, 33: 446, 161: 450, 162: 451, 163: 452, 164: 453, 165: 454, 375: 455, 376: 456, 377: 457, 378: 458, 379: 459, 380: 460, 381: 461, 993: 464, 994: 465, 995: 466, 996: 467, 997: 468, 998: 469, 999: 470, 1000: 471, 1001: 472, 1002: 473, 1003: 474, 1004: 475, 372: 477, 34: 481, 35: 482, 36: 483, 37: 484, 166: 486, 167: 487, 168: 488, 169: 489, 382: 491, 383: 492, 384: 493, 385: 494, 386: 495, 387: 496, 1006: 499, 1007: 500, 1008: 501, 1009: 502, 1010: 503, 1011: 504, 1012: 505, 1013: 506, 1014: 507, 1015: 508, 1016: 509, 471: 510, 43: 511, 135: 512, 311: 514, 312: 515, 470: 517, 72: 518, 139: 519, 313: 520, 314: 521, 476: 522, 472: 523, 481: 524, 482: 525, 479: 526, 480: 527, 2: $V4, 26: $V5, 27: $V6, 38: $V7, 41: $V8, 50: $V9, 51: $Va, 54: $Vb, 63: $Vc, 65: $Vd, 66: $Ve, 70: $Vf, 71: $Vg, 85: $Vh, 86: $Vi, 89: $Vj, 91: $Vk, 95: $Vl, 101: $Vm, 103: $Vn, 106: $Vo, 107: $Vp, 129: $Vq, 136: $Vr, 138: $Vs, 142: $Vt, 143: $Vu, 144: $Vv, 146: $Vw, 147: $Vx, 149: $Vy, 151: $Vz, 153: $VA, 155: $VB, 158: $VC, 170: $VD, 179: $VE, 180: $VF, 208: $VG, 224: $VH, 236: $VI, 237: $VJ, 238: $VK, 241: $VL, 242: $VM, 253: $VN, 254: $VO, 256: $VP, 257: $VQ, 264: $VR, 268: $VS, 275: $VT, 277: $VU, 287: $VV, 288: $VW, 289: $VX, 291: $VY, 292: $VZ, 293: $V_, 294: $V$, 295: $V01, 300: $V11, 301: $V21, 303: $V31, 304: $V41, 306: $V51, 315: $V61, 321: $V71, 341: $V81, 342: $V91, 343: $Va1, 344: $Vb1, 347: $Vc1, 348: $Vd1, 349: $Ve1, 350: $Vf1, 351: $Vg1, 352: $Vh1, 353: $Vi1, 359: $Vj1, 361: $Vk1, 390: $Vl1, 391: $Vm1, 392: $Vn1, 394: $Vo1, 408: $Vp1, 411: $Vq1, 425: $Vr1, 427: $Vs1, 428: $Vt1, 429: $Vu1, 430: $Vv1, 431: $Vw1, 432: $Vx1, 433: $Vy1, 434: $Vz1, 435: $VA1, 452: $VB1, 453: $VC1, 461: $VD1, 462: $VE1, 463: $VF1, 465: $VG1, 466: $VH1, 483: $VI1, 484: $VJ1, 488: $VK1, 489: $VL1, 494: $VM1, 495: $VN1, 496: $VO1, 503: $VP1, 504: $VQ1, 505: $VR1, 506: $VS1, 507: $VT1, 508: $VU1, 509: $VV1, 510: $VW1, 511: $VX1, 512: $VY1, 513: $VZ1, 514: $V_1, 515: $V$1, 516: $V02, 517: $V12, 518: $V22, 519: $V32, 520: $V42, 521: $V52, 522: $V62, 523: $V72, 524: $V82, 525: $V92, 526: $Va2, 527: $Vb2, 528: $Vc2, 529: $Vd2, 530: $Ve2, 531: $Vf2, 532: $Vg2, 533: $Vh2, 534: $Vi2, 535: $Vj2, 536: $Vk2, 537: $Vl2, 538: $Vm2, 539: $Vn2, 540: $Vo2, 541: $Vp2, 542: $Vq2, 543: $Vr2, 544: $Vs2, 545: $Vt2, 546: $Vu2, 547: $Vv2, 548: $Vw2, 549: $Vx2, 550: $Vy2, 551: $Vz2, 552: $VA2, 553: $VB2, 554: $VC2, 555: $VD2, 556: $VE2, 557: $VF2, 558: $VG2, 559: $VH2, 560: $VI2, 561: $VJ2, 562: $VK2, 563: $VL2, 564: $VM2, 565: $VN2, 566: $VO2, 567: $VP2, 568: $VQ2, 569: $VR2, 570: $VS2, 571: $VT2, 572: $VU2, 573: $VV2, 574: $VW2, 575: $VX2, 576: $VY2, 577: $VZ2, 578: $V_2, 579: $V$2, 580: $V03, 581: $V13, 582: $V23, 583: $V33, 584: $V43, 585: $V53, 586: $V63, 587: $V73, 588: $V83, 589: $V93, 590: $Va3, 591: $Vb3, 592: $Vc3, 593: $Vd3, 594: $Ve3, 595: $Vf3, 596: $Vg3, 597: $Vh3, 598: $Vi3, 599: $Vj3, 600: $Vk3, 601: $Vl3, 602: $Vm3, 603: $Vn3, 604: $Vo3, 605: $Vp3, 606: $Vq3, 607: $Vr3, 608: $Vs3, 609: $Vt3, 610: $Vu3, 611: $Vv3, 612: $Vw3, 613: $Vx3, 614: $Vy3, 615: $Vz3, 616: $VA3, 617: $VB3, 618: $VC3, 619: $VD3, 620: $VE3, 621: $VF3, 622: $VG3, 623: $VH3, 624: $VI3, 625: $VJ3, 626: $VK3, 627: $VL3, 628: $VM3, 629: $VN3, 630: $VO3, 631: $VP3, 632: $VQ3, 633: $VR3, 634: $VS3, 635: $VT3, 636: $VU3, 637: $VV3, 638: $VW3, 639: $VX3, 640: $VY3, 641: $VZ3, 642: $V_3, 643: $V$3, 644: $V04, 645: $V14, 646: $V24, 647: $V34, 648: $V44, 649: $V54, 650: $V64, 651: $V74, 652: $V84, 653: $V94, 654: $Va4, 655: $Vb4, 656: $Vc4, 657: $Vd4, 658: $Ve4, 659: $Vf
|
||
|
defaultActions: { 9: [2, 944], 10: [2, 945], 11: [2, 946], 12: [2, 947], 13: [2, 948], 14: [2, 949], 15: [2, 950], 16: [2, 951], 17: [2, 952], 18: [2, 953], 19: [2, 954], 20: [2, 955], 21: [2, 956], 22: [2, 957], 23: [2, 958], 24: [2, 959], 25: [2, 960], 26: [2, 961], 27: [2, 962], 28: [2, 963], 29: [2, 964], 30: [2, 965], 31: [2, 966], 32: [2, 967], 33: [2, 968], 34: [2, 969], 35: [2, 970], 36: [2, 971], 37: [2, 972], 38: [2, 973], 39: [2, 974], 40: [2, 975], 41: [2, 976], 42: [2, 977], 43: [2, 978], 44: [2, 979], 45: [2, 980], 46: [2, 981], 47: [2, 982], 48: [2, 983], 49: [2, 984], 50: [2, 985], 51: [2, 986], 52: [2, 987], 53: [2, 988], 54: [2, 989], 55: [2, 990], 56: [2, 991], 57: [2, 992], 58: [2, 993], 59: [2, 994], 60: [2, 995], 61: [2, 996], 62: [2, 997], 63: [2, 998], 64: [2, 999], 65: [2, 1000], 66: [2, 1001], 67: [2, 1002], 68: [2, 1003], 69: [2, 1004], 70: [2, 1005], 71: [2, 1006], 72: [2, 1007], 73: [2, 1008], 74: [2, 1009], 75: [2, 1010], 76: [2, 1011], 77: [2, 1012], 78: [2, 1013], 79: [2, 1014], 80: [2, 1015], 81: [2, 1016], 82: [2, 1017], 83: [2, 1018], 84: [2, 1019], 85: [2, 1020], 86: [2, 1021], 87: [2, 1022], 88: [2, 1023], 89: [2, 1024], 90: [2, 1025], 91: [2, 1026], 92: [2, 1027], 93: [2, 1028], 94: [2, 1029], 95: [2, 1030], 96: [2, 1031], 97: [2, 1032], 98: [2, 1033], 99: [2, 1034], 100: [2, 1035], 101: [2, 1036], 102: [2, 1037], 104: [2, 1039], 105: [2, 1040], 106: [2, 1041], 107: [2, 1042], 108: [2, 1043], 109: [2, 1044], 110: [2, 1045], 111: [2, 1046], 112: [2, 1047], 113: [2, 1048], 114: [2, 1049], 115: [2, 1050], 116: [2, 1051], 117: [2, 1052], 118: [2, 1053], 119: [2, 1054], 120: [2, 1055], 121: [2, 1056], 122: [2, 1057], 123: [2, 1058], 124: [2, 1059], 125: [2, 1060], 126: [2, 1061], 127: [2, 1062], 128: [2, 1063], 129: [2, 1064], 130: [2, 1065], 131: [2, 1066], 132: [2, 1067], 133: [2, 1068], 134: [2, 1069], 135: [2, 1070], 136: [2, 1071], 137: [2, 1072], 138: [2, 1073], 139: [2, 1074], 140: [2, 1075], 141: [2, 1076], 142: [2, 1077], 143: [2, 1078], 144: [2, 1079], 145: [2, 1080], 146: [2, 1081], 147: [2, 1082], 148: [2, 1083], 149: [2, 1084], 150: [2, 1085], 151: [2, 1086], 152: [2, 1087], 154: [2, 1089], 155: [2, 1090], 156: [2, 1091], 157: [2, 1092], 158: [2, 1093], 159: [2, 1094], 160: [2, 1095], 161: [2, 1096], 162: [2, 1097], 163: [2, 1098], 164: [2, 1099], 165: [2, 1100], 166: [2, 1101], 167: [2, 1102], 168: [2, 1103], 169: [2, 1104], 170: [2, 1105], 171: [2, 1106], 172: [2, 1107], 173: [2, 1108], 174: [2, 1109], 175: [2, 1110], 176: [2, 1111], 177: [2, 1112], 178: [2, 1113], 179: [2, 1114], 180: [2, 1115], 181: [2, 1116], 182: [2, 1117], 183: [2, 1118], 184: [2, 1119], 185: [2, 1120], 186: [2, 1121], 187: [2, 1122], 188: [2, 1123], 189: [2, 1124], 190: [2, 1125], 191: [2, 1126], 192: [2, 1127], 193: [2, 1128], 194: [2, 1129], 195: [2, 1130], 196: [2, 1131], 197: [2, 1132], 198: [2, 1133], 199: [2, 1134], 200: [2, 1135], 201: [2, 1136], 202: [2, 1137], 203: [2, 1138], 204: [2, 1139], 205: [2, 1140], 206: [2, 1141], 207: [2, 1142], 208: [2, 1143], 209: [2, 1144], 210: [2, 1145], 211: [2, 1146], 212: [2, 1147], 213: [2, 1148], 214: [2, 1149], 215: [2, 1150], 216: [2, 1151], 217: [2, 1152], 218: [2, 1153], 219: [2, 1154], 220: [2, 1155], 221: [2, 1156], 222: [2, 1157], 223: [2, 1158], 224: [2, 1159], 225: [2, 1160], 226: [2, 1161], 227: [2, 1162], 228: [2, 1163], 229: [2, 1164], 230: [2, 1165], 231: [2, 1166], 232: [2, 1167], 233: [2, 1168], 234: [2, 1169], 235: [2, 1170], 236: [2, 1171], 237: [2, 1172], 238: [2, 1173], 239: [2, 1174], 240: [2, 1175], 241: [2, 1176], 242: [2, 1177], 243: [2, 1178], 244: [2, 1179], 245: [2, 1180], 246: [2, 1181], 247: [2, 1182], 248: [2, 1183], 249: [2, 1184], 250: [2, 1185], 251: [2, 1186], 252: [2, 1187], 253: [2, 1188], 254: [2, 1189], 255: [2, 1190], 256: [2, 1191], 257: [2, 1192], 258: [2, 1193], 259: [2, 1194], 260: [2, 1195], 261: [2, 1196], 262: [2, 1197], 263: [2, 1198], 264: [2, 1199], 265: [2, 1200], 266: [2, 1201], 267: [2, 1202], 268: [2, 1203], 269: [2, 1204], 270: [2, 1205], 271: [2, 1206], 272: [2, 1207], 273: [2, 1208], 274: [2,
|
||
|
parseError: function parseError(str, hash) {
|
||
|
if (hash.recoverable) {
|
||
|
this.trace(str);
|
||
|
}
|
||
|
else {
|
||
|
var error = new Error(str);
|
||
|
error.hash = hash;
|
||
|
throw error;
|
||
|
}
|
||
|
},
|
||
|
parse: function parse(input) {
|
||
|
var self = this, stack = [0], tstack = [], // token stack
|
||
|
vstack = [null], // semantic value stack
|
||
|
lstack = [], // location stack
|
||
|
table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
|
||
|
var args = lstack.slice.call(arguments, 1);
|
||
|
//this.reductionCount = this.shiftCount = 0;
|
||
|
var lexer = Object.create(this.lexer);
|
||
|
var sharedState = { yy: {} };
|
||
|
// copy state
|
||
|
for (var k in this.yy) {
|
||
|
if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
|
||
|
sharedState.yy[k] = this.yy[k];
|
||
|
}
|
||
|
}
|
||
|
lexer.setInput(input, sharedState.yy);
|
||
|
sharedState.yy.lexer = lexer;
|
||
|
sharedState.yy.parser = this;
|
||
|
if (typeof lexer.yylloc == 'undefined') {
|
||
|
lexer.yylloc = {};
|
||
|
}
|
||
|
var yyloc = lexer.yylloc;
|
||
|
lstack.push(yyloc);
|
||
|
var ranges = lexer.options && lexer.options.ranges;
|
||
|
if (typeof sharedState.yy.parseError === 'function') {
|
||
|
this.parseError = sharedState.yy.parseError;
|
||
|
}
|
||
|
else {
|
||
|
this.parseError = Object.getPrototypeOf(this).parseError;
|
||
|
}
|
||
|
function popStack(n) {
|
||
|
stack.length = stack.length - 2 * n;
|
||
|
vstack.length = vstack.length - n;
|
||
|
lstack.length = lstack.length - n;
|
||
|
}
|
||
|
_token_stack: var lex = function () {
|
||
|
var token;
|
||
|
token = lexer.lex() || EOF;
|
||
|
// if token isn't its numeric value, convert
|
||
|
if (typeof token !== 'number') {
|
||
|
token = self.symbols_[token] || token;
|
||
|
}
|
||
|
return token;
|
||
|
};
|
||
|
var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
|
||
|
while (true) {
|
||
|
// retreive state number from top of stack
|
||
|
state = stack[stack.length - 1];
|
||
|
// use default actions if available
|
||
|
if (this.defaultActions[state]) {
|
||
|
action = this.defaultActions[state];
|
||
|
}
|
||
|
else {
|
||
|
if (symbol === null || typeof symbol == 'undefined') {
|
||
|
symbol = lex();
|
||
|
}
|
||
|
// read action for current state and first input
|
||
|
action = table[state] && table[state][symbol];
|
||
|
}
|
||
|
_handle_error:
|
||
|
// handle parse error
|
||
|
if (typeof action === 'undefined' || !action.length || !action[0]) {
|
||
|
var error_rule_depth;
|
||
|
var errStr = '';
|
||
|
// Return the rule stack depth where the nearest error rule can be found.
|
||
|
// Return FALSE when no error recovery rule was found.
|
||
|
function locateNearestErrorRecoveryRule(state) {
|
||
|
var stack_probe = stack.length - 1;
|
||
|
var depth = 0;
|
||
|
// try to recover from error
|
||
|
for (;;) {
|
||
|
// check for error recovery rule in this state
|
||
|
if ((TERROR.toString()) in table[state]) {
|
||
|
return depth;
|
||
|
}
|
||
|
if (state === 0 || stack_probe < 2) {
|
||
|
return false; // No suitable error recovery rule available.
|
||
|
}
|
||
|
stack_probe -= 2; // popStack(1): [symbol, action]
|
||
|
state = stack[stack_probe];
|
||
|
++depth;
|
||
|
}
|
||
|
}
|
||
|
if (!recovering) {
|
||
|
// first see if there's any chance at hitting an error recovery rule:
|
||
|
error_rule_depth = locateNearestErrorRecoveryRule(state);
|
||
|
// Report error
|
||
|
expected = [];
|
||
|
for (p in table[state]) {
|
||
|
if (this.terminals_[p] && p > TERROR) {
|
||
|
expected.push("'" + this.terminals_[p] + "'");
|
||
|
}
|
||
|
}
|
||
|
if (lexer.showPosition) {
|
||
|
errStr = 'Parse error on line ' + (yylineno + 1) + ":\n" + lexer.showPosition() + "\nExpecting " + expected.join(', ') + ", got '" + (this.terminals_[symbol] || symbol) + "'";
|
||
|
}
|
||
|
else {
|
||
|
errStr = 'Parse error on line ' + (yylineno + 1) + ": Unexpected " +
|
||
|
(symbol == EOF ? "end of input" :
|
||
|
("'" + (this.terminals_[symbol] || symbol) + "'"));
|
||
|
}
|
||
|
this.parseError(errStr, {
|
||
|
text: lexer.match,
|
||
|
token: this.terminals_[symbol] || symbol,
|
||
|
line: lexer.yylineno,
|
||
|
loc: lexer.yylloc, ruleId: stack.slice(stack.length - 2, stack.length).join(''),
|
||
|
expected: expected,
|
||
|
recoverable: (error_rule_depth !== false)
|
||
|
});
|
||
|
}
|
||
|
else if (preErrorSymbol !== EOF) {
|
||
|
error_rule_depth = locateNearestErrorRecoveryRule(state);
|
||
|
}
|
||
|
// just recovered from another error
|
||
|
if (recovering == 3) {
|
||
|
if (symbol === EOF || preErrorSymbol === EOF) {
|
||
|
throw new Error(errStr || 'Parsing halted while starting to recover from another error.');
|
||
|
}
|
||
|
// discard current lookahead and grab another
|
||
|
yyleng = lexer.yyleng;
|
||
|
yytext = lexer.yytext;
|
||
|
yylineno = lexer.yylineno;
|
||
|
yyloc = lexer.yylloc;
|
||
|
symbol = lex();
|
||
|
}
|
||
|
// try to recover from error
|
||
|
if (error_rule_depth === false) {
|
||
|
throw new Error(errStr || 'Parsing halted. No suitable error recovery rule available.');
|
||
|
}
|
||
|
popStack(error_rule_depth);
|
||
|
preErrorSymbol = (symbol == TERROR ? null : symbol); // save the lookahead token
|
||
|
symbol = TERROR; // insert generic error symbol as new lookahead
|
||
|
state = stack[stack.length - 1];
|
||
|
action = table[state] && table[state][TERROR];
|
||
|
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
|
||
|
}
|
||
|
// this shouldn't happen, unless resolve defaults are off
|
||
|
if (action[0] instanceof Array && action.length > 1) {
|
||
|
throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
|
||
|
}
|
||
|
switch (action[0]) {
|
||
|
case 1: // shift
|
||
|
//this.shiftCount++;
|
||
|
stack.push(symbol);
|
||
|
vstack.push(lexer.yytext);
|
||
|
lstack.push(lexer.yylloc);
|
||
|
stack.push(action[1]); // push state
|
||
|
symbol = null;
|
||
|
if (!preErrorSymbol) { // normal execution/no error
|
||
|
yyleng = lexer.yyleng;
|
||
|
yytext = lexer.yytext;
|
||
|
yylineno = lexer.yylineno;
|
||
|
yyloc = lexer.yylloc;
|
||
|
if (recovering > 0) {
|
||
|
recovering--;
|
||
|
}
|
||
|
}
|
||
|
else {
|
||
|
// error just occurred, resume old lookahead f/ before error
|
||
|
symbol = preErrorSymbol;
|
||
|
preErrorSymbol = null;
|
||
|
}
|
||
|
break;
|
||
|
case 2:
|
||
|
// reduce
|
||
|
//this.reductionCount++;
|
||
|
len = this.productions_[action[1]][1];
|
||
|
// perform semantic action
|
||
|
yyval.$ = vstack[vstack.length - len]; // default to $$ = $1
|
||
|
// default location, uses first token for firsts, last for lasts
|
||
|
yyval._$ = {
|
||
|
first_line: lstack[lstack.length - (len || 1)].first_line,
|
||
|
last_line: lstack[lstack.length - 1].last_line,
|
||
|
first_column: lstack[lstack.length - (len || 1)].first_column,
|
||
|
last_column: lstack[lstack.length - 1].last_column
|
||
|
};
|
||
|
if (ranges) {
|
||
|
yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
|
||
|
}
|
||
|
r = this.performAction.apply(yyval, [yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack].concat(args));
|
||
|
if (typeof r !== 'undefined') {
|
||
|
return r;
|
||
|
}
|
||
|
// pop off stack
|
||
|
if (len) {
|
||
|
stack = stack.slice(0, -1 * len * 2);
|
||
|
vstack = vstack.slice(0, -1 * len);
|
||
|
lstack = lstack.slice(0, -1 * len);
|
||
|
}
|
||
|
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
|
||
|
vstack.push(yyval.$);
|
||
|
lstack.push(yyval._$);
|
||
|
// goto new state = table[STATE][NONTERMINAL]
|
||
|
newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
|
||
|
stack.push(newState);
|
||
|
break;
|
||
|
case 3:
|
||
|
// accept
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
} };
|
||
|
sqlParseSupport_1.default.initSqlParser(parser); /* generated by jison-lex 0.3.4 */
|
||
|
var lexer = (function () {
|
||
|
var lexer = ({
|
||
|
EOF: 1,
|
||
|
parseError: function parseError(str, hash) {
|
||
|
if (this.yy.parser) {
|
||
|
this.yy.parser.parseError(str, hash);
|
||
|
}
|
||
|
else {
|
||
|
throw new Error(str);
|
||
|
}
|
||
|
},
|
||
|
// resets the lexer, sets new input
|
||
|
setInput: function (input, yy) {
|
||
|
this.yy = yy || this.yy || {};
|
||
|
this._input = input;
|
||
|
this._more = this._backtrack = this.done = false;
|
||
|
this.yylineno = this.yyleng = 0;
|
||
|
this.yytext = this.matched = this.match = '';
|
||
|
this.conditionStack = ['INITIAL'];
|
||
|
this.yylloc = {
|
||
|
first_line: 1,
|
||
|
first_column: 0,
|
||
|
last_line: 1,
|
||
|
last_column: 0
|
||
|
};
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range = [0, 0];
|
||
|
}
|
||
|
this.offset = 0;
|
||
|
return this;
|
||
|
},
|
||
|
// consumes and returns one char from the input
|
||
|
input: function () {
|
||
|
var ch = this._input[0];
|
||
|
this.yytext += ch;
|
||
|
this.yyleng++;
|
||
|
this.offset++;
|
||
|
this.match += ch;
|
||
|
this.matched += ch;
|
||
|
var lines = ch.match(/(?:\r\n?|\n).*/g);
|
||
|
if (lines) {
|
||
|
this.yylineno++;
|
||
|
this.yylloc.last_line++;
|
||
|
}
|
||
|
else {
|
||
|
this.yylloc.last_column++;
|
||
|
}
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range[1]++;
|
||
|
}
|
||
|
this._input = this._input.slice(1);
|
||
|
return ch;
|
||
|
},
|
||
|
// unshifts one char (or a string) into the input
|
||
|
unput: function (ch) {
|
||
|
var len = ch.length;
|
||
|
var lines = ch.split(/(?:\r\n?|\n)/g);
|
||
|
this._input = ch + this._input;
|
||
|
this.yytext = this.yytext.substr(0, this.yytext.length - len);
|
||
|
//this.yyleng -= len;
|
||
|
this.offset -= len;
|
||
|
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
|
||
|
this.match = this.match.substr(0, this.match.length - 1);
|
||
|
this.matched = this.matched.substr(0, this.matched.length - 1);
|
||
|
if (lines.length - 1) {
|
||
|
this.yylineno -= lines.length - 1;
|
||
|
}
|
||
|
var r = this.yylloc.range;
|
||
|
this.yylloc = {
|
||
|
first_line: this.yylloc.first_line,
|
||
|
last_line: this.yylineno + 1,
|
||
|
first_column: this.yylloc.first_column,
|
||
|
last_column: lines ?
|
||
|
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
|
||
|
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
|
||
|
this.yylloc.first_column - len
|
||
|
};
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
|
||
|
}
|
||
|
this.yyleng = this.yytext.length;
|
||
|
return this;
|
||
|
},
|
||
|
// When called from action, caches matched text and appends it on next action
|
||
|
more: function () {
|
||
|
this._more = true;
|
||
|
return this;
|
||
|
},
|
||
|
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
|
||
|
reject: function () {
|
||
|
if (this.options.backtrack_lexer) {
|
||
|
this._backtrack = true;
|
||
|
}
|
||
|
else {
|
||
|
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), {
|
||
|
text: "",
|
||
|
token: null,
|
||
|
line: this.yylineno
|
||
|
});
|
||
|
}
|
||
|
return this;
|
||
|
},
|
||
|
// retain first n characters of the match
|
||
|
less: function (n) {
|
||
|
this.unput(this.match.slice(n));
|
||
|
},
|
||
|
// displays already matched input, i.e. for error messages
|
||
|
pastInput: function () {
|
||
|
var past = this.matched.substr(0, this.matched.length - this.match.length);
|
||
|
return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
|
||
|
},
|
||
|
// displays upcoming input, i.e. for error messages
|
||
|
upcomingInput: function () {
|
||
|
var next = this.match;
|
||
|
if (next.length < 20) {
|
||
|
next += this._input.substr(0, 20 - next.length);
|
||
|
}
|
||
|
return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
|
||
|
},
|
||
|
// displays the character position where the lexing error occurred, i.e. for error messages
|
||
|
showPosition: function () {
|
||
|
var pre = this.pastInput();
|
||
|
var c = new Array(pre.length + 1).join("-");
|
||
|
return pre + this.upcomingInput() + "\n" + c + "^";
|
||
|
},
|
||
|
// test the lexed token: return FALSE when not a match, otherwise return token
|
||
|
test_match: function (match, indexed_rule) {
|
||
|
var token, lines, backup;
|
||
|
if (this.options.backtrack_lexer) {
|
||
|
// save context
|
||
|
backup = {
|
||
|
yylineno: this.yylineno,
|
||
|
yylloc: {
|
||
|
first_line: this.yylloc.first_line,
|
||
|
last_line: this.last_line,
|
||
|
first_column: this.yylloc.first_column,
|
||
|
last_column: this.yylloc.last_column
|
||
|
},
|
||
|
yytext: this.yytext,
|
||
|
match: this.match,
|
||
|
matches: this.matches,
|
||
|
matched: this.matched,
|
||
|
yyleng: this.yyleng,
|
||
|
offset: this.offset,
|
||
|
_more: this._more,
|
||
|
_input: this._input,
|
||
|
yy: this.yy,
|
||
|
conditionStack: this.conditionStack.slice(0),
|
||
|
done: this.done
|
||
|
};
|
||
|
if (this.options.ranges) {
|
||
|
backup.yylloc.range = this.yylloc.range.slice(0);
|
||
|
}
|
||
|
}
|
||
|
lines = match[0].match(/(?:\r\n?|\n).*/g);
|
||
|
if (lines) {
|
||
|
this.yylineno += lines.length;
|
||
|
}
|
||
|
this.yylloc = {
|
||
|
first_line: this.yylloc.last_line,
|
||
|
last_line: this.yylineno + 1,
|
||
|
first_column: this.yylloc.last_column,
|
||
|
last_column: lines ?
|
||
|
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
|
||
|
this.yylloc.last_column + match[0].length
|
||
|
};
|
||
|
this.yytext += match[0];
|
||
|
this.match += match[0];
|
||
|
this.matches = match;
|
||
|
this.yyleng = this.yytext.length;
|
||
|
if (this.options.ranges) {
|
||
|
this.yylloc.range = [this.offset, this.offset += this.yyleng];
|
||
|
}
|
||
|
this._more = false;
|
||
|
this._backtrack = false;
|
||
|
this._input = this._input.slice(match[0].length);
|
||
|
this.matched += match[0];
|
||
|
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
|
||
|
if (this.done && this._input) {
|
||
|
this.done = false;
|
||
|
}
|
||
|
if (token) {
|
||
|
return token;
|
||
|
}
|
||
|
else if (this._backtrack) {
|
||
|
// recover context
|
||
|
for (var k in backup) {
|
||
|
this[k] = backup[k];
|
||
|
}
|
||
|
return false; // rule action called reject() implying the next rule should be tested instead.
|
||
|
}
|
||
|
return false;
|
||
|
},
|
||
|
// return next match in input
|
||
|
next: function () {
|
||
|
if (this.done) {
|
||
|
return this.EOF;
|
||
|
}
|
||
|
if (!this._input) {
|
||
|
this.done = true;
|
||
|
}
|
||
|
var token, match, tempMatch, index;
|
||
|
if (!this._more) {
|
||
|
this.yytext = '';
|
||
|
this.match = '';
|
||
|
}
|
||
|
var rules = this._currentRules();
|
||
|
for (var i = 0; i < rules.length; i++) {
|
||
|
tempMatch = this._input.match(this.rules[rules[i]]);
|
||
|
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
|
||
|
match = tempMatch;
|
||
|
index = i;
|
||
|
if (this.options.backtrack_lexer) {
|
||
|
token = this.test_match(tempMatch, rules[i]);
|
||
|
if (token !== false) {
|
||
|
return token;
|
||
|
}
|
||
|
else if (this._backtrack) {
|
||
|
match = false;
|
||
|
continue; // rule action called reject() implying a rule MISmatch.
|
||
|
}
|
||
|
else {
|
||
|
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
else if (!this.options.flex) {
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if (match) {
|
||
|
token = this.test_match(match, rules[index]);
|
||
|
if (token !== false) {
|
||
|
return token;
|
||
|
}
|
||
|
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
|
||
|
return false;
|
||
|
}
|
||
|
if (this._input === "") {
|
||
|
return this.EOF;
|
||
|
}
|
||
|
else {
|
||
|
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
|
||
|
text: "",
|
||
|
token: null,
|
||
|
line: this.yylineno
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
// return next match that has a token
|
||
|
lex: function lex() {
|
||
|
var r = this.next();
|
||
|
if (r) {
|
||
|
return r;
|
||
|
}
|
||
|
else {
|
||
|
return this.lex();
|
||
|
}
|
||
|
},
|
||
|
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
||
|
begin: function begin(condition) {
|
||
|
this.conditionStack.push(condition);
|
||
|
},
|
||
|
// pop the previously active lexer condition state off the condition stack
|
||
|
popState: function popState() {
|
||
|
var n = this.conditionStack.length - 1;
|
||
|
if (n > 0) {
|
||
|
return this.conditionStack.pop();
|
||
|
}
|
||
|
else {
|
||
|
return this.conditionStack[0];
|
||
|
}
|
||
|
},
|
||
|
// produce the lexer rule set which is active for the currently active lexer condition state
|
||
|
_currentRules: function _currentRules() {
|
||
|
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
|
||
|
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
|
||
|
}
|
||
|
else {
|
||
|
return this.conditions["INITIAL"].rules;
|
||
|
}
|
||
|
},
|
||
|
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
||
|
topState: function topState(n) {
|
||
|
n = this.conditionStack.length - 1 - Math.abs(n || 0);
|
||
|
if (n >= 0) {
|
||
|
return this.conditionStack[n];
|
||
|
}
|
||
|
else {
|
||
|
return "INITIAL";
|
||
|
}
|
||
|
},
|
||
|
// alias for begin(condition)
|
||
|
pushState: function pushState(condition) {
|
||
|
this.begin(condition);
|
||
|
},
|
||
|
// return the number of states currently on the stack
|
||
|
stateStackSize: function stateStackSize() {
|
||
|
return this.conditionStack.length;
|
||
|
},
|
||
|
options: { "case-insensitive": true, "flex": true },
|
||
|
performAction: function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
|
||
|
var YYSTATE = YY_START;
|
||
|
switch ($avoiding_name_collisions) {
|
||
|
case 0: /* skip whitespace */
|
||
|
break;
|
||
|
case 1: /* skip comments */
|
||
|
break;
|
||
|
case 2: /* skip comments */
|
||
|
break;
|
||
|
case 3:
|
||
|
parser.yy.partialCursor = false;
|
||
|
parser.yy.cursorFound = yy_.yylloc;
|
||
|
return 27;
|
||
|
break;
|
||
|
case 4:
|
||
|
parser.yy.partialCursor = true;
|
||
|
parser.yy.cursorFound = yy_.yylloc;
|
||
|
return 796;
|
||
|
break;
|
||
|
case 5:
|
||
|
return 44;
|
||
|
break;
|
||
|
case 6:
|
||
|
return 321;
|
||
|
break;
|
||
|
case 7:
|
||
|
return 425;
|
||
|
break;
|
||
|
case 8:
|
||
|
return 511;
|
||
|
break;
|
||
|
case 9:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('ALTER', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 38;
|
||
|
break;
|
||
|
case 10:
|
||
|
return 512;
|
||
|
break;
|
||
|
case 11:
|
||
|
return 513;
|
||
|
break;
|
||
|
case 12:
|
||
|
return 430;
|
||
|
break;
|
||
|
case 13:
|
||
|
return 514;
|
||
|
break;
|
||
|
case 14:
|
||
|
return 516;
|
||
|
break;
|
||
|
case 15:
|
||
|
return 518;
|
||
|
break;
|
||
|
case 16:
|
||
|
return 519;
|
||
|
break;
|
||
|
case 17:
|
||
|
return 136;
|
||
|
break;
|
||
|
case 18:
|
||
|
return 520;
|
||
|
break;
|
||
|
case 19:
|
||
|
return 521;
|
||
|
break;
|
||
|
case 20:
|
||
|
return 522;
|
||
|
break;
|
||
|
case 21:
|
||
|
return 523;
|
||
|
break;
|
||
|
case 22:
|
||
|
return 524;
|
||
|
break;
|
||
|
case 23:
|
||
|
return 151;
|
||
|
break;
|
||
|
case 24:
|
||
|
return 288;
|
||
|
break;
|
||
|
case 25:
|
||
|
return 527;
|
||
|
break;
|
||
|
case 26:
|
||
|
return 528;
|
||
|
break;
|
||
|
case 27:
|
||
|
return 529;
|
||
|
break;
|
||
|
case 28:
|
||
|
return 530;
|
||
|
break;
|
||
|
case 29:
|
||
|
return 531;
|
||
|
break;
|
||
|
case 30:
|
||
|
return 85;
|
||
|
break;
|
||
|
case 31:
|
||
|
return 532;
|
||
|
break;
|
||
|
case 32:
|
||
|
return 533;
|
||
|
break;
|
||
|
case 33:
|
||
|
return 257;
|
||
|
break;
|
||
|
case 34:
|
||
|
return 535;
|
||
|
break;
|
||
|
case 35:
|
||
|
return 536;
|
||
|
break;
|
||
|
case 36:
|
||
|
return 537;
|
||
|
break;
|
||
|
case 37:
|
||
|
return 538;
|
||
|
break;
|
||
|
case 38:
|
||
|
return 539;
|
||
|
break;
|
||
|
case 39:
|
||
|
return 540;
|
||
|
break;
|
||
|
case 40:
|
||
|
return 111;
|
||
|
break;
|
||
|
case 41:
|
||
|
return 542;
|
||
|
break;
|
||
|
case 42:
|
||
|
return 543;
|
||
|
break;
|
||
|
case 43:
|
||
|
return 544;
|
||
|
break;
|
||
|
case 44:
|
||
|
return 350;
|
||
|
break;
|
||
|
case 45:
|
||
|
return 545;
|
||
|
break;
|
||
|
case 46:
|
||
|
return 546;
|
||
|
break;
|
||
|
case 47:
|
||
|
return 65;
|
||
|
break;
|
||
|
case 48:
|
||
|
return 117;
|
||
|
break;
|
||
|
case 49:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 86;
|
||
|
break;
|
||
|
case 50:
|
||
|
return 547;
|
||
|
break;
|
||
|
case 51:
|
||
|
return 87;
|
||
|
break;
|
||
|
case 52:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 155;
|
||
|
break;
|
||
|
case 53:
|
||
|
return 548;
|
||
|
break;
|
||
|
case 54:
|
||
|
return 549;
|
||
|
break;
|
||
|
case 55:
|
||
|
return 550;
|
||
|
break;
|
||
|
case 56:
|
||
|
return 551;
|
||
|
break;
|
||
|
case 57:
|
||
|
return 552;
|
||
|
break;
|
||
|
case 58:
|
||
|
return 553;
|
||
|
break;
|
||
|
case 59:
|
||
|
return 554;
|
||
|
break;
|
||
|
case 60:
|
||
|
return 555;
|
||
|
break;
|
||
|
case 61:
|
||
|
return 557;
|
||
|
break;
|
||
|
case 62:
|
||
|
return 558;
|
||
|
break;
|
||
|
case 63:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('CREATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 170;
|
||
|
break;
|
||
|
case 64:
|
||
|
return 431;
|
||
|
break;
|
||
|
case 65:
|
||
|
return 559;
|
||
|
break;
|
||
|
case 66:
|
||
|
return 560;
|
||
|
break;
|
||
|
case 67:
|
||
|
return 561;
|
||
|
break;
|
||
|
case 68:
|
||
|
return 562;
|
||
|
break;
|
||
|
case 69:
|
||
|
return 563;
|
||
|
break;
|
||
|
case 70:
|
||
|
return 564;
|
||
|
break;
|
||
|
case 71:
|
||
|
return 565;
|
||
|
break;
|
||
|
case 72:
|
||
|
return 566;
|
||
|
break;
|
||
|
case 73:
|
||
|
return 567;
|
||
|
break;
|
||
|
case 74:
|
||
|
return 568;
|
||
|
break;
|
||
|
case 75:
|
||
|
return 569;
|
||
|
break;
|
||
|
case 76:
|
||
|
return 495;
|
||
|
break;
|
||
|
case 77:
|
||
|
return 143;
|
||
|
break;
|
||
|
case 78:
|
||
|
return 570;
|
||
|
break;
|
||
|
case 79:
|
||
|
return 571;
|
||
|
break;
|
||
|
case 80:
|
||
|
return 572;
|
||
|
break;
|
||
|
case 81:
|
||
|
return 573;
|
||
|
break;
|
||
|
case 82:
|
||
|
return 574;
|
||
|
break;
|
||
|
case 83:
|
||
|
return 575;
|
||
|
break;
|
||
|
case 84:
|
||
|
return 576;
|
||
|
break;
|
||
|
case 85:
|
||
|
return 392;
|
||
|
break;
|
||
|
case 86:
|
||
|
return 295;
|
||
|
break;
|
||
|
case 87:
|
||
|
return 577;
|
||
|
break;
|
||
|
case 88:
|
||
|
return 578;
|
||
|
break;
|
||
|
case 89:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('DESCRIBE', yy_.yylloc);
|
||
|
return 839;
|
||
|
break;
|
||
|
case 90:
|
||
|
return 579;
|
||
|
break;
|
||
|
case 91:
|
||
|
return 580;
|
||
|
break;
|
||
|
case 92:
|
||
|
return 581;
|
||
|
break;
|
||
|
case 93:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 94:
|
||
|
return 582;
|
||
|
break;
|
||
|
case 95:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('DROP', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 63;
|
||
|
break;
|
||
|
case 96:
|
||
|
return 583;
|
||
|
break;
|
||
|
case 97:
|
||
|
return 584;
|
||
|
break;
|
||
|
case 98:
|
||
|
return 585;
|
||
|
break;
|
||
|
case 99:
|
||
|
return 586;
|
||
|
break;
|
||
|
case 100:
|
||
|
return 587;
|
||
|
break;
|
||
|
case 101:
|
||
|
return 88;
|
||
|
break;
|
||
|
case 102:
|
||
|
return 588;
|
||
|
break;
|
||
|
case 103:
|
||
|
return 589;
|
||
|
break;
|
||
|
case 104:
|
||
|
return 590;
|
||
|
break;
|
||
|
case 105:
|
||
|
return 591;
|
||
|
break;
|
||
|
case 106:
|
||
|
return 592;
|
||
|
break;
|
||
|
case 107:
|
||
|
return 303;
|
||
|
break;
|
||
|
case 108:
|
||
|
return 593;
|
||
|
break;
|
||
|
case 109:
|
||
|
return 594;
|
||
|
break;
|
||
|
case 110:
|
||
|
return 595;
|
||
|
break;
|
||
|
case 111:
|
||
|
return 596;
|
||
|
break;
|
||
|
case 112:
|
||
|
parser.yy.correlatedSubQuery = true;
|
||
|
return 597;
|
||
|
break;
|
||
|
case 113:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('EXPLAIN', yy_.yylloc);
|
||
|
return 505;
|
||
|
break;
|
||
|
case 114:
|
||
|
return 598;
|
||
|
break;
|
||
|
case 115:
|
||
|
return 599;
|
||
|
break;
|
||
|
case 116:
|
||
|
return 601;
|
||
|
break;
|
||
|
case 117:
|
||
|
return 602;
|
||
|
break;
|
||
|
case 118:
|
||
|
return 300;
|
||
|
break;
|
||
|
case 119:
|
||
|
return 98;
|
||
|
break;
|
||
|
case 120:
|
||
|
return 603;
|
||
|
break;
|
||
|
case 121:
|
||
|
return 604;
|
||
|
break;
|
||
|
case 122:
|
||
|
return 352;
|
||
|
break;
|
||
|
case 123:
|
||
|
return 605;
|
||
|
break;
|
||
|
case 124:
|
||
|
return 606;
|
||
|
break;
|
||
|
case 125:
|
||
|
return 607;
|
||
|
break;
|
||
|
case 126:
|
||
|
return 608;
|
||
|
break;
|
||
|
case 127:
|
||
|
return 609;
|
||
|
break;
|
||
|
case 128:
|
||
|
return 107;
|
||
|
break;
|
||
|
case 129:
|
||
|
return 610;
|
||
|
break;
|
||
|
case 130:
|
||
|
return 611;
|
||
|
break;
|
||
|
case 131:
|
||
|
return 612;
|
||
|
break;
|
||
|
case 132:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 394;
|
||
|
break;
|
||
|
case 133:
|
||
|
return 427;
|
||
|
break;
|
||
|
case 134:
|
||
|
return 315;
|
||
|
break;
|
||
|
case 135:
|
||
|
return 149;
|
||
|
break;
|
||
|
case 136:
|
||
|
return 613;
|
||
|
break;
|
||
|
case 137:
|
||
|
return 614;
|
||
|
break;
|
||
|
case 138:
|
||
|
return 615;
|
||
|
break;
|
||
|
case 139:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('GRANT', yy_.yylloc);
|
||
|
return 452;
|
||
|
break;
|
||
|
case 140:
|
||
|
return 453;
|
||
|
break;
|
||
|
case 141:
|
||
|
return 617;
|
||
|
break;
|
||
|
case 142:
|
||
|
return 618;
|
||
|
break;
|
||
|
case 143:
|
||
|
return 264;
|
||
|
break;
|
||
|
case 144:
|
||
|
return 619;
|
||
|
break;
|
||
|
case 145:
|
||
|
return 621;
|
||
|
break;
|
||
|
case 146:
|
||
|
return 622;
|
||
|
break;
|
||
|
case 147:
|
||
|
return 623;
|
||
|
break;
|
||
|
case 148:
|
||
|
return 624;
|
||
|
break;
|
||
|
case 149:
|
||
|
return 625;
|
||
|
break;
|
||
|
case 150:
|
||
|
return 158;
|
||
|
break;
|
||
|
case 151:
|
||
|
return 626;
|
||
|
break;
|
||
|
case 152:
|
||
|
return 344;
|
||
|
break;
|
||
|
case 153:
|
||
|
return 627;
|
||
|
break;
|
||
|
case 154:
|
||
|
return 432;
|
||
|
break;
|
||
|
case 155:
|
||
|
return 628;
|
||
|
break;
|
||
|
case 156:
|
||
|
this.begin('hdfs');
|
||
|
return 496;
|
||
|
break;
|
||
|
case 157:
|
||
|
return 629;
|
||
|
break;
|
||
|
case 158:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('INSERT', yy_.yylloc);
|
||
|
return 463;
|
||
|
break;
|
||
|
case 159:
|
||
|
return 630;
|
||
|
break;
|
||
|
case 160:
|
||
|
return 353;
|
||
|
break;
|
||
|
case 161:
|
||
|
return 631;
|
||
|
break;
|
||
|
case 162:
|
||
|
return 632;
|
||
|
break;
|
||
|
case 163:
|
||
|
return 633;
|
||
|
break;
|
||
|
case 164:
|
||
|
return 484;
|
||
|
break;
|
||
|
case 165:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('INVALIDATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 153;
|
||
|
break;
|
||
|
case 166:
|
||
|
return 634;
|
||
|
break;
|
||
|
case 167:
|
||
|
return 144;
|
||
|
break;
|
||
|
case 168:
|
||
|
return 435;
|
||
|
break;
|
||
|
case 169:
|
||
|
return 635;
|
||
|
break;
|
||
|
case 170:
|
||
|
return 636;
|
||
|
break;
|
||
|
case 171:
|
||
|
return 637;
|
||
|
break;
|
||
|
case 172:
|
||
|
return 638;
|
||
|
break;
|
||
|
case 173:
|
||
|
return 639;
|
||
|
break;
|
||
|
case 174:
|
||
|
return 640;
|
||
|
break;
|
||
|
case 175:
|
||
|
return 641;
|
||
|
break;
|
||
|
case 176:
|
||
|
return 642;
|
||
|
break;
|
||
|
case 177:
|
||
|
return 643;
|
||
|
break;
|
||
|
case 178:
|
||
|
return 254;
|
||
|
break;
|
||
|
case 179:
|
||
|
return 289;
|
||
|
break;
|
||
|
case 180:
|
||
|
return 644;
|
||
|
break;
|
||
|
case 181:
|
||
|
return 645;
|
||
|
break;
|
||
|
case 182:
|
||
|
return 646;
|
||
|
break;
|
||
|
case 183:
|
||
|
return 647;
|
||
|
break;
|
||
|
case 184:
|
||
|
return 428;
|
||
|
break;
|
||
|
case 185:
|
||
|
return 208;
|
||
|
break;
|
||
|
case 186:
|
||
|
return 648;
|
||
|
break;
|
||
|
case 187:
|
||
|
return 649;
|
||
|
break;
|
||
|
case 188:
|
||
|
return 360;
|
||
|
break;
|
||
|
case 189:
|
||
|
return 304;
|
||
|
break;
|
||
|
case 190:
|
||
|
return 650;
|
||
|
break;
|
||
|
case 191:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('LOAD', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 494;
|
||
|
break;
|
||
|
case 192:
|
||
|
return 651;
|
||
|
break;
|
||
|
case 193:
|
||
|
return 652;
|
||
|
break;
|
||
|
case 194:
|
||
|
this.begin('hdfs');
|
||
|
return 653;
|
||
|
break;
|
||
|
case 195:
|
||
|
return 654;
|
||
|
break;
|
||
|
case 196:
|
||
|
return 655;
|
||
|
break;
|
||
|
case 197:
|
||
|
return 656;
|
||
|
break;
|
||
|
case 198:
|
||
|
return 657;
|
||
|
break;
|
||
|
case 199:
|
||
|
return 659;
|
||
|
break;
|
||
|
case 200:
|
||
|
return 348;
|
||
|
break;
|
||
|
case 201:
|
||
|
return 154;
|
||
|
break;
|
||
|
case 202:
|
||
|
return 660;
|
||
|
break;
|
||
|
case 203:
|
||
|
return 662;
|
||
|
break;
|
||
|
case 204:
|
||
|
return 663;
|
||
|
break;
|
||
|
case 205:
|
||
|
return 664;
|
||
|
break;
|
||
|
case 206:
|
||
|
return 665;
|
||
|
break;
|
||
|
case 207:
|
||
|
return 666;
|
||
|
break;
|
||
|
case 208:
|
||
|
return 667;
|
||
|
break;
|
||
|
case 209:
|
||
|
return 669;
|
||
|
break;
|
||
|
case 210:
|
||
|
return 670;
|
||
|
break;
|
||
|
case 211:
|
||
|
return 671;
|
||
|
break;
|
||
|
case 212:
|
||
|
return 224;
|
||
|
break;
|
||
|
case 213:
|
||
|
return 672;
|
||
|
break;
|
||
|
case 214:
|
||
|
return 146;
|
||
|
break;
|
||
|
case 215:
|
||
|
return 673;
|
||
|
break;
|
||
|
case 216:
|
||
|
return 674;
|
||
|
break;
|
||
|
case 217:
|
||
|
return 675;
|
||
|
break;
|
||
|
case 218:
|
||
|
return 676;
|
||
|
break;
|
||
|
case 219:
|
||
|
return 677;
|
||
|
break;
|
||
|
case 220:
|
||
|
return 877;
|
||
|
break;
|
||
|
case 221:
|
||
|
return 678;
|
||
|
break;
|
||
|
case 222:
|
||
|
return 142;
|
||
|
break;
|
||
|
case 223:
|
||
|
return 679;
|
||
|
break;
|
||
|
case 224:
|
||
|
return 680;
|
||
|
break;
|
||
|
case 225:
|
||
|
return 465;
|
||
|
break;
|
||
|
case 226:
|
||
|
return 681;
|
||
|
break;
|
||
|
case 227:
|
||
|
return 290;
|
||
|
break;
|
||
|
case 228:
|
||
|
return 682;
|
||
|
break;
|
||
|
case 229:
|
||
|
return 683;
|
||
|
break;
|
||
|
case 230:
|
||
|
return 433;
|
||
|
break;
|
||
|
case 231:
|
||
|
return 684;
|
||
|
break;
|
||
|
case 232:
|
||
|
return 685;
|
||
|
break;
|
||
|
case 233:
|
||
|
return 686;
|
||
|
break;
|
||
|
case 234:
|
||
|
return 487;
|
||
|
break;
|
||
|
case 235:
|
||
|
return 291;
|
||
|
break;
|
||
|
case 236:
|
||
|
return 51;
|
||
|
break;
|
||
|
case 237:
|
||
|
return 256;
|
||
|
break;
|
||
|
case 238:
|
||
|
return 71;
|
||
|
break;
|
||
|
case 239:
|
||
|
return 687;
|
||
|
break;
|
||
|
case 240:
|
||
|
return 688;
|
||
|
break;
|
||
|
case 241:
|
||
|
return 689;
|
||
|
break;
|
||
|
case 242:
|
||
|
return 690;
|
||
|
break;
|
||
|
case 243:
|
||
|
return 691;
|
||
|
break;
|
||
|
case 244:
|
||
|
return 692;
|
||
|
break;
|
||
|
case 245:
|
||
|
return 693;
|
||
|
break;
|
||
|
case 246:
|
||
|
return 694;
|
||
|
break;
|
||
|
case 247:
|
||
|
return 695;
|
||
|
break;
|
||
|
case 248:
|
||
|
return 696;
|
||
|
break;
|
||
|
case 249:
|
||
|
return 697;
|
||
|
break;
|
||
|
case 250:
|
||
|
return 349;
|
||
|
break;
|
||
|
case 251:
|
||
|
return 253;
|
||
|
break;
|
||
|
case 252:
|
||
|
return 698;
|
||
|
break;
|
||
|
case 253:
|
||
|
return 699;
|
||
|
break;
|
||
|
case 254:
|
||
|
return 390;
|
||
|
break;
|
||
|
case 255:
|
||
|
return 50;
|
||
|
break;
|
||
|
case 256:
|
||
|
return 292;
|
||
|
break;
|
||
|
case 257:
|
||
|
return 700;
|
||
|
break;
|
||
|
case 258:
|
||
|
return 701;
|
||
|
break;
|
||
|
case 259:
|
||
|
return 70;
|
||
|
break;
|
||
|
case 260:
|
||
|
return 702;
|
||
|
break;
|
||
|
case 261:
|
||
|
return 703;
|
||
|
break;
|
||
|
case 262:
|
||
|
return 704;
|
||
|
break;
|
||
|
case 263:
|
||
|
return 705;
|
||
|
break;
|
||
|
case 264:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('REFRESH', yy_.yylloc);
|
||
|
return 147;
|
||
|
break;
|
||
|
case 265:
|
||
|
return 706;
|
||
|
break;
|
||
|
case 266:
|
||
|
return 707;
|
||
|
break;
|
||
|
case 267:
|
||
|
return 708;
|
||
|
break;
|
||
|
case 268:
|
||
|
return 709;
|
||
|
break;
|
||
|
case 269:
|
||
|
return 710;
|
||
|
break;
|
||
|
case 270:
|
||
|
return 711;
|
||
|
break;
|
||
|
case 271:
|
||
|
return 712;
|
||
|
break;
|
||
|
case 272:
|
||
|
return 713;
|
||
|
break;
|
||
|
case 273:
|
||
|
return 714;
|
||
|
break;
|
||
|
case 274:
|
||
|
return 715;
|
||
|
break;
|
||
|
case 275:
|
||
|
return 56;
|
||
|
break;
|
||
|
case 276:
|
||
|
return 716;
|
||
|
break;
|
||
|
case 277:
|
||
|
return 73;
|
||
|
break;
|
||
|
case 278:
|
||
|
return 717;
|
||
|
break;
|
||
|
case 279:
|
||
|
return 718;
|
||
|
break;
|
||
|
case 280:
|
||
|
return 342;
|
||
|
break;
|
||
|
case 281:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('REVOKE', yy_.yylloc);
|
||
|
return 466;
|
||
|
break;
|
||
|
case 282:
|
||
|
return 429;
|
||
|
break;
|
||
|
case 283:
|
||
|
return 719;
|
||
|
break;
|
||
|
case 284:
|
||
|
return 359;
|
||
|
break;
|
||
|
case 285:
|
||
|
return 720;
|
||
|
break;
|
||
|
case 286:
|
||
|
return 721;
|
||
|
break;
|
||
|
case 287:
|
||
|
return 722;
|
||
|
break;
|
||
|
case 288:
|
||
|
return 106;
|
||
|
break;
|
||
|
case 289:
|
||
|
return 723;
|
||
|
break;
|
||
|
case 290:
|
||
|
return 724;
|
||
|
break;
|
||
|
case 291:
|
||
|
return 725;
|
||
|
break;
|
||
|
case 292:
|
||
|
return 726;
|
||
|
break;
|
||
|
case 293:
|
||
|
return 727;
|
||
|
break;
|
||
|
case 294:
|
||
|
return 728;
|
||
|
break;
|
||
|
case 295:
|
||
|
return 729;
|
||
|
break;
|
||
|
case 296:
|
||
|
return 730;
|
||
|
break;
|
||
|
case 297:
|
||
|
return 731;
|
||
|
break;
|
||
|
case 298:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('SELECT', yy_.yylloc);
|
||
|
return 411;
|
||
|
break;
|
||
|
case 299:
|
||
|
return 434;
|
||
|
break;
|
||
|
case 300:
|
||
|
return 732;
|
||
|
break;
|
||
|
case 301:
|
||
|
return 293;
|
||
|
break;
|
||
|
case 302:
|
||
|
return 103;
|
||
|
break;
|
||
|
case 303:
|
||
|
return 351;
|
||
|
break;
|
||
|
case 304:
|
||
|
return 461;
|
||
|
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 1005;
|
||
|
break;
|
||
|
case 307:
|
||
|
return 733;
|
||
|
break;
|
||
|
case 308:
|
||
|
return 734;
|
||
|
break;
|
||
|
case 309:
|
||
|
return 735;
|
||
|
break;
|
||
|
case 310:
|
||
|
return 736;
|
||
|
break;
|
||
|
case 311:
|
||
|
return 268;
|
||
|
break;
|
||
|
case 312:
|
||
|
return 737;
|
||
|
break;
|
||
|
case 313:
|
||
|
return 738;
|
||
|
break;
|
||
|
case 314:
|
||
|
return 739;
|
||
|
break;
|
||
|
case 315:
|
||
|
return 740;
|
||
|
break;
|
||
|
case 316:
|
||
|
return 741;
|
||
|
break;
|
||
|
case 317:
|
||
|
return 742;
|
||
|
break;
|
||
|
case 318:
|
||
|
return 66;
|
||
|
break;
|
||
|
case 319:
|
||
|
return 287;
|
||
|
break;
|
||
|
case 320:
|
||
|
return 746;
|
||
|
break;
|
||
|
case 321:
|
||
|
return 747;
|
||
|
break;
|
||
|
case 322:
|
||
|
return 748;
|
||
|
break;
|
||
|
case 323:
|
||
|
return 749;
|
||
|
break;
|
||
|
case 324:
|
||
|
return 750;
|
||
|
break;
|
||
|
case 325:
|
||
|
return 751;
|
||
|
break;
|
||
|
case 326:
|
||
|
return 343;
|
||
|
break;
|
||
|
case 327:
|
||
|
return 753;
|
||
|
break;
|
||
|
case 328:
|
||
|
return 754;
|
||
|
break;
|
||
|
case 329:
|
||
|
return 755;
|
||
|
break;
|
||
|
case 330:
|
||
|
return 129;
|
||
|
break;
|
||
|
case 331:
|
||
|
return 756;
|
||
|
break;
|
||
|
case 332:
|
||
|
return 757;
|
||
|
break;
|
||
|
case 333:
|
||
|
return 101;
|
||
|
break;
|
||
|
case 334:
|
||
|
return 301;
|
||
|
break;
|
||
|
case 335:
|
||
|
return 294;
|
||
|
break;
|
||
|
case 336:
|
||
|
return 758;
|
||
|
break;
|
||
|
case 337:
|
||
|
return 759;
|
||
|
break;
|
||
|
case 338:
|
||
|
return 760;
|
||
|
break;
|
||
|
case 339:
|
||
|
return 761;
|
||
|
break;
|
||
|
case 340:
|
||
|
return 762;
|
||
|
break;
|
||
|
case 341:
|
||
|
return 57;
|
||
|
break;
|
||
|
case 342:
|
||
|
return 763;
|
||
|
break;
|
||
|
case 343:
|
||
|
return 764;
|
||
|
break;
|
||
|
case 344:
|
||
|
return 765;
|
||
|
break;
|
||
|
case 345:
|
||
|
return 766;
|
||
|
break;
|
||
|
case 346:
|
||
|
return 767;
|
||
|
break;
|
||
|
case 347:
|
||
|
return 768;
|
||
|
break;
|
||
|
case 348:
|
||
|
return 769;
|
||
|
break;
|
||
|
case 349:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('TRUNCATE', yy_.yylloc, yy.lexer.upcomingInput());
|
||
|
return 391;
|
||
|
break;
|
||
|
case 350:
|
||
|
return 770;
|
||
|
break;
|
||
|
case 351:
|
||
|
return 982;
|
||
|
break;
|
||
|
case 352:
|
||
|
return 109;
|
||
|
break;
|
||
|
case 353:
|
||
|
return 771;
|
||
|
break;
|
||
|
case 354:
|
||
|
return 772;
|
||
|
break;
|
||
|
case 355:
|
||
|
return 879;
|
||
|
break;
|
||
|
case 356:
|
||
|
return 773;
|
||
|
break;
|
||
|
case 357:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
return 1020;
|
||
|
break;
|
||
|
case 358:
|
||
|
return 347;
|
||
|
break;
|
||
|
case 359:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('UPSERT', yy_.yylloc);
|
||
|
return 483;
|
||
|
break;
|
||
|
case 360:
|
||
|
return 462;
|
||
|
break;
|
||
|
case 361:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('USE', yy_.yylloc);
|
||
|
return 1034;
|
||
|
break;
|
||
|
case 362:
|
||
|
return 775;
|
||
|
break;
|
||
|
case 363:
|
||
|
return 776;
|
||
|
break;
|
||
|
case 364:
|
||
|
return 777;
|
||
|
break;
|
||
|
case 365:
|
||
|
return 275;
|
||
|
break;
|
||
|
case 366:
|
||
|
return 780;
|
||
|
break;
|
||
|
case 367:
|
||
|
return 781;
|
||
|
break;
|
||
|
case 368:
|
||
|
return 785;
|
||
|
break;
|
||
|
case 369:
|
||
|
return 786;
|
||
|
break;
|
||
|
case 370:
|
||
|
return 141;
|
||
|
break;
|
||
|
case 371:
|
||
|
return 787;
|
||
|
break;
|
||
|
case 372:
|
||
|
return 788;
|
||
|
break;
|
||
|
case 373:
|
||
|
return 789;
|
||
|
break;
|
||
|
case 374:
|
||
|
return 790;
|
||
|
break;
|
||
|
case 375:
|
||
|
return 791;
|
||
|
break;
|
||
|
case 376:
|
||
|
parser.determineCase(yy_.yytext);
|
||
|
parser.addStatementTypeLocation('WITH', yy_.yylloc);
|
||
|
return 306;
|
||
|
break;
|
||
|
case 377:
|
||
|
return 792;
|
||
|
break;
|
||
|
case 378:
|
||
|
return 793;
|
||
|
break;
|
||
|
case 379:
|
||
|
this.begin('hdfs');
|
||
|
return 206;
|
||
|
break;
|
||
|
case 380:
|
||
|
return 53;
|
||
|
break;
|
||
|
case 381:
|
||
|
return 684;
|
||
|
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 534;
|
||
|
break;
|
||
|
case 389:
|
||
|
return 489;
|
||
|
break;
|
||
|
case 390:
|
||
|
return 488;
|
||
|
break;
|
||
|
case 391:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'appx_median';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 515;
|
||
|
break;
|
||
|
case 392:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'avg';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 525;
|
||
|
break;
|
||
|
case 393:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'cast';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 541;
|
||
|
break;
|
||
|
case 394:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'count';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 556;
|
||
|
break;
|
||
|
case 395:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'extract';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 600;
|
||
|
break;
|
||
|
case 396:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'group_concat';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 616;
|
||
|
break;
|
||
|
case 397:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'left';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 962;
|
||
|
break;
|
||
|
case 398:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'max';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 658;
|
||
|
break;
|
||
|
case 399:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'min';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 661;
|
||
|
break;
|
||
|
case 400:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'ndv';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 668;
|
||
|
break;
|
||
|
case 401:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 743;
|
||
|
break;
|
||
|
case 402:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 744;
|
||
|
break;
|
||
|
case 403:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'stddev_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 745;
|
||
|
break;
|
||
|
case 404:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'sum';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 752;
|
||
|
break;
|
||
|
case 405:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'var_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 778;
|
||
|
break;
|
||
|
case 406:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'var_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 779;
|
||
|
break;
|
||
|
case 407:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 782;
|
||
|
break;
|
||
|
case 408:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance_pop';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 783;
|
||
|
break;
|
||
|
case 409:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'variance_samp';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 784;
|
||
|
break;
|
||
|
case 410:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'cume_dist';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 411:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'dense_rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 412:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'first_value';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 413:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'lag';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 414:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'last_value';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 415:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'lead';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 416:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'ntile';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 417:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'percent_rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 418:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'rank';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 419:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'row_number';
|
||
|
parser.addFunctionLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 512;
|
||
|
break;
|
||
|
case 420:
|
||
|
yy.lexer.unput('(');
|
||
|
yy_.yytext = 'system';
|
||
|
return 929;
|
||
|
break;
|
||
|
case 421:
|
||
|
return 361;
|
||
|
break;
|
||
|
case 422:
|
||
|
return 361;
|
||
|
break;
|
||
|
case 423:
|
||
|
return 774;
|
||
|
break;
|
||
|
case 424:
|
||
|
return 503;
|
||
|
break;
|
||
|
case 425:
|
||
|
parser.yy.cursorFound = true;
|
||
|
return 27;
|
||
|
break;
|
||
|
case 426:
|
||
|
parser.yy.cursorFound = true;
|
||
|
return 796;
|
||
|
break;
|
||
|
case 427:
|
||
|
return 620;
|
||
|
break;
|
||
|
case 428:
|
||
|
parser.addFileLocation(yy_.yylloc, yy_.yytext);
|
||
|
return 987;
|
||
|
break;
|
||
|
case 429:
|
||
|
this.popState();
|
||
|
return 988;
|
||
|
break;
|
||
|
case 430:
|
||
|
return 499;
|
||
|
break;
|
||
|
case 431:
|
||
|
return 513;
|
||
|
break;
|
||
|
case 432:
|
||
|
return 681;
|
||
|
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 508;
|
||
|
break;
|
||
|
case 442:
|
||
|
return 507;
|
||
|
break;
|
||
|
case 443:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 444:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 445:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 446:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 447:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 448:
|
||
|
return 517;
|
||
|
break;
|
||
|
case 449:
|
||
|
return 95;
|
||
|
break;
|
||
|
case 450:
|
||
|
return 138;
|
||
|
break;
|
||
|
case 451:
|
||
|
return 341;
|
||
|
break;
|
||
|
case 452:
|
||
|
return 248;
|
||
|
break;
|
||
|
case 453:
|
||
|
return 404;
|
||
|
break;
|
||
|
case 454:
|
||
|
return 794;
|
||
|
break;
|
||
|
case 455:
|
||
|
return 506;
|
||
|
break;
|
||
|
case 456:
|
||
|
return 89;
|
||
|
break;
|
||
|
case 457:
|
||
|
return 91;
|
||
|
break;
|
||
|
case 458:
|
||
|
return 509;
|
||
|
break;
|
||
|
case 459:
|
||
|
return 510;
|
||
|
break;
|
||
|
case 460:
|
||
|
return 504;
|
||
|
break;
|
||
|
case 461:
|
||
|
this.begin('backtickedValue');
|
||
|
return 526;
|
||
|
break;
|
||
|
case 462:
|
||
|
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '`')) {
|
||
|
return 799;
|
||
|
}
|
||
|
return 181;
|
||
|
break;
|
||
|
case 463:
|
||
|
this.popState();
|
||
|
return 526;
|
||
|
break;
|
||
|
case 464:
|
||
|
this.begin('singleQuotedValue');
|
||
|
return 179;
|
||
|
break;
|
||
|
case 465:
|
||
|
if (parser.handleQuotedValueWithCursor(this, yy_.yytext, yy_.yylloc, '\'')) {
|
||
|
return 799;
|
||
|
}
|
||
|
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 799;
|
||
|
}
|
||
|
return 181;
|
||
|
break;
|
||
|
case 469:
|
||
|
this.popState();
|
||
|
return 180;
|
||
|
break;
|
||
|
case 470:
|
||
|
return 499;
|
||
|
break;
|
||
|
case 471: /* To prevent console logging of unknown chars */
|
||
|
break;
|
||
|
case 472:
|
||
|
break;
|
||
|
case 473:
|
||
|
break;
|
||
|
case 474:
|
||
|
break;
|
||
|
case 475:
|
||
|
break;
|
||
|
case 476:
|
||
|
console.log(yy_.yytext);
|
||
|
break;
|
||
|
}
|
||
|
},
|
||
|
rules: [/^(?:\s)/i, /^(?:--.*)/i, /^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/i, /^(?:\u2020)/i, /^(?:\u2021)/i, /^(?:ADD)/i, /^(?:AGGREGATE)/i, /^(?:ALL)/i, /^(?:ALLOCATE)/i, /^(?:ALTER)/i, /^(?:ANALYTIC)/i, /^(?:AND)/i, /^(?:ANTI)/i, /^(?:ANY)/i, /^(?:ARE)/i, /^(?:ARRAY_AGG)/i, /^(?:ARRAY_MAX_CARDINALITY)/i, /^(?:AS)/i, /^(?:ASC)/i, /^(?:ASENSITIVE)/i, /^(?:ASYMMETRIC)/i, /^(?:AT)/i, /^(?:ATOMIC)/i, /^(?:AUTHORIZATION)/i, /^(?:AVRO)/i, /^(?:BEGIN_FRAME)/i, /^(?:BEGIN_PARTITION)/i, /^(?:BETWEEN)/i, /^(?:BIGINT)/i, /^(?:BLOB)/i, /^(?:BLOCK_SIZE)/i, /^(?:BOOLEAN)/i, /^(?:BOTH)/i, /^(?:BY)/i, /^(?:CACHED)/i, /^(?:CALLED)/i, /^(?:CARDINALITY)/i, /^(?:CASCADE)/i, /^(?:CASCADED)/i, /^(?:CASE)/i, /^(?:CHANGE)/i, /^(?:CHAR)/i, /^(?:CHARACTER)/i, /^(?:CLOB)/i, /^(?:CLOSE_FN)/i, /^(?:COLLATE)/i, /^(?:COLLECT)/i, /^(?:COLUMN)/i, /^(?:COLUMNS)/i, /^(?:COMMENT)/i, /^(?:COMMIT)/i, /^(?:COMPRESSION)/i, /^(?:COMPUTE)/i, /^(?:CONDITION)/i, /^(?:CONNECT)/i, /^(?:CONSTRAINT)/i, /^(?:CONTAINS)/i, /^(?:CONVERT)/i, /^(?:COPY)/i, /^(?:CORR)/i, /^(?:CORRESPONDING)/i, /^(?:COVAR_POP)/i, /^(?:COVAR_SAMP)/i, /^(?:CREATE)/i, /^(?:CROSS)/i, /^(?:CUBE)/i, /^(?:CURRENT)/i, /^(?:CURRENT_DATE)/i, /^(?:CURRENT_DEFAULT_TRANSFORM_GROUP)/i, /^(?:CURRENT_PATH)/i, /^(?:CURRENT_ROLE)/i, /^(?:CURRENT_ROW)/i, /^(?:CURRENT_SCHEMA)/i, /^(?:CURRENT_TIME)/i, /^(?:CURRENT_TRANSFORM_GROUP_FOR_TYPE)/i, /^(?:CYCLE)/i, /^(?:DATA)/i, /^(?:DATABASE)/i, /^(?:DATABASES)/i, /^(?:DEALLOCATE)/i, /^(?:DEC)/i, /^(?:DECFLOAT)/i, /^(?:DECIMAL)/i, /^(?:DECLARE)/i, /^(?:DEFINE)/i, /^(?:DELETE)/i, /^(?:DELIMITED)/i, /^(?:DEREF)/i, /^(?:DESC)/i, /^(?:DESCRIBE)/i, /^(?:DETERMINISTIC)/i, /^(?:DISCONNECT)/i, /^(?:DISTINCT)/i, /^(?:DIV)/i, /^(?:DOUBLE)/i, /^(?:DROP)/i, /^(?:DYNAMIC)/i, /^(?:EACH)/i, /^(?:ELEMENT)/i, /^(?:ELSE)/i, /^(?:EMPTY)/i, /^(?:ENCODING)/i, /^(?:END)/i, /^(?:END_FRAME)/i, /^(?:END_PARTITION)/i, /^(?:EQUALS)/i, /^(?:ESCAPE)/i, /^(?:ESCAPED)/i, /^(?:EVERY)/i, /^(?:EXCEPT)/i, /^(?:EXEC)/i, /^(?:EXECUTE)/i, /^(?:EXISTS)/i, /^(?:EXPLAIN)/i, /^(?:EXTENDED)/i, /^(?:EXTERNAL)/i, /^(?:FALSE)/i, /^(?:FETCH)/i, /^(?:FIELDS)/i, /^(?:FILEFORMAT)/i, /^(?:FILES)/i, /^(?:FILTER)/i, /^(?:FINALIZE_FN)/i, /^(?:FIRST)/i, /^(?:FLOAT)/i, /^(?:FOLLOWING)/i, /^(?:FOR)/i, /^(?:FOREIGN)/i, /^(?:FORMAT)/i, /^(?:FORMATTED)/i, /^(?:FRAME_ROW)/i, /^(?:FREE)/i, /^(?:FROM)/i, /^(?:FULL)/i, /^(?:FUNCTION)/i, /^(?:FUNCTIONS)/i, /^(?:FUSION)/i, /^(?:GET)/i, /^(?:GLOBAL)/i, /^(?:GRANT)/i, /^(?:GROUP)/i, /^(?:GROUPING)/i, /^(?:GROUPS)/i, /^(?:HASH)/i, /^(?:HAVING)/i, /^(?:HOLD)/i, /^(?:IF)/i, /^(?:IGNORE)/i, /^(?:ILIKE)/i, /^(?:IN)/i, /^(?:INCREMENTAL)/i, /^(?:INDICATOR)/i, /^(?:INIT_FN)/i, /^(?:INITIAL)/i, /^(?:INNER)/i, /^(?:INOUT)/i, /^(?:INPATH)/i, /^(?:INSENSITIVE)/i, /^(?:INSERT)/i, /^(?:INT)/i, /^(?:INTERMEDIATE)/i, /^(?:INTERSECT)/i, /^(?:INTERSECTION)/i, /^(?:INTERVAL)/i, /^(?:INTO)/i, /^(?:INVALIDATE)/i, /^(?:IREGEXP)/i, /^(?:IS)/i, /^(?:JOIN)/i, /^(?:JSON_ARRAY)/i, /^(?:JSON_ARRAYAGG)/i, /^(?:JSON_EXISTS)/i, /^(?:JSON_OBJECT)/i, /^(?:JSON_OBJECTAGG)/i, /^(?:JSON_QUERY)/i, /^(?:JSON_TABLE)/i, /^(?:JSON_TABLE_PRIMITIVE)/i, /^(?:JSON_VALUE)/i, /^(?:KEY)/i, /^(?:KUDU)/i, /^(?:LARGE)/i, /^(?:LAST)/i, /^(?:LATERAL)/i, /^(?:LEADING)/i, /^(?:LEFT)/i, /^(?:LIKE)/i, /^(?:LIKE_REGEX)/i, /^(?:LIMIT)/i, /^(?:LIFECYCLE)/i, /^(?:LINES)/i, /^(?:LISTAGG)/i, /^(?:LOAD)/i, /^(?:LOCAL)/i, /^(?:LOCALTIMESTAMP)/i, /^(?:LOCATION)/i, /^(?:MATCH)/i, /^(?:MATCH_NUMBER)/i, /^(?:MATCH_RECOGNIZE)/i, /^(?:MATCHES)/i, /^(?:MERGE)/i, /^(?:MERGE_FN)/i, /^(?:METADATA)/i, /^(?:METHOD)/i, /^(?:MODIFIES)/i, /^(?:MULTISET)/i, /^(?:NATIONAL)/i, /^(?:NATURAL)/i, /^(?:NCHAR)/i, /^(?:NCLOB)/i, /^(?:NO)/i, /^(?:NONE)/i, /^(?:NORMALIZE)/i, /^(?:NOT)/i, /^(?:NTH_VALUE)/i, /^(?:NULL)/i, /^(?:NULLS)/i, /^(?:NUMERIC)/i, /^(?:OCCURRENCES_REGEX)/i, /^(?:OCTET_LENGTH)/i, /^(?:OF)/i, /^(?:OFFSET)/i, /^(?:OMIT)/i, /^(?:ON)/i, /^(?:ONE)/i, /^(?:ONLY)/i, /^(?:OPTION)/i, /^(?:OR)/i, /^(?:ORC)/i, /^(?:ORDER)/i, /^(?:OUT)/i, /^(?:OUTER)/i, /^(?:OVER)/i, /^(?:OVERLAPS)/i, /^(?:OVERLAY)/i, /^(?:OVERWRITE)/i, /^(?:PARQUET)/i, /^(?:PARTITI
|
||
|
conditions: { "hdfs": { "rules": [425, 426, 427, 428, 429, 430, 472], "inclusive": false }, "doubleQuotedValue": { "rules": [468, 469, 475], "inclusive": false }, "singleQuotedValue": { "rules": [465, 466, 474], "inclusive": false }, "backtickedValue": { "rules": [462, 463, 473], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 464, 467, 470, 471, 476], "inclusive": true } }
|
||
|
});
|
||
|
return lexer;
|
||
|
})();
|
||
|
parser.lexer = lexer;
|
||
|
function Parser() {
|
||
|
this.yy = {};
|
||
|
}
|
||
|
Parser.prototype = parser;
|
||
|
parser.Parser = Parser;
|
||
|
return new Parser;
|
||
|
})();
|
||
|
exports.default = impalaAutocompleteParser;
|