2019-12-31 18:47:24 +08:00
"use strict" ;
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Cloudera, Inc. licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* parser generated by jison 0.4.18 */
/ *
Returns a Parser object of the following structure :
Parser : {
yy : { }
}
Parser . prototype : {
yy : { } ,
trace : function ( ) ,
symbols _ : { associative list : name == > number } ,
terminals _ : { associative list : number == > name } ,
productions _ : [ ... ] ,
performAction : function anonymous ( yytext , yyleng , yylineno , yy , yystate , $$ , _$ ) ,
table : [ ... ] ,
defaultActions : { ... } ,
parseError : function ( str , hash ) ,
parse : function ( input ) ,
lexer : {
EOF : 1 ,
parseError : function ( str , hash ) ,
setInput : function ( input ) ,
input : function ( ) ,
unput : function ( str ) ,
more : function ( ) ,
less : function ( n ) ,
pastInput : function ( ) ,
upcomingInput : function ( ) ,
showPosition : function ( ) ,
test _match : function ( regex _match _array , rule _index ) ,
next : function ( ) ,
lex : function ( ) ,
begin : function ( condition ) ,
popState : function ( ) ,
_currentRules : function ( ) ,
topState : function ( ) ,
pushState : function ( condition ) ,
options : {
ranges : boolean ( optional : true == > token location info will include a . range [ ] member )
flex : boolean ( optional : true == > flex - like lexing behaviour where the rules are tested exhaustively to find the longest match )
backtrack _lexer : boolean ( optional : true == > lexer regexes are tested in order and for each matching regex the action code is invoked ; the lexer terminates the scan when a token is returned by the action code )
} ,
performAction : function ( yy , yy _ , $avoiding _name _collisions , YY _START ) ,
rules : [ ... ] ,
conditions : { associative list : name == > set } ,
}
}
token location info ( @ $ , _$ , etc . ) : {
first _line : n ,
last _line : n ,
first _column : n ,
last _column : n ,
range : [ start _number , end _number ] ( where the numbers are indexes into the input string , regular zero - based )
}
the parseError function receives a 'hash' object with these members for lexer and parser errors : {
text : ( matched text )
token : ( the produced terminal token , if any )
line : ( yylineno )
}
while parser ( grammar ) errors will also provide these members , i . e . parser errors deliver a superset of attributes : {
loc : ( yylloc )
expected : ( string describing the set of expected tokens )
recoverable : ( boolean : TRUE when the parser has a error recovery rule available for this particular error )
}
* /
const sqlParseSupport _1 = require ( "./sqlParseSupport" ) ;
var hiveSyntaxParser = ( function ( ) {
var o = function ( k , v , o , l ) { for ( o = o || { } , l = k . length ; l -- ; o [ k [ l ] ] = v )
2020-03-26 13:06:16 +08:00
; return o ; } , $V0 = [ 26 , 44 , 152 , 166 , 198 , 205 , 217 , 231 , 266 , 533 , 534 , 535 , 538 , 542 , 562 , 564 , 566 , 571 , 608 , 625 , 633 , 639 , 644 , 647 , 669 , 674 , 815 ] , $V1 = [ 2 , 1194 ] , $V2 = [ 644 , 647 ] , $V3 = [ 2 , 1195 ] , $V4 = [ 1 , 60 ] , $V5 = [ 1 , 91 ] , $V6 = [ 1 , 84 ] , $V7 = [ 1 , 98 ] , $V8 = [ 1 , 94 ] , $V9 = [ 1 , 95 ] , $Va = [ 1 , 38 ] , $Vb = [ 1 , 9 ] , $Vc = [ 1 , 96 ] , $Vd = [ 1 , 99 ] , $Ve = [ 1 , 81 ] , $Vf = [ 1 , 102 ] , $Vg = [ 1 , 56 ] , $Vh = [ 1 , 57 ] , $Vi = [ 1 , 101 ] , $Vj = [ 1 , 90 ] , $Vk = [ 1 , 89 ] , $Vl = [ 1 , 58 ] , $Vm = [ 1 , 103 ] , $Vn = [ 1 , 86 ] , $Vo = [ 1 , 87 ] , $Vp = [ 1 , 88 ] , $Vq = [ 1 , 100 ] , $Vr = [ 1 , 80 ] , $Vs = [ 1 , 59 ] , $Vt = [ 26 , 44 , 152 , 166 , 198 , 205 , 217 , 266 , 533 , 534 , 535 , 538 , 542 , 562 , 564 , 566 , 571 , 608 , 625 , 633 , 639 , 669 , 674 , 815 ] , $Vu = [ 1 , 120 ] , $Vv = [ 118 , 499 , 644 , 647 ] , $Vw = [ 2 , 1811 ] , $Vx = [ 1 , 124 ] , $Vy = [ 1 , 136 ] , $Vz = [ 1 , 179 ] , $VA = [ 1 , 237 ] , $VB = [ 1 , 140 ] , $VC = [ 1 , 246 ] , $VD = [ 1 , 219 ] , $VE = [ 1 , 287 ] , $VF = [ 1 , 255 ] , $VG = [ 1 , 150 ] , $VH = [ 1 , 250 ] , $VI = [ 1 , 265 ] , $VJ = [ 1 , 247 ] , $VK = [ 1 , 240 ] , $VL = [ 1 , 279 ] , $VM = [ 1 , 269 ] , $VN = [ 1 , 264 ] , $VO = [ 1 , 161 ] , $VP = [ 1 , 252 ] , $VQ = [ 1 , 268 ] , $VR = [ 1 , 198 ] , $VS = [ 1 , 274 ] , $VT = [ 1 , 260 ] , $VU = [ 1 , 261 ] , $VV = [ 1 , 170 ] , $VW = [ 1 , 167 ] , $VX = [ 1 , 288 ] , $VY = [ 1 , 235 ] , $VZ = [ 1 , 165 ] , $V _ = [ 1 , 192 ] , $V$ = [ 1 , 139 ] , $V01 = [ 1 , 152 ] , $V11 = [ 1 , 199 ] , $V21 = [ 1 , 190 ] , $V31 = [ 1 , 187 ] , $V41 = [ 1 , 225 ] , $V51 = [ 1 , 229 ] , $V61 = [ 1 , 154 ] , $V71 = [ 1 , 282 ] , $V81 = [ 1 , 224 ] , $V91 = [ 1 , 251 ] , $Va1 = [ 1 , 248 ] , $Vb1 = [ 1 , 153 ] , $Vc1 = [ 1 , 169 ] , $Vd1 = [ 1 , 267 ] , $Ve1 = [ 1 , 221 ] , $Vf1 = [ 1 , 227 ] , $Vg1 = [ 1 , 193 ] , $Vh1 = [ 1 , 155 ] , $Vi1 = [ 1 , 160 ] , $Vj1 = [ 1 , 184 ] , $Vk1 = [ 1 , 217 ] , $Vl1 = [ 1 , 286 ] , $Vm1 = [ 1 , 171 ] , $Vn1 = [ 1 , 208 ] , $Vo1 = [ 1 , 230 ] , $Vp1 = [ 1 , 185 ] , $Vq1 = [ 1 , 195 ] , $Vr1 = [ 1 , 231 ] , $Vs1 = [ 1 , 272 ] , $Vt1 = [ 1 , 137 ] , $Vu1 = [ 1 , 166 ] , $Vv1 = [ 1 , 210 ] , $Vw1 = [ 1 , 284 ] , $Vx1 = [ 1 , 180 ] , $Vy1 = [ 1 , 162 ] , $Vz1 = [ 1 , 214 ] , $VA1 = [ 1 , 174 ] , $VB1 = [ 1 , 172 ] , $VC1 = [ 1 , 173 ] , $VD1 = [ 1 , 228 ] , $VE1 = [ 1 , 271 ] , $VF1 = [ 1 , 283 ] , $VG1 = [ 1 , 249 ] , $VH1 = [ 1 , 226 ] , $VI1 = [ 1 , 239 ] , $VJ1 = [ 1 , 163 ] , $VK1 = [ 1 , 158 ] , $VL1 = [ 1 , 188 ] , $VM1 = [ 1 , 266 ] , $VN1 = [ 1 , 200 ] , $VO1 = [ 1 , 156 ] , $VP1 = [ 1 , 205 ] , $VQ1 = [ 1 , 234 ] , $VR1 = [ 1 , 209 ] , $VS1 = [ 1 , 233 ] , $VT1 = [ 1 , 238 ] , $VU1 = [ 1 , 245 ] , $VV1 = [ 1 , 259 ] , $VW1 = [ 1 , 277 ] , $VX1 = [ 1 , 183 ] , $VY1 = [ 1 , 196 ] , $VZ1 = [ 1 , 276 ] , $V _1 = [ 1 , 191 ] , $V$1 = [ 1 , 164 ] , $V02 = [ 1 , 206 ] , $V12 = [ 1 , 211 ] , $V22 = [ 1 , 213 ] , $V32 = [ 1 , 182 ] , $V42 = [ 1 , 275 ] , $V52 = [ 1 , 197 ] , $V62 = [ 1 , 207 ] , $V72 = [ 1 , 181 ] , $V82 = [ 1 , 203 ] , $V92 = [ 1 , 243 ] , $Va2 = [ 1 , 138 ] , $Vb2 = [ 1 , 149 ] , $Vc2 = [ 1 , 281 ] , $Vd2 = [ 1 , 135 ] , $Ve2 = [ 1 , 141 ] , $Vf2 = [ 1 , 142 ] , $Vg2 = [ 1 , 143 ] , $Vh2 = [ 1 , 144 ] , $Vi2 = [ 1 , 145 ] , $Vj2 = [ 1 , 232 ] , $Vk2 = [ 1 , 151 ] , $Vl2 = [ 1 , 242 ] , $Vm2 = [ 1 , 186 ] , $Vn2 = [ 1 , 236 ] , $Vo2 = [ 1 , 220 ] , $Vp2 = [ 1 , 218 ] , $Vq2 = [ 1 , 215 ] , $Vr2 = [ 1 , 175 ] , $Vs2 = [ 1 , 204 ] , $Vt2 = [ 1 , 194 ] , $Vu2 = [ 1 , 253 ] , $Vv2 = [ 1 , 157 ] , $Vw2 = [ 1 , 159 ] , $Vx2 = [ 1 , 168 ] , $Vy2 = [ 1 , 176 ] , $Vz2 = [ 1 , 177 ] , $VA2 = [ 1 , 178 ] , $VB2 = [ 1 , 189 ] , $VC2 = [ 1 , 201 ] , $VD2 = [ 1 , 202 ] , $VE2 = [ 1 , 212 ] , $VF2 = [ 1 , 216 ] , $VG2 = [ 1 , 222 ] , $VH2 = [ 1 , 223 ] , $VI2 = [ 1 , 241 ] , $VJ2 = [ 1 , 244 ] , $VK2 = [ 1 , 254 ] , $VL2 = [ 1 , 256 ] , $VM2 = [ 1 , 257 ] , $VN2 = [ 1 , 258 ] , $VO2 = [ 1 , 262 ] , $VP2 = [ 1 , 263 ] , $VQ2 = [ 1 , 270 ] , $VR2 = [ 1 , 273 ] , $VS2 = [ 1 , 278 ] , $VT2 = [ 1 , 280 ] , $VU2 = [ 1 , 285 ] , $VV2 = [ 1 , 289 ] , $VW2 = [ 1 , 290 ] , $VX2 = [ 1 , 146 ] , $VY2 = [ 1 , 147 ] , $VZ2 = [ 1 , 134 ] , $V _2 = [ 47 , 50 , 58 , 61 , 62 , 64 , 66 , 74 , 78 , 84 , 85 , 86 , 89 , 90 , 92 , 99 , 107 , 127 , 129 , 130 , 132 , 134 , 135 , 151 , 153 , 154 , 156 , 174 , 175 , 176 , 177 , 178 , 180 , 181 , 182 , 198 , 202 , 205 , 217 , 218 , 219 , 229 , 230 , 231 , 234 , 236 , 238 , 240 , 241 , 244 , 245 , 246 , 247 , 248 , 249 , 250 , 277 , 318 , 320 , 321 , 323 , 328 , 329 , 330 , 331 , 333 , 352 , 359 , 373 , 374 , 376 , 382 , 386 , 396 , 397 , 410 , 417 , 418 , 419 , 420 , 421 , 422 , 423 , 424 , 425 , 428 , 439 , 440 , 442 , 443 , 444 , 445 , 446 , 447 , 460 , 468 , 469 , 473 , 486 , 487 , 532 , 538 , 539 , 569 , 570 , 574 , 589 , 592 , 608 , 617 , 625 , 626 , 628 , 639 , 640 , 649 , 650 , 651 , 652 , 653 , 654 , 655 , 656 , 657 , 658 , 659 , 660 , 661 , 662 , 663 , 664 , 665 , 666 , 667 , 668 , 669 , 670 ,
2019-12-31 18:47:24 +08:00
var parser = { trace : function trace ( ) { } ,
yy : { } ,
2020-03-26 11:47:47 +08:00
symbols _ : { "error" : 2 , "DataDefinition" : 3 , "AlterStatement" : 4 , "AnalyzeStatement" : 5 , "CreateStatement" : 6 , "DropStatement" : 7 , "AbortStatement" : 8 , "GrantStatement" : 9 , "RevokeStatement" : 10 , "DescribeStatement" : 11 , "SetRoleStatement" : 12 , "SetSpecification" : 13 , "ShowStatement" : 14 , "UseStatement" : 15 , "DataDefinition_EDIT" : 16 , "AlterStatement_EDIT" : 17 , "AnalyzeStatement_EDIT" : 18 , "CreateStatement_EDIT" : 19 , "DropStatement_EDIT" : 20 , "AbortStatement_EDIT" : 21 , "GrantStatement_EDIT" : 22 , "RevokeStatement_EDIT" : 23 , "DescribeStatement_EDIT" : 24 , "SetRoleStatement_EDIT" : 25 , "SET" : 26 , "CURSOR" : 27 , "ShowStatement_EDIT" : 28 , "UseStatement_EDIT" : 29 , "AlterDatabase" : 30 , "AlterIndex" : 31 , "AlterMaterializedView" : 32 , "AlterTable" : 33 , "AlterView" : 34 , "Msck" : 35 , "ReloadFunction" : 36 , "AlterDatabase_EDIT" : 37 , "AlterIndex_EDIT" : 38 , "AlterMaterializedView_EDIT" : 39 , "AlterTable_EDIT" : 40 , "AlterView_EDIT" : 41 , "Msck_EDIT" : 42 , "ReloadFunction_EDIT" : 43 , "ALTER" : 44 , "DatabaseOrSchema" : 45 , "RegularOrBacktickedIdentifier" : 46 , "DBPROPERTIES" : 47 , "ParenthesizedPropertyAssignmentList" : 48 , "HdfsLocation" : 49 , "OWNER" : 50 , "PrincipalSpecification" : 51 , "HdfsLocation_EDIT" : 52 , "PrincipalSpecification_EDIT" : 53 , "INDEX" : 54 , "ON" : 55 , "SchemaQualifiedTableIdentifier" : 56 , "OptionalPartitionSpec" : 57 , "REBUILD" : 58 , "SchemaQualifiedTableIdentifier_EDIT" : 59 , "OptionalPartitionSpec_EDIT" : 60 , "MATERIALIZED" : 61 , "VIEW" : 62 , "EnableOrDisable" : 63 , "REWRITE" : 64 , "AlterTableLeftSide" : 65 , "ADD" : 66 , "OptionalIfNotExists" : 67 , "PartitionSpec" : 68 , "OptionalHdfsLocation" : 69 , "OptionalPartitionSpecs" : 70 , "CONSTRAINT" : 71 , "PrimaryKeySpecification" : 72 , "TableConstraint" : 73 , "RENAME" : 74 , "TO" : 75 , "RegularOrBackTickedSchemaQualifiedName" : 76 , "ClusteredBy" : 77 , "SKEWED" : 78 , "BY" : 79 , "ParenthesizedColumnList" : 80 , "ParenthesizedSkewedValueList" : 81 , "OptionalStoredAsDirectories" : 82 , "ExchangeSpecification" : 83 , "RECOVER" : 84 , "PARTITIONS" : 85 , "TOUCH" : 86 , "ArchiveOrUnArchive" : 87 , "NOT" : 88 , "STORED_AS_DIRECTORIES" : 89 , "SKEWED_LOCATION" : 90 , "ParenthesizedSkewedLocationList" : 91 , "CHANGE" : 92 , "COLUMN" : 93 , "ParenthesizedColumnSpecificationList" : 94 , "OptionalCascadeOrRestrict" : 95 , "DropOperations" : 96 , "OptionalPartitionOperations" : 97 , "AlterTableLeftSide_EDIT" : 98 , "REPLACE" : 99 , "OptionalIfNotExists_EDIT" : 100 , "OptionalPartitionSpecs_EDIT" : 101 , "PartitionSpec_EDIT" : 102 , "PrimaryKeySpecification_EDIT" : 103 , "ForeignKeySpecification_EDIT" : 104 , "ClusteredBy_EDIT" : 105 , "ExchangeSpecification_EDIT" : 106 , "STORED" : 107 , "AS" : 108 , "ParenthesizedSkewedLocationList_EDIT" : 109 , "ParenthesizedColumnList_EDIT" : 110 , "OptionalStoredAsDirectories_EDIT" : 111 , "OptionalPartitionOperations_EDIT" : 112 , "DropOperations_EDIT" : 113 , "AddOrReplace" : 114 , "ParenthesizedStatsList" : 115 , "(" : 116 , "StatsList" : 117 , ")" : 118 , "ParenthesizedStatsList_EDIT" : 119 , "StatsList_EDIT" : 120 , "RightParenthesisOrError" : 121 , "StatsAssignment" : 122 , "," : 123 , "StatsAssignment_EDIT" : 124 , "QuotedValue" : 125 , "=" : 126 , "FILEFORMAT" : 127 , "FileFormat" : 128 , "TBLPROPERTIES" : 129 , "SERDE" : 130 , "OptionalWithSerdeproperties" : 131 , "SERDEPROPERTIES" : 132 , "AddReplaceColumns" : 133 , "CONCATENATE" : 134 , "COMPACT" : 135 , "OptionalAndWait" : 136 , "OptionalWithOverwriteTblProperties" : 137 , "NoDropOrOffline" : 138 , "OptionalColumn" : 139 , "ColumnIdentifier" : 140 , "ColumnSpecification" : 141 , "OptionalAfterOrFirst" : 142 , "AddReplaceColumns_EDIT" : 143 , "ColumnSpecification_EDIT" : 144 , "OptionalAfterOrFirst_EDIT" : 145 , "AndWait_EDIT" : 146 , "WithOverwriteTblProperties_EDIT" : 147 , "NoDropOrOffline_EDIT" : 148 , "WithSerdeproperties_EDIT" : 149 , "AND" : 150 , "WAIT" : 151 , "WITH" : 152 , "OVERWRITE" : 153 , "COLUMNS" : 154 , "ParenthesizedColumnSpecificationList_EDIT" : 155 , "EXCHANGE" : 156 , "ExchangePartitionSpec" : 157 , "TABLE" : 158 , "RegularOrBackTickedSchemaQualifiedName_EDIT" : 159 , "ExchangePartitionSpec_EDIT" : 160 , "PARTITION" : 161 , "OneOrMorePartitionSpecLists" : 162 , "PartitionSpecList" : 163 , "OneOrMorePartitionSpecLists_EDIT" : 164 , "PartitionSpecList_EDIT" : 165 , " DRO
terminals _ : { 2 : "error" , 26 : "SET" , 27 : "CURSOR" , 44 : "ALTER" , 47 : "DBPROPERTIES" , 50 : "OWNER" , 54 : "INDEX" , 55 : "ON" , 58 : "REBUILD" , 61 : "MATERIALIZED" , 62 : "VIEW" , 64 : "REWRITE" , 66 : "ADD" , 71 : "CONSTRAINT" , 74 : "RENAME" , 75 : "TO" , 78 : "SKEWED" , 79 : "BY" , 84 : "RECOVER" , 85 : "PARTITIONS" , 86 : "TOUCH" , 88 : "NOT" , 89 : "STORED_AS_DIRECTORIES" , 90 : "SKEWED_LOCATION" , 92 : "CHANGE" , 93 : "COLUMN" , 99 : "REPLACE" , 107 : "STORED" , 108 : "AS" , 116 : "(" , 118 : ")" , 123 : "," , 126 : "=" , 127 : "FILEFORMAT" , 129 : "TBLPROPERTIES" , 130 : "SERDE" , 132 : "SERDEPROPERTIES" , 134 : "CONCATENATE" , 135 : "COMPACT" , 150 : "AND" , 151 : "WAIT" , 152 : "WITH" , 153 : "OVERWRITE" , 154 : "COLUMNS" , 156 : "EXCHANGE" , 158 : "TABLE" , 161 : "PARTITION" , 166 : "DROP" , 174 : "AFTER" , 175 : "FIRST" , 176 : "ENABLE" , 177 : "DISABLE" , 178 : "NO_DROP" , 180 : "OFFLINE" , 181 : "ARCHIVE" , 182 : "UNARCHIVE" , 193 : "ColumnReferences" , 198 : "MSCK" , 202 : "REPAIR" , 204 : "SYNC" , 205 : "RELOAD" , 206 : "FUNCTION" , 208 : "NULL" , 216 : "SetSpecification_EDIT" , 217 : "ANALYZE" , 218 : "COMPUTE" , 219 : "STATISTICS" , 227 : "FOR" , 228 : "CACHE" , 229 : "METADATA" , 230 : "NOSCAN" , 231 : "EXPLAIN" , 233 : "FORMATTED" , 234 : "AST" , 235 : "AUTHORIZATION" , 236 : "CBO" , 238 : "DEPENDENCY" , 239 : "EXTENDED" , 240 : "LOCKS" , 241 : "VECTORIZATION" , 244 : "COST" , 245 : "JOINCOST" , 246 : "ONLY" , 247 : "DETAIL" , 248 : "EXPRESSION" , 249 : "OPERATOR" , 250 : "SUMMARY" , 266 : "CREATE" , 277 : "COMMENT" , 279 : "SINGLE_QUOTE" , 280 : "DOUBLE_QUOTE" , 281 : "VALUE" , 307 : "LIKE" , 317 : "PRIMARY" , 318 : "KEY" , 320 : "UNIQUE" , 321 : "DEFAULT" , 323 : "CHECK" , 328 : "LITERAL" , 329 : "CURRENT_USER" , 330 : "CURRENT_DATE" , 331 : "CURRENT_TIMESTAMP" , 333 : "NOVALIDATE" , 347 : "ARRAY" , 348 : "<" , 349 : ">" , 351 : "MAP" , 352 : "STRUCT" , 358 : ":" , 359 : "UNIONTYPE" , 371 : "FOREIGN" , 372 : "REFERENCES" , 373 : "RELY" , 374 : "NORELY" , 376 : "PARTITIONED" , 381 : "COMPARISON_OPERATOR" , 382 : "CLUSTERED" , 384 : "INTO" , 385 : "UNSIGNED_INTEGER" , 386 : "BUCKETS" , 396 : "DISTRIBUTED" , 397 : "SORTED" , 409 : "ROW" , 410 : "FORMAT" , 417 : "AVRO" , 418 : "INPUTFORMAT" , 419 : "OUTPUTFORMAT" , 420 : "JSONFILE" , 421 : "ORC" , 422 : "PARQUET" , 423 : "RCFILE" , 424 : "SEQUENCEFILE" , 425 : "TEXTFILE" , 428 : "DELIMITED" , 439 : "FIELDS" , 440 : "TERMINATED" , 442 : "ESCAPED" , 443 : "COLLECTION" , 444 : "ITEMS" , 445 : "KEYS" , 446 : "LINES" , 447 : "DEFINED" , 460 : "TEMPORARY" , 464 : "USING" , 468 : "FILE" , 469 : "JAR" , 473 : "ROLE" , 486 : "DEFERRED" , 487 : "IDXPROPERTIES" , 488 : "IN" , 491 : "MACRO" , 499 : "LIFECYCLE" , 532 : "PURGE" , 533 : "TRUNCATE" , 534 : "DELETE" , 535 : "FROM" , 538 : "ABORT" , 539 : "TRANSACTIONS" , 542 : "GRANT" , 556 : "DATABASE" , 561 : "ALL" , 562 : "INSERT" , 563 : "LOCK" , 564 : "SELECT" , 565 : "SHOW_DATABASE" , 566 : "UPDATE" , 567 : "USER" , 568 : "GROUP" , 569 : "OPTION" , 570 : "ADMIN" , 571 : "REVOKE" , 574 : "PRIVILEGES" , 586 : "VALUES" , 588 : "LOCAL" , 589 : "DIRECTORY" , 592 : "OVERWRITE_DIRECTORY" , 595 : "OptionalStoredAs_EDIT" , 608 : "MERGE" , 615 : "WHEN" , 617 : "MATCHED" , 619 : "THEN" , 625 : "LOAD" , 626 : "DATA" , 628 : "INPATH" , 633 : "IMPORT" , 638 : "EXTERNAL" , 639 : "EXPORT" , 640 : "REPLICATION" , 644 : "EOF" , 647 : ";" , 649 : "BUCKET" , 650 : "CASCADE" , 651 : "COMPACTIONS" , 652 : "DATABASES" , 653 : "DAY" , 654 : "DAYOFWEEK" , 655 : "DOUBLE_PRECISION" , 656 : "FUNCTIONS" , 657 : "HOUR" , 658 : "LAST" , 659 : "LOCATION" , 660 : "MINUTE" , 661 : "MONTH" , 662 : "PERCENT" , 663 : "QUARTER" , 664 : "RESTRICT" , 665 : "ROLES" , 666 : "SCHEMAS" , 667 : "SECOND" , 668 : "SETS" , 669 : "SHOW" , 670 : "STRING" , 671 : "TABLES" , 672 : "TINYINT" , 673 : "TRANSACTIONAL" , 674 : "USE" , 675 : "WEEK" , 676 : "YEAR" , 677 : "REGULAR_IDENTIFIER" , 678 : "VARIABLE_REFERENCE" , 680 : "!" , 681 : "*" , 682 : "-" , 683 : "." , 684 : "[" , 685 : "]" , 686 : "ANALYTIC" , 687 : "ARITHMETIC_OPERATOR" , 688 : "ASC" , 689 : "AVG" , 690 : "BACKTICK" , 691 : "BETWEEN" , 692 : "BIGINT" , 693 : "BINARY" , 694 : "BOOLEAN" , 695 : "CASE" , 696 : "CAST" , 697 : "CHAR" , 698 : "CLUSTER" , 699 : "COLLECT_LIST" , 700 : "COLLECT_SET" , 701 : "CONF" , 702 : "CORR" , 703 : "COUNT" , 704 : "COVAR_POP" , 705 : "COVAR_SAMP" , 706 : "CROSS" , 707 : "CUBE" , 708 : "CURRENT" , 709 : "DATE" , 710 : "DECIMAL" , 711 : "DESC" , 712 : "DISTINCT" , 713 : "DISTRIBUTE" , 714 : "DOUBLE" , 715 : "ELSE" , 716 : "END" , 717 : "EXISTS" , 718 : "FALSE" , 719
productions _ : [ 0 , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 3 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 16 , 2 ] , [ 16 , 1 ] , [ 16 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 4 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 1 ] , [ 17 , 2 ] , [ 30 , 6 ] , [ 30 , 5 ] , [ 30 , 6 ] , [ 37 , 3 ] , [ 37 , 4 ] , [ 37 , 5 ] , [ 37 , 5 ] , [ 37 , 6 ] , [ 37 , 6 ] , [ 31 , 7 ] , [ 38 , 4 ] , [ 38 , 5 ] , [ 38 , 5 ] , [ 38 , 6 ] , [ 38 , 7 ] , [ 32 , 6 ] , [ 39 , 3 ] , [ 39 , 4 ] , [ 39 , 4 ] , [ 39 , 5 ] , [ 39 , 6 ] , [ 33 , 6 ] , [ 33 , 5 ] , [ 33 , 3 ] , [ 33 , 4 ] , [ 33 , 2 ] , [ 33 , 7 ] , [ 33 , 2 ] , [ 33 , 3 ] , [ 33 , 3 ] , [ 33 , 3 ] , [ 33 , 3 ] , [ 33 , 3 ] , [ 33 , 4 ] , [ 33 , 4 ] , [ 33 , 5 ] , [ 33 , 6 ] , [ 33 , 2 ] , [ 33 , 2 ] , [ 33 , 3 ] , [ 40 , 1 ] , [ 40 , 6 ] , [ 40 , 2 ] , [ 40 , 4 ] , [ 40 , 2 ] , [ 40 , 7 ] , [ 40 , 2 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 4 ] , [ 40 , 5 ] , [ 40 , 6 ] , [ 40 , 2 ] , [ 40 , 2 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 6 ] , [ 40 , 6 ] , [ 40 , 7 ] , [ 40 , 6 ] , [ 40 , 4 ] , [ 40 , 5 ] , [ 40 , 5 ] , [ 40 , 5 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 2 ] , [ 40 , 2 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 5 ] , [ 40 , 4 ] , [ 40 , 5 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 4 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 4 ] , [ 40 , 4 ] , [ 40 , 7 ] , [ 40 , 5 ] , [ 40 , 8 ] , [ 40 , 7 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 2 ] , [ 40 , 2 ] , [ 40 , 2 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 40 , 4 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 3 ] , [ 40 , 4 ] , [ 115 , 3 ] , [ 119 , 3 ] , [ 117 , 1 ] , [ 117 , 3 ] , [ 120 , 1 ] , [ 120 , 3 ] , [ 120 , 5 ] , [ 120 , 3 ] , [ 122 , 3 ] , [ 124 , 1 ] , [ 97 , 3 ] , [ 97 , 2 ] , [ 97 , 3 ] , [ 97 , 4 ] , [ 97 , 3 ] , [ 97 , 1 ] , [ 97 , 1 ] , [ 97 , 4 ] , [ 97 , 2 ] , [ 97 , 6 ] , [ 112 , 1 ] , [ 112 , 3 ] , [ 112 , 6 ] , [ 112 , 7 ] , [ 112 , 6 ] , [ 112 , 5 ] , [ 112 , 4 ] , [ 112 , 4 ] , [ 112 , 2 ] , [ 112 , 2 ] , [ 112 , 3 ] , [ 112 , 2 ] , [ 112 , 5 ] , [ 112 , 4 ] , [ 136 , 0 ] , [ 136 , 2 ] , [ 146 , 2 ] , [ 137 , 0 ] , [ 137 , 4 ] , [ 147 , 2 ] , [ 147 , 3 ] , [ 133 , 4 ] , [ 143 , 4 ] , [ 143 , 5 ] , [ 83 , 5 ] , [ 106 , 2 ] , [ 106 , 3 ] , [ 106 , 4 ] , [ 106 , 5 ] , [ 106 , 5 ] , [ 106 , 2 ] , [ 106 , 5 ] , [ 157 , 4 ] , [ 157 , 4 ] , [ 160 , 4 ] , [ 160 , 4 ] , [ 162 , 3 ] , [ 162 , 5 ] , [ 164 , 3 ] , [ 164 , 5 ] , [ 96 , 4 ] , [ 96 , 3 ] , [ 113 , 3 ] , [ 113 , 4 ] , [ 113 , 5 ] , [ 113 , 3 ] , [ 113 , 2 ] , [ 113 , 2 ] , [ 65 , 3 ] , [ 98 , 3 ] , [ 98 , 3 ] , [ 114 , 1 ] , [ 114 , 1 ] , [ 142 , 0 ] , [ 142 , 2 ] , [ 173 , 1 ] , [ 173 , 1 ] , [ 145 , 2 ] , [ 145 , 2 ] , [ 139 , 0 ] , [ 139 , 1 ] , [ 63 , 1 ] , [ 63 , 1 ] , [ 138 , 2 ] , [ 138 , 1 ] , [ 148 , 3 ] , [ 87 , 1 ] , [ 87 , 1 ] , [ 168 , 1 ] , [ 168 , 3 ] , [ 170 , 1 ] , [ 170 , 3 ] , [ 170 , 5 ] , [ 170 , 3 ] , [ 170 , 3 ] , [ 170 , 3 ] , [ 170 , 5 ] , [ 70 , 0 ] , [ 70 , 1 ] , [ 184 , 1 ] , [ 184 , 2 ] , [ 101 , 1 ] , [ 101 , 2 ] , [ 101 , 2 ] , [ 101 , 3 ] , [ 186 , 2 ] , [ 186 , 2 ] , [ 185 , 2 ] , [ 91 , 3 ] , [ 109 , 3 ] , [ 187 , 1 ] , [ 187 , 3 ] , [ 188 , 1 ] , [ 188 , 3 ] , [ 188 , 5 ] , [ 188 , 3 ] , [ 189 , 3 ] , [ 190 , 1 ] , [ 190 , 1 ] , [ 190 , 3 ] , [ 190 , 3 ] , [ 190 , 3 ] , [ 82 , 0 ] , [ 82 , 1 ] , [ 111 , 2 ] , [ 111 , 3 ] , [ 34 , 4 ] , [ 34 , 3 ] , [ 41 , 1 ] , [ 41 , 2 ] , [ 41 , 3 ] , [ 41 , 3 ] , [ 41 , 3 ] , [ 194 , 3 ] , [ 196 , 3 ] , [ 196 , 3 ] , [ 35 , 5 ] , [ 42 , 3 ] , [ 42 , 4 ] , [ 42 , 4 ] , [ 42 , 5 ] , [ 42 , 6 ] , [ 199 , 0 ] , [ 199 , 1 ] , [ 200 , 0 ] , [ 200 , 2 ] , [ 201 , 2 ] , [ 203 , 1 ] , [ 203 , 1 ] , [ 203 , 1 ] , [ 36 , 2 ] , [ 43 , 2 ] , [ 207 , 1 ] , [ 207 , 1 ] , [ 209 , 2 ] , [ 209 , 2 ] , [ 209 , 2 ] , [ 209 , 1 ] , [ 209 , 1 ] , [ 209 , 1 ] , [ 212 , 1 ] , [ 212 , 2 ] , [ 212 , 2 ] , [ 212 , 2 ] , [ 212 , 2 ] , [ 212 , 2 ] , [ 212 , 2 ] , [ 212 , 1 ] , [ 212 , 2 ] , [ 212 , 1 ] , [ 212 , 1 ] , [ 212 , 1 ] , [ 212 , 1 ] , [ 5 , 9 ] , [ 18 , 2 ] , [ 18 , 3 ] , [ 18 , 4 ] , [ 18 , 4 ] , [ 18 , 5 ] , [ 18 , 6 ] , [ 18 , 10 ] , [ 18 , 10 ] , [ 18 , 10 ] , [ 18 , 4 ] , [ 18 , 9 ] , [ 18 , 9 ] , [ 18 , 9 ] , [ 18 , 9 ] , [ 18 , 9 ] , [ 220 , 0 ] , [ 220 , 1 ] , [ 223 , 2 ] , [ 225 , 2 ] , [ 221 , 0 ] , [ 221 , 1 ] , [ 224 , 2 ] , [ 226 , 2 ] , [ 222 , 0 ] , [ 222 , 1 ] , [ 210 , 2 ] , [ 213 , 3 ] , [ 213 , 3 ] , [ 232 , 0 ] , [ 232 , 1 ] , [ 232 , 1 ] , [ 232 , 3 ] , [ 232 , 2 ] , [ 232 , 1 ] , [ 232 , 1 ] , [ 232 , 1 ] , [ 232 , 3 ] , [ 237 , 0 ] , [ 237 , 1 ] , [ 237 , 1 ] , [ 242 , 0 ] , [ 242 , 1 ] , [ 243 , 0 ] , [ 243 , 1 ] , [ 243 , 1 ] , [ 243 , 1 ] , [ 243 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 6 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 1 ] , [ 19 , 5 ] , [ 251 , 5 ] , [ 259 , 4 ] , [ 259 , 3 ] , [ 259 , 5 ] , [ 259 , 4 ] , [ 259 , 6 ] , [ 271 , 3 ] , [ 274 , 3 ] , [ 274 , 3 ] , [ 272 , 0 ] , [ 272 , 1 ] , [ 276 , 2 ] , [ 275 , 1 ] , [ 278 , 2 ] , [ 278 , 2 ] , [ 278 , 3 ] , [ 278 , 3 ] , [ 273 , 0 ] , [ 273 , 1 ] , [ 282 , 3 ] , [ 282 , 2 ] , [ 282 , 2 ] , [ 48 , 3 ] , [ 283 , 1 ] , [ 283 , 3 ] , [ 284 , 3 ] , [ 252 , 8 ] , [ 260 , 7 ] , [ 260 , 7 ] , [ 260 , 6 ] , [ 286 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 288 , 11 ] , [ 289 , 2 ] , [ 297 , 2 ] , [ 297 , 2 ] , [ 304 , 0 ] , [ 304 , 1 ] , [ 304 , 2 ] , [ 305 , 1 ] , [ 305 , 2 ] , [ 305 , 2 ] , [ 94 , 3 ] , [ 94 , 5 ] ,
2019-12-31 18:47:24 +08:00
performAction : function anonymous ( yytext , yyleng , yylineno , yy , yystate /* action[1] */ , $$ /* vstack */ , _$ /* lstack */ ) {
/* this == yyval */
var $0 = $$ . length - 1 ;
switch ( yystate ) {
case 22 :
parser . suggestSetOptions ( ) ;
parser . suggestKeywords ( [ 'ROLE' ] ) ;
break ;
case 39 :
parser . suggestKeywords ( [ 'DATABASE' , 'INDEX' , 'MATERIALIZED VIEW' , 'SCHEMA' , 'TABLE' , 'VIEW' ] ) ;
break ;
case 40 :
case 42 :
parser . addDatabaseLocation ( _$ [ $0 - 3 ] , [ { name : $$ [ $0 - 3 ] } ] ) ;
break ;
case 41 :
parser . addDatabaseLocation ( _$ [ $0 - 2 ] , [ { name : $$ [ $0 - 2 ] } ] ) ;
break ;
case 43 :
case 938 :
case 1702 :
case 2539 :
case 2581 :
case 2600 :
case 2643 :
case 2644 :
case 2680 :
parser . suggestDatabases ( ) ;
break ;
case 44 :
parser . addDatabaseLocation ( _$ [ $0 - 1 ] , [ { name : $$ [ $0 - 1 ] } ] ) ;
parser . suggestKeywords ( [ 'SET DBPROPERTIES' , 'SET LOCATION' , 'SET OWNER' ] ) ;
break ;
case 45 :
parser . addDatabaseLocation ( _$ [ $0 - 2 ] , [ { name : $$ [ $0 - 2 ] } ] ) ;
parser . suggestKeywords ( [ 'DBPROPERTIES' , 'LOCATION' , 'OWNER' ] ) ;
break ;
case 46 :
parser . addDatabaseLocation ( _$ [ $0 - 2 ] , [ { name : $$ [ $0 - 2 ] } ] ) ;
break ;
case 47 :
parser . addDatabaseLocation ( _$ [ $0 - 3 ] , [ { name : $$ [ $0 - 3 ] } ] ) ;
parser . suggestKeywords ( [ 'GROUP' , 'ROLE' , 'USER' ] ) ;
break ;
case 48 :
parser . addDatabaseLocation ( _$ [ $0 - 3 ] , [ { name : $$ [ $0 - 3 ] } ] ) ;
break ;
case 49 :
case 55 :
case 1133 :
case 1142 :
case 1143 :
case 1144 :
case 1786 :
case 2591 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
break ;
case 50 :
case 127 :
case 576 :
case 598 :
case 601 :
case 604 :
case 627 :
case 877 :
case 1089 :
case 2559 :
case 2576 :
case 2578 :
parser . suggestKeywords ( [ 'ON' ] ) ;
break ;
case 51 :
case 190 :
case 427 :
case 556 :
case 758 :
case 785 :
case 878 :
case 896 :
case 903 :
case 939 :
case 1139 :
case 1168 :
case 1171 :
case 1177 :
case 1693 :
case 2657 :
case 2677 :
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 53 :
case 278 :
case 282 :
case 319 :
case 552 :
case 558 :
case 866 :
case 894 :
case 899 :
case 900 :
case 901 :
case 906 :
case 1170 :
case 1180 :
case 1782 :
case 2589 :
case 2590 :
case 2602 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
break ;
case 54 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'PARTITION' , 'REBUILD' ] ) ;
}
else {
parser . suggestKeywords ( [ 'REBUILD' ] ) ;
}
break ;
case 56 :
case 703 :
case 885 :
case 2472 :
parser . suggestKeywords ( [ 'VIEW' ] ) ;
break ;
case 57 :
case 277 :
case 886 :
parser . suggestTables ( { onlyViews : true } ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 58 :
case 276 :
case 281 :
case 887 :
case 893 :
if ( parser . yy . result . suggestTables ) {
parser . yy . result . suggestTables . onlyViews = true ;
}
break ;
case 59 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
parser . suggestKeywords ( [ 'DISABLE REWRITE' , 'ENABLE REWRITE' ] ) ;
break ;
case 60 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
parser . suggestKeywords ( [ 'REWRITE' ] ) ;
break ;
case 99 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'IF NOT EXISTS' , weight : 3 } , { value : 'COLUMNS' , weight : 2 } , { value : 'CONSTRAINT' , weight : 1 } , { value : 'PARTITION' , weight : 1 } ] ) ;
}
else {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 100 :
case 136 :
case 334 :
parser . suggestKeywords ( [ 'COLUMNS' ] ) ;
break ;
case 104 :
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'LOCATION' , 'PARTITION' ] ) ;
}
else if ( $$ [ $0 - 1 ] && $$ [ $0 - 1 ] . suggestKeywords ) {
var keywords = parser . createWeightedKeywords ( $$ [ $0 - 1 ] . suggestKeywords , 2 ) ;
keywords . push ( { value : 'PARTITION' , weight : 1 } ) ;
parser . suggestKeywords ( keywords ) ;
}
else {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 107 :
parser . suggestKeywords ( [ 'CHECK' , 'FOREIGN KEY' , 'PRIMARY KEY' , 'UNIQUE' ] ) ;
break ;
case 110 :
case 118 :
case 130 :
case 187 :
case 233 :
case 234 :
case 235 :
case 2626 :
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
break ;
case 114 :
parser . suggestKeywords ( [ 'SKEWED' , 'STORED AS DIRECTORIES' ] ) ;
break ;
case 115 :
case 266 :
parser . suggestKeywords ( [ 'AS DIRECTORIES' ] ) ;
break ;
case 116 :
case 267 :
parser . suggestKeywords ( [ 'DIRECTORIES' ] ) ;
break ;
case 117 :
parser . suggestKeywords ( [ 'TO PARTITION' ] ) ;
break ;
case 119 :
case 288 :
parser . suggestKeywords ( [ 'PARTITIONS' ] ) ;
break ;
case 120 :
parser . suggestKeywords ( [ 'LOCATION' ] ) ;
break ;
case 122 :
case 567 :
case 568 :
case 571 :
case 583 :
case 608 :
case 626 :
case 668 :
case 669 :
case 674 :
case 679 :
case 683 :
case 2348 :
parser . suggestKeywords ( [ 'BY' ] ) ;
break ;
case 123 :
case 918 :
case 923 :
case 927 :
case 966 :
case 967 :
case 968 :
case 996 :
case 1004 :
case 1007 :
case 1010 :
case 1015 :
case 1018 :
parser . suggestKeywords ( [ 'GROUP' , 'ROLE' , 'USER' ] ) ;
break ;
case 128 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'STORED AS DIRECTORIES' ] ) ;
}
break ;
case 134 :
parser . suggestKeywords ( [ 'ADD COLUMNS' , 'ADD IF NOT EXISTS' , 'ADD PARTITION' , 'ARCHIVE PARTITION' , 'CHANGE' ,
'CLUSTERED BY' , 'CONCATENATE' , 'COMPACT' , 'DISABLE NO_DROP' , 'DISABLE OFFLINE' , 'DROP' , 'ENABLE NO_DROP' ,
'ENABLE OFFLINE' , 'EXCHANGE PARTITION' , 'NOT SKEWED' , 'NOT STORED AS DIRECTORIES' , 'PARTITION' ,
'RECOVER PARTITIONS' , 'RENAME TO' , 'REPLACE COLUMNS' , 'SET FILEFORMAT' , 'SET LOCATION' , 'SET OWNER' , 'SET SERDE' ,
'SET SERDEPROPERTIES' , 'SET SKEWED LOCATION' , 'SET TBLPROPERTIES' , 'SKEWED BY' , 'TOUCH' , 'UNARCHIVE PARTITION' ] ) ;
break ;
case 135 :
parser . suggestKeywords ( [ 'ADD COLUMNS' , 'CHANGE' , 'COMPACT' , 'CONCATENATE' , 'DISABLE NO_DROP' , 'DISABLE OFFLINE' ,
'ENABLE NO_DROP' , 'ENABLE OFFLINE' , 'RENAME TO PARTITION' , 'REPLACE COLUMNS' , 'SET FILEFORMAT' , 'SET LOCATION' ,
'SET SERDE' , 'SET SERDEPROPERTIES' ] ) ;
break ;
case 137 :
parser . suggestKeywords ( [ 'FILEFORMAT' , 'LOCATION' , 'SERDE' , 'SERDEPROPERTIES' ] ) ;
break ;
case 138 :
parser . suggestKeywords ( [ 'FILEFORMAT' , 'LOCATION' , 'OWNER' , 'SERDE' , 'SERDEPROPERTIES' , 'SKEWED LOCATION' , 'TBLPROPERTIES' ] ) ;
break ;
case 140 :
case 922 :
parser . suggestKeywords ( [ 'TO' ] ) ;
break ;
case 141 :
case 1698 :
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 151 :
parser . suggestIdentifiers ( [ '\'avgSize\'' , '\'maxSize\'' , '\'numDVs\'' , '\'numNulls\'' ] ) ;
break ;
case 161 :
case 164 :
case 166 :
parser . addColumnLocation ( $$ [ $0 - 3 ] . location , [ $$ [ $0 - 3 ] . identifier ] ) ;
break ;
case 163 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'COLUMN' ] ) ;
}
parser . suggestColumns ( ) ;
break ;
case 165 :
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
if ( $$ [ $0 - 3 ] . suggestKeywords ) {
var keywords = parser . createWeightedKeywords ( $$ [ $0 - 3 ] . suggestKeywords , 3 ) ;
keywords = keywords . concat ( [ { value : 'AFTER' , weight : 2 } , { value : 'FIRST' , weight : 2 } , { value : 'CASCADE' , weight : 1 } , { value : 'RESTRICT' , weight : 1 } ] ) ;
parser . suggestKeywords ( keywords ) ;
}
else {
parser . suggestKeywords ( [ { value : 'AFTER' , weight : 2 } , { value : 'FIRST' , weight : 2 } , { value : 'CASCADE' , weight : 1 } , { value : 'RESTRICT' , weight : 1 } ] ) ;
}
}
else if ( $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'CASCADE' , 'RESTRICT' ] ) ;
}
parser . addColumnLocation ( $$ [ $0 - 4 ] . location , [ $$ [ $0 - 4 ] . identifier ] ) ;
break ;
case 167 :
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'AND WAIT' , 'WITH OVERWRITE TBLPROPERTIES' ] ) ;
}
else if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'WITH OVERWRITE TBLPROPERTIES' ] ) ;
}
break ;
case 170 :
parser . suggestKeywords ( [ 'NO_DROP' , 'OFFLINE' ] ) ;
break ;
case 172 :
case 646 :
parser . suggestFileFormats ( ) ;
break ;
case 174 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'WITH SERDEPROPERTIES' ] ) ;
}
break ;
case 178 :
parser . suggestKeywords ( [ 'WAIT' ] ) ;
break ;
case 181 :
parser . suggestKeywords ( [ 'OVERWRITE TBLPROPERTIES' ] ) ;
break ;
case 182 :
case 272 :
parser . suggestKeywords ( [ 'TBLPROPERTIES' ] ) ;
break ;
case 185 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'CASCADE' , 'RESTRICT' ] ) ;
}
break ;
case 188 :
parser . suggestKeywords ( [ 'WITH TABLE' ] ) ;
break ;
case 189 :
case 316 :
case 757 :
case 784 :
case 895 :
case 1167 :
case 1176 :
case 2543 :
case 2564 :
parser . suggestKeywords ( [ 'TABLE' ] ) ;
break ;
case 204 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'CONSTRAINT' , weight : 1 } , { value : 'PARTITION' , weight : 1 } , { value : 'IF EXISTS' , weight : 2 } ] ) ;
}
else {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 206 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'PURGE' ] ) ;
}
break ;
case 210 :
case 275 :
case 772 :
case 874 :
case 884 :
case 888 :
case 892 :
case 936 :
case 937 :
case 1106 :
case 1173 :
case 2542 :
case 2588 :
case 2601 :
case 2631 :
case 2660 :
parser . addTablePrimary ( $$ [ $0 ] ) ;
break ;
case 211 :
case 318 :
case 869 :
if ( parser . yy . result . suggestTables ) {
parser . yy . result . suggestTables . onlyTables = true ;
}
break ;
case 212 :
case 280 :
case 317 :
parser . suggestTables ( { onlyTables : true } ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 219 :
case 259 :
case 261 :
case 621 :
case 788 :
case 1679 :
case 1683 :
case 1687 :
case 1713 :
case 1714 :
case 1747 :
case 1750 :
case 1903 :
case 1971 :
case 2671 :
parser . suggestColumns ( ) ;
break ;
case 227 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'CASCADE' ] ) ;
}
break ;
case 242 :
case 451 :
case 453 :
case 454 :
case 456 :
case 457 :
case 1125 :
case 1832 :
case 1875 :
case 1906 :
case 1919 :
case 1923 :
case 1960 :
case 1964 :
case 1984 :
case 2009 :
case 2010 :
case 2091 :
case 2093 :
case 2157 :
case 2167 :
case 2174 :
case 2186 :
case 2347 :
case 2676 :
case 2714 :
case 2715 :
this . $ = $$ [ $0 ] ;
break ;
case 249 :
if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'LOCATION' ] } ;
}
break ;
case 271 :
parser . suggestKeywords ( [ 'AS' , 'SET TBLPROPERTIES' ] ) ;
break ;
case 273 :
case 699 :
case 722 :
case 1107 :
case 1842 :
case 2267 :
parser . suggestKeywords ( [ 'SELECT' ] ) ;
break ;
case 279 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'TABLE' , 'REPAIR TABLE' ] ) ;
}
else {
parser . suggestKeywords ( [ 'TABLE' ] ) ;
}
break ;
case 283 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'ADD PARTITIONS' , 'DROP PARTITIONS' , 'SYNC PARTITIONS' ] ) ;
}
break ;
case 293 :
parser . suggestKeywords ( [ 'FUNCTION' ] ) ;
break ;
case 309 :
parser . suggestDdlAndDmlKeywords ( [ 'EXPLAIN' , 'FROM' ] ) ;
break ;
case 310 :
parser . suggestKeywords ( [ 'INSERT' , 'SELECT' ] ) ;
break ;
case 315 :
parser . addTablePrimary ( $$ [ $0 - 6 ] ) ;
break ;
case 320 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'PARTITION' , weight : 2 } , { value : 'COMPUTE STATISTICS' , weight : 1 } ] ) ;
}
else {
parser . suggestKeywords ( [ 'COMPUTE STATISTICS' ] ) ;
}
break ;
case 321 :
parser . addTablePrimary ( $$ [ $0 - 3 ] ) ;
parser . suggestKeywords ( [ 'STATISTICS' ] ) ;
break ;
case 322 :
parser . addTablePrimary ( $$ [ $0 - 7 ] ) ;
parser . suggestKeywords ( parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'FOR COLUMNS' , weight : 3 } , { value : 'CACHE METADATA' , weight : 2 } , { value : 'NOSCAN' , weight : 1 } ] ) ) ;
break ;
case 323 :
parser . addTablePrimary ( $$ [ $0 - 7 ] ) ;
parser . suggestKeywords ( parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'CACHE METADATA' , weight : 2 } , { value : 'NOSCAN' , weight : 1 } ] ) ) ;
break ;
case 324 :
parser . addTablePrimary ( $$ [ $0 - 7 ] ) ;
parser . suggestKeywords ( parser . getKeywordsForOptionalsLR ( [ $$ [ $0 ] ] , [ { value : 'NOSCAN' , weight : 1 } ] ) ) ;
break ;
case 325 :
parser . suggestKeywords ( [ 'TABLE' ] ) ;
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
break ;
case 326 :
parser . suggestKeywords ( [ 'TABLE' ] ) ;
parser . addTablePrimary ( $$ [ $0 - 6 ] ) ;
break ;
case 338 :
parser . suggestKeywords ( [ 'METADATA' ] ) ;
break ;
case 342 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestDdlAndDmlKeywords ( [
{ value : 'AST' , weight : 2 } ,
{ value : 'AUTHORIZATION' , weight : 2 } ,
{ value : 'CBO' , weight : 2 } ,
{ value : 'DEPENDENCY' , weight : 2 } ,
{ value : 'EXTENDED' , weight : 2 } ,
{ value : 'FORMATTED CBO' , weight : 2 } ,
{ value : 'LOCKS' , weight : 2 } ,
{ value : 'VECTORIZATION' , weight : 2 }
] ) ;
}
else if ( $$ [ $0 - 1 ] && $$ [ $0 - 1 ] . suggestKeywords ) {
parser . suggestDdlAndDmlKeywords ( $$ [ $0 - 1 ] . suggestKeywords ) ;
}
else {
parser . suggestDdlAndDmlKeywords ( ) ;
}
break ;
case 343 :
parser . suggestKeywords ( [ 'CBO' ] ) ;
break ;
case 347 :
case 348 :
if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'COST' , 'JOINCOST' ] } ;
}
break ;
case 352 :
var keywords = [ ] ;
if ( ! $$ [ $0 ] ) {
keywords = keywords . concat ( [
{ weight : 1 , value : 'DETAIL' } ,
{ weight : 1 , value : 'EXPRESSION' } ,
{ weight : 1 , value : 'OPERATOR' } ,
{ weight : 1 , value : 'SUMMARY' }
] ) ;
}
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { weight : 2 , value : 'ONLY' } ) ;
}
if ( keywords . length ) {
this . $ = { suggestKeywords : keywords } ;
}
break ;
case 378 :
if ( $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'TABLE' ] ) ;
}
else {
if ( $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'EXTERNAL TABLE' , 'FUNCTION' , 'MACRO' , 'TABLE' ] ) ;
}
else if ( ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'DATABASE' , 'EXTERNAL TABLE' , 'FUNCTION' , 'INDEX' , 'MATERIALIZED VIEW' , 'ROLE' , 'SCHEMA' , 'TABLE' , 'TEMPORARY EXTERNAL TABLE' , 'TEMPORARY FUNCTION' , 'TEMPORARY MACRO' , 'TEMPORARY TABLE' , 'TRANSACTIONAL TABLE' , 'VIEW' ] ) ;
}
else if ( $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'TABLE' ] ) ;
}
}
break ;
case 379 :
parser . addNewDatabaseLocation ( _$ [ $0 - 1 ] , [ { name : $$ [ $0 - 1 ] } ] ) ;
break ;
case 380 :
case 407 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF NOT EXISTS' ] ) ;
}
break ;
case 382 :
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'IF NOT EXISTS' ] ) ;
}
parser . addNewDatabaseLocation ( _$ [ $0 ] , [ { name : $$ [ $0 ] } ] ) ;
break ;
case 383 :
parser . addNewDatabaseLocation ( _$ [ $0 ] , [ { name : $$ [ $0 ] } ] ) ;
break ;
case 384 :
parser . addNewDatabaseLocation ( _$ [ $0 - 2 ] , [ { name : $$ [ $0 - 2 ] } ] ) ;
break ;
case 385 :
var keywords = [ ] ;
if ( ! $$ [ $0 ] ) {
keywords . push ( 'WITH DBPROPERTIES' ) ;
}
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
keywords . push ( 'LOCATION' ) ;
}
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
keywords . push ( 'COMMENT' ) ;
}
if ( keywords . length > 0 ) {
parser . suggestKeywords ( keywords ) ;
}
break ;
case 400 :
parser . suggestKeywords ( [ 'DBPROPERTIES' ] ) ;
break ;
case 419 :
var keywords = [ ] ;
if ( ! $$ [ $0 - 10 ] && ! $$ [ $0 - 9 ] && ! $$ [ $0 - 8 ] && ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'LIKE' , weight : 1 } ) ;
}
else {
if ( ! $$ [ $0 - 9 ] && ! $$ [ $0 - 8 ] && ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'COMMENT' , weight : 10 } ) ;
}
if ( ! $$ [ $0 - 8 ] && ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'PARTITIONED BY' , weight : 9 } ) ;
}
if ( ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'CLUSTERED BY' , weight : 8 } ) ;
}
if ( ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'SKEWED BY' , weight : 7 } ) ;
}
else if ( $$ [ $0 - 6 ] && $$ [ $0 - 6 ] . suggestKeywords && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 6 ] . suggestKeywords , 7 ) ) ; // Get the last optional from SKEWED BY
}
if ( ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'ROW FORMAT' , weight : 6 } ) ;
}
else if ( $$ [ $0 - 5 ] && $$ [ $0 - 5 ] . suggestKeywords && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 5 ] . suggestKeywords , 6 ) ) ;
}
if ( ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'STORED AS' , weight : 5 } ) ;
keywords . push ( { value : 'STORED BY' , weight : 5 } ) ;
}
else if ( $$ [ $0 - 4 ] && $$ [ $0 - 4 ] . storedBy && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'WITH SERDEPROPERTIES' , weight : 4 } ) ;
}
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'LOCATION' , weight : 3 } ) ;
}
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'TBLPROPERTIES' , weight : 2 } ) ;
}
keywords . push ( { value : 'AS' , weight : 1 } ) ;
}
parser . suggestKeywords ( keywords ) ;
break ;
case 420 :
parser . addNewTableLocation ( _$ [ $0 - 1 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ) ;
this . $ = $$ [ $0 ] ;
break ;
case 425 :
this . $ = [ ] ;
break ;
case 429 :
case 750 :
case 752 :
case 1105 :
case 1602 :
case 1605 :
case 1720 :
case 1798 :
case 1991 :
case 2170 :
case 2264 :
case 2322 :
this . $ = $$ [ $0 - 1 ] ;
break ;
case 430 :
case 751 :
case 753 :
this . $ = $$ [ $0 - 3 ] ;
break ;
case 433 :
parser . suggestKeywords ( [ { value : 'PRIMARY KEY' , weight : 2 } , { value : 'CONSTRAINT' , weight : 1 } ] ) ;
break ;
case 434 :
case 1834 :
this . $ = [ $$ [ $0 ] ] ;
break ;
case 435 :
this . $ = $$ [ $0 - 2 ] . concat ( $$ [ $0 ] ) ;
break ;
case 440 :
case 442 :
case 619 :
parser . checkForKeywords ( $$ [ $0 - 1 ] ) ;
break ;
case 441 :
case 443 :
parser . checkForKeywords ( $$ [ $0 - 3 ] ) ;
break ;
case 444 :
this . $ = $$ [ $0 - 3 ] ;
this . $ . type = $$ [ $0 - 2 ] ;
var keywords = [ ] ;
if ( ! $$ [ $0 ] ) {
keywords = keywords . concat ( [
{ value : 'COMMENT' , weight : 1 } ,
{ value : 'CHECK' , weight : 2 } ,
{ value : 'PRIMARY KEY' , weight : 2 } ,
{ value : 'UNIQUE' , weight : 2 } ,
{ value : 'NOT NULL' , weight : 2 } ,
{ value : 'DEFAULT' , weight : 2 }
] ) ;
if ( ! $$ [ $0 - 1 ] && $$ [ $0 - 2 ] . toLowerCase ( ) === 'double' ) {
keywords . push ( { value : 'PRECISION' , weight : 3 } ) ;
}
else if ( $$ [ $0 - 1 ] && $$ [ $0 - 1 ] . suggestKeywords ) {
keywords = keywords . concat ( $$ [ $0 - 1 ] . suggestKeywords ) ;
}
}
if ( keywords . length > 0 ) {
this . $ . suggestKeywords = keywords ;
}
break ;
case 445 :
case 487 :
case 493 :
case 494 :
case 507 :
case 510 :
case 522 :
case 524 :
case 810 :
parser . suggestKeywords ( parser . getColumnDataTypeKeywords ( ) ) ;
break ;
case 452 :
this . $ = { suggestKeywords : [ { value : 'KEY' , weight : 3 } ] } ;
break ;
case 455 :
this . $ = { suggestKeywords : [ { value : 'NULL' , weight : 3 } ] } ;
break ;
case 458 :
this . $ = {
suggestKeywords : [
{ value : 'LITERAL' , weight : 3 } ,
{ value : 'CURRENT_USER()' , weight : 3 } ,
{ value : 'CURRENT_DATE()' , weight : 3 } ,
{ value : 'CURRENT_TIMESTAMP()' , weight : 3 } ,
{ value : 'NULL' , weight : 3 }
]
} ;
break ;
case 459 :
var keywords = [ ] ;
if ( ! $$ [ $0 ] ) {
keywords . push ( { value : 'RELY' , weight : 3 } ) ;
keywords . push ( { value : 'NORELY' , weight : 3 } ) ;
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'NOVALIDATE' , weight : 3 } ) ;
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( { value : 'RELY' , weight : 3 } ) ;
keywords . push ( { value : 'NORELY' , weight : 3 } ) ;
}
}
}
if ( keywords . length ) {
this . $ = { suggestKeywords : keywords } ;
}
break ;
case 492 :
parser . suggestKeywords ( parser . getTypeKeywords ( ) ) ;
break ;
case 506 :
case 509 :
parser . suggestKeywords ( [ 'COMMENT' ] ) ;
break ;
case 532 :
parser . suggestKeywords ( [ 'CONSTRAINT' ] ) ;
break ;
case 542 :
parser . suggestKeywordsForOptionalsLR ( [ $$ [ $0 - 1 ] , $$ [ $0 - 2 ] , $$ [ $0 - 3 ] ] , [
[ { value : 'RELY' , weight : 1 } , { value : 'NORELY' , weight : 1 } ] ,
{ value : 'NOVALIDATE' , weight : 2 } ,
{ value : 'DISABLE' , weight : 3 }
] ) ;
break ;
case 546 :
parser . suggestKeywords ( [ 'CHECK' , 'FOREIGN KEY' , 'UNIQUE' ] ) ;
break ;
case 551 :
parser . suggestKeywordsForOptionalsLR ( [ $$ [ $0 - 1 ] , $$ [ $0 - 2 ] , $$ [ $0 - 3 ] ] , [
[ { value : 'RELY' , weight : 1 } , { value : 'NORELY' , weight : 1 } ] ,
{ value : 'NOVALIDATE' , weight : 2 } ,
{ value : 'DISABLE' , weight : 1 }
] ) ;
break ;
case 553 :
case 563 :
parser . suggestKeywords ( [ 'KEY' ] ) ;
break ;
case 555 :
parser . suggestKeywords ( [ 'REFERENCES' ] ) ;
break ;
case 572 :
parser . suggestKeywords ( [ 'HASH' , 'RANGE' ] ) ;
break ;
case 586 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'INTO' , weight : 1 } , { value : 'SORTED BY' , weight : 2 } ] ) ;
}
else {
parser . suggestKeywords ( [ 'INTO' ] ) ;
}
break ;
case 587 :
parser . suggestKeywords ( [ 'BUCKETS' ] ) ;
break ;
case 595 :
parser . suggestKeywords ( [ 'SORTED ON' ] ) ;
break ;
case 624 :
this . $ = { suggestKeywords : [ 'STORED AS DIRECTORIES' ] } ;
break ;
case 633 :
this . $ = $$ [ $0 ] ;
break ;
case 634 :
parser . suggestKeywords ( [ 'FORMAT' ] ) ;
break ;
case 635 :
parser . suggestKeywords ( [ 'DELIMITED' , 'SERDE' ] ) ;
break ;
case 640 :
this . $ = { storedBy : true } ;
break ;
case 641 :
parser . suggestKeywords ( [ 'AS' , 'BY' ] ) ;
break ;
case 643 :
this . $ = { suggestKeywords : [ 'STORED AS' ] } ;
break ;
case 658 :
if ( ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'FIELDS TERMINATED BY' , weight : 5 } , { value : 'COLLECTION ITEMS TERMINATED BY' , weight : 4 } , { value : 'MAP KEYS TERMINATED BY' , weight : 3 } , { value : 'LINES TERMINATED BY' , weight : 2 } , { value : 'NULL DEFINED AS' , weight : 1 } ] } ;
}
else if ( $$ [ $0 - 4 ] && $$ [ $0 - 4 ] . suggestKeywords && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : parser . createWeightedKeywords ( $$ [ $0 - 4 ] . suggestKeywords , 5 ) . concat ( [ { value : 'COLLECTION ITEMS TERMINATED BY' , weight : 4 } , { value : 'MAP KEYS TERMINATED BY' , weight : 3 } , { value : 'LINES TERMINATED BY' , weight : 2 } , { value : 'NULL DEFINED AS' , weight : 1 } ] ) } ;
}
else if ( ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'COLLECTION ITEMS TERMINATED BY' , weight : 4 } , { value : 'MAP KEYS TERMINATED BY' , weight : 3 } , { value : 'LINES TERMINATED BY' , weight : 2 } , { value : 'NULL DEFINED AS' , weight : 1 } ] } ;
}
else if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'MAP KEYS TERMINATED BY' , weight : 3 } , { value : 'LINES TERMINATED BY' , weight : 2 } , { value : 'NULL DEFINED AS' , weight : 1 } ] } ;
}
else if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'LINES TERMINATED BY' , weight : 2 } , { value : 'NULL DEFINED AS' , weight : 1 } ] } ;
}
else if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'NULL DEFINED AS' , weight : 1 } ] } ;
}
break ;
case 665 :
this . $ = { suggestKeywords : [ 'ESCAPED BY' ] } ;
break ;
case 667 :
case 673 :
case 678 :
case 682 :
parser . suggestKeywords ( [ 'TERMINATED BY' ] ) ;
break ;
case 672 :
parser . suggestKeywords ( [ 'ITEMS TERMINATED BY' ] ) ;
break ;
case 677 :
parser . suggestKeywords ( [ 'KEYS TERMINATED BY' ] ) ;
break ;
case 686 :
parser . suggestKeywords ( [ 'DEFINED AS' ] ) ;
break ;
case 687 :
case 728 :
case 732 :
case 761 :
case 1841 :
case 2397 :
parser . suggestKeywords ( [ 'AS' ] ) ;
break ;
case 691 :
case 692 :
parser . suggestKeywords ( [ 'SERDEPROPERTIES' ] ) ;
break ;
case 701 :
parser . commitLocations ( ) ;
break ;
case 704 :
case 717 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF NOT EXISTS' ] ) ;
}
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 705 :
parser . suggestKeywordsForOptionalsLR ( [ undefined , $$ [ $0 - 2 ] , $$ [ $0 - 3 ] , $$ [ $0 - 4 ] , $$ [ $0 - 5 ] , $$ [ $0 - 6 ] , $$ [ $0 - 7 ] , $$ [ $0 - 8 ] , $$ [ $0 - 9 ] ] , [
{ value : 'AS SELECT' , weight : 1 } ,
{ value : 'TBLPROPERTIES' , weight : 2 } ,
{ value : 'LOCATION' , weight : 3 } ,
[ { value : 'ROW FORMAT' , weight : 4 } , { value : 'STORED AS' , weight : 4 } , { value : 'STORED BY' , weight : 4 } ] ,
[ { value : 'CLUSTERED ON' , weight : 5 } , { value : 'DISTRIBUTED ON' , weight : 5 } ] ,
{ value : 'PARTITIONED ON' , weight : 6 } ,
{ value : 'COMMENT' , weight : 7 } ,
{ value : 'DISABLE REWRITE' , weight : 8 }
] ) ;
break ;
case 715 :
parser . suggestKeywords ( [ 'REWRITE' ] ) ;
break ;
case 718 :
if ( ! $$ [ $0 - 7 ] ) {
parser . suggestKeywords ( [ 'IF NOT EXISTS' ] ) ;
}
break ;
case 721 :
var keywords = [ { value : 'AS' , weight : 1 } ] ;
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'TBLPROPERTIES' , weight : 2 } ) ;
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( { value : 'COMMENT' , weight : 3 } ) ;
}
}
parser . suggestKeywords ( keywords ) ;
break ;
case 730 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'USING' ] ) ;
}
else {
parser . suggestKeywords ( [ 'ARCHIVE' , 'FILE' , 'JAR' ] ) ;
}
break ;
case 734 :
parser . suggestFunctions ( ) ;
parser . suggestAggregateFunctions ( ) ;
parser . suggestAnalyticFunctions ( ) ;
break ;
case 737 :
parser . suggestKeywords ( [ 'ARCHIVE' , 'FILE' , 'JAR' ] ) ;
break ;
case 747 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'COMMENT' ] ) ;
}
break ;
case 756 :
parser . suggestKeywords ( [ 'ON TABLE' ] ) ;
break ;
case 762 :
case 775 :
parser . suggestKeywords ( [ '\'BITMAP\'' , '\'COMPACT\'' ] ) ;
break ;
case 769 :
if ( $$ [ $0 - 4 ] && parser . yy . result . suggestKeywords && parser . yy . result . suggestKeywords . length === 2 ) {
parser . suggestKeywords ( [ 'AS' ] ) ;
}
break ;
case 771 :
if ( ! $$ [ $0 - 8 ] && ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'WITH DEFERRED REBUILD' , weight : 7 } , { value : 'IDXPROPERTIES' , weight : 6 } , { value : 'IN TABLE' , weight : 5 } , { value : 'ROW FORMAT' , weight : 4 } , { value : 'STORED AS' , weight : 4 } , { value : 'STORED BY' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 7 ] && ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'IDXPROPERTIES' , weight : 6 } , { value : 'IN TABLE' , weight : 5 } , { value : 'ROW FORMAT' , weight : 4 } , { value : 'STORED AS' , weight : 4 } , { value : 'STORED BY' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'IN TABLE' , weight : 5 } , { value : 'ROW FORMAT' , weight : 4 } , { value : 'STORED AS' , weight : 4 } , { value : 'STORED BY' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'ROW FORMAT' , weight : 4 } , { value : 'STORED AS' , weight : 4 } , { value : 'STORED BY' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( $$ [ $0 - 5 ] && $$ [ $0 - 5 ] . suggestKeywords && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( parser . createWeightedKeywords ( $$ [ $0 - 5 ] . suggestKeywords , 5 ) . concat ( [ { value : 'STORED AS' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ) ;
}
else if ( ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'STORED AS' , weight : 4 } , { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'LOCATION' , weight : 3 } , { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'TBLPROPERTIES' , weight : 2 } , { value : 'COMMENT' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'COMMENT' , weight : 1 } ] ) ;
}
break ;
case 778 :
parser . suggestKeywords ( [ 'DEFERRED REBUILD' ] ) ;
break ;
case 779 :
parser . suggestKeywords ( [ 'REBUILD' ] ) ;
break ;
case 798 :
parser . suggestFunctions ( ) ;
break ;
case 824 :
parser . addCommonTableExpressions ( $$ [ $0 - 1 ] ) ;
break ;
case 848 :
parser . suggestKeywords ( [ 'DATABASE' , 'FUNCTION' , 'INDEX' , 'MATERIALIZED VIEW' , 'ROLE' , 'SCHEMA' , 'TABLE' , 'TEMPORARY FUNCTION' , 'TEMPORARY MACRO' , 'VIEW' ] ) ;
break ;
case 852 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
parser . suggestDatabases ( ) ;
break ;
case 853 :
parser . suggestKeywords ( [ 'CASCADE' , 'RESTRICT' ] ) ;
break ;
case 855 :
if ( ! $$ [ $0 - 3 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
break ;
case 858 :
case 863 :
case 882 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
break ;
case 859 :
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
break ;
case 868 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
parser . suggestTables ( { onlyTables : true } ) ;
parser . suggestDatabases ( {
appendDot : true
} ) ;
break ;
case 871 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'PURGE' ] ) ;
}
break ;
case 875 :
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
break ;
case 881 :
parser . suggestKeywords ( [ 'FUNCTION' , 'MACRO' ] ) ;
break ;
case 889 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
parser . suggestTables ( { onlyViews : true } ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 890 :
parser . addTablePrimary ( $$ [ $0 ] ) ;
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'IF EXISTS' ] ) ;
}
break ;
case 898 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 902 :
case 1009 :
case 1014 :
case 1017 :
case 1021 :
parser . suggestKeywords ( [ 'FROM' ] ) ;
break ;
case 904 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 ] ) {
parser . suggestKeywords ( [ 'WHERE' ] ) ;
}
break ;
case 908 :
parser . suggestKeywords ( [ 'TRANSACTIONS' ] ) ;
break ;
case 914 :
parser . suggestKeywords ( [ 'ALL' , 'ALTER' , 'CREATE' , 'DELETE' , 'DROP' , 'INDEX' , 'INSERT' , 'LOCK' , 'ROLE' , 'SELECT' , 'UPDATE' ] ) ;
break ;
case 917 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'ON' , 'TO' ] ) ;
}
else {
parser . suggestKeywords ( [ 'TO' ] ) ;
}
break ;
case 920 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'WITH GRANT OPTION' ] ) ;
}
break ;
case 925 :
case 929 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'WITH ADMIN OPTION' ] ) ;
}
break ;
case 933 :
parser . suggestKeywords ( [ 'DATABASE' , 'TABLE' ] ) ;
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 942 :
if ( $$ [ $0 ] . toUpperCase ( ) === 'ALL' ) {
this . $ = { singleAll : true } ;
}
break ;
case 948 :
case 949 :
case 950 :
case 1000 :
parser . suggestKeywords ( [ 'ALL' , 'ALTER' , 'CREATE' , 'DELETE' , 'DROP' , 'INDEX' , 'INSERT' , 'LOCK' , 'SELECT' , 'SHOW_DATABASE' , 'UPDATE' ] ) ;
break ;
case 979 :
parser . suggestKeywords ( [ 'GRANT OPTION' ] ) ;
break ;
case 980 :
case 984 :
case 1024 :
parser . suggestKeywords ( [ 'OPTION' ] ) ;
break ;
case 983 :
parser . suggestKeywords ( [ 'ADMIN OPTION' ] ) ;
break ;
case 992 :
parser . suggestKeywords ( [ 'ADMIN OPTION FOR' , 'ALL' , 'ALL GRANT OPTION FROM' , 'ALL PRIVILEGES FROM' , 'ALTER' , 'CREATE' , 'DELETE' , 'DROP' , 'GRANT OPTION FOR' , 'INDEX' , 'INSERT' , 'LOCK' , 'ROLE' , 'SELECT' , 'UPDATE' ] ) ;
break ;
case 995 :
if ( ! $$ [ $0 - 1 ] ) {
if ( $$ [ $0 - 2 ] . singleAll ) {
parser . suggestKeywords ( [ 'FROM' , 'GRANT OPTION' , 'ON' , 'PRIVILEGES FROM' ] ) ;
}
else {
parser . suggestKeywords ( [ 'FROM' , 'ON' ] ) ;
}
}
else {
parser . suggestKeywords ( [ 'FROM' ] ) ;
}
break ;
case 998 :
parser . suggestKeywords ( [ 'OPTION FOR' ] ) ;
break ;
case 999 :
case 1012 :
parser . suggestKeywords ( [ 'FOR' ] ) ;
break ;
case 1003 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'FROM' , 'ON' ] ) ;
}
else {
parser . suggestKeywords ( [ 'FROM' ] ) ;
}
break ;
case 1006 :
if ( $$ [ $0 - 1 ] . toUpperCase ( ) === 'ADMIN' ) {
parser . suggestKeywords ( [ 'FROM' , 'OPTION FOR' ] ) ;
}
else {
parser . suggestKeywords ( [ 'FROM' ] ) ;
}
break ;
case 1013 :
parser . suggestKeywords ( [ 'ROLE' ] ) ;
break ;
case 1030 :
var keywords = [ ] ;
if ( $$ [ $0 - 1 ] . suggestKeywords ) {
keywords = parser . createWeightedKeywords ( $$ [ $0 - 1 ] . suggestKeywords , 2 ) . concat ( [ { value : 'SELECT' , weight : 1 } ] ) ;
}
else {
keywords = [ 'SELECT' ] ;
}
if ( $$ [ $0 - 1 ] . addValues ) {
keywords . push ( { weight : 1.1 , value : 'VALUES' } ) ;
}
if ( keywords . length > 0 ) {
parser . suggestKeywords ( keywords ) ;
}
break ;
case 1033 :
if ( ! $$ [ $0 ] . keepTables ) {
delete parser . yy . result . suggestTables ;
delete parser . yy . result . suggestDatabases ;
}
break ;
case 1037 :
parser . suggestKeywords ( [ 'INSERT INTO' , 'INSERT OVERWRITE' , 'SELECT' ] ) ;
break ;
case 1038 :
if ( $$ [ $0 - 1 ] . cursorAtEnd ) {
parser . checkForSelectListKeywords ( $$ [ $0 - 1 ] ) ;
var keywords = parser . yy . result . suggestKeywords || [ ] ;
if ( $$ [ $0 ] . suggestKeywords ) {
keywords = keywords . concat ( $$ [ $0 ] . suggestKeywords ) ;
}
if ( keywords . length > 0 ) {
parser . suggestKeywords ( keywords ) ;
}
}
delete parser . yy . result . suggestTables ;
delete parser . yy . result . suggestDatabases ;
break ;
case 1039 :
if ( $$ [ $0 ] . cursorAtStart ) {
parser . checkForSelectListKeywords ( $$ [ $0 - 1 ] . tableExpression ) ;
}
break ;
case 1040 :
$$ [ $0 - 3 ] . owner = 'insert' ;
parser . addTablePrimary ( $$ [ $0 - 3 ] ) ;
break ;
case 1041 :
$$ [ $0 - 2 ] . owner = 'insert' ;
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'PARTITION' ] } ;
}
else if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'IF NOT EXISTS' ] } ;
}
break ;
case 1042 :
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'ROW FORMAT' , weight : 2 } , { value : 'STORED AS' , weight : 1 } ] } ;
}
else if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'STORED AS' ] } ;
}
break ;
case 1043 :
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ { value : 'ROW FORMAT' , weight : 2 } , { value : 'STORED AS' , weight : 1 } ] } ;
}
else if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'STORED AS' ] } ;
}
break ;
case 1044 :
$$ [ $0 - 2 ] . owner = 'insert' ;
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'PARTITION' ] , addValues : true } ;
}
else if ( ! $$ [ $0 ] ) {
this . $ = { addValues : true } ;
}
break ;
case 1045 :
parser . suggestKeywords ( [ 'OVERWRITE' , 'INTO' ] ) ;
break ;
case 1046 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'DIRECTORY' , 'LOCAL DIRECTORY' , 'TABLE' ] ) ;
}
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
this . $ = { keepTables : true } ;
break ;
case 1047 :
case 1058 :
this . $ = { keepTables : true } ;
break ;
case 1048 :
case 1059 :
case 1060 :
$$ [ $0 - 2 ] . owner = 'insert' ;
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( parser . yy . result . suggestColumns ) {
parser . yy . result . suggestColumns . owner = 'insert' ;
}
break ;
case 1049 :
$$ [ $0 - 2 ] . owner = 'insert' ;
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
break ;
case 1050 :
parser . suggestKeywords ( [ 'DIRECTORY' ] ) ;
break ;
case 1057 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'TABLE' ] ) ;
}
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
this . $ = { keepTables : true } ;
break ;
case 1070 :
if ( $$ [ $0 - 1 ] . suggestKeywords ) {
parser . suggestKeywords ( parser . createWeightedKeywords ( $$ [ $0 - 1 ] . suggestKeywords , 2 ) . concat ( [ { value : 'SELECT' , weight : 1 } ] ) ) ;
}
else {
parser . suggestKeywords ( [ 'SELECT' ] ) ;
}
break ;
case 1071 :
if ( $$ [ $0 - 1 ] . cursorAtEnd ) {
parser . checkForSelectListKeywords ( $$ [ $0 - 1 ] ) ;
var keywords = parser . yy . result . suggestKeywords || [ ] ;
if ( $$ [ $0 ] . suggestKeywords ) {
keywords = keywords . concat ( $$ [ $0 ] . suggestKeywords ) ;
}
if ( keywords . length > 0 ) {
parser . suggestKeywords ( keywords ) ;
}
}
break ;
case 1080 :
parser . suggestKeywords ( [ 'FORMAT DELIMITED' ] ) ;
break ;
case 1081 :
parser . suggestKeywords ( [ 'DELIMITED' ] ) ;
break ;
case 1083 :
this . $ = { selectList : $$ [ $0 ] } ;
break ;
case 1084 :
this . $ = $$ [ $0 - 1 ] ;
this . $ . cursorAtEnd = true ;
break ;
case 1085 :
parser . selectListNoTableSuggest ( $$ [ $0 ] , $$ [ $0 - 1 ] ) ;
break ;
case 1086 :
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 1 ] || $$ [ $0 - 1 ] === 'ALL' ) {
parser . suggestAggregateFunctions ( ) ;
parser . suggestAnalyticFunctions ( ) ;
}
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'ALL' , weight : 2 } ) ;
keywords . push ( { value : 'DISTINCT' , weight : 2 } ) ;
}
parser . suggestKeywords ( keywords ) ;
parser . suggestFunctions ( ) ;
parser . suggestColumns ( ) ;
break ;
case 1090 :
case 1126 :
case 1712 :
case 1908 :
case 1909 :
case 1915 :
case 1916 :
case 2260 :
case 2349 :
parser . valueExpressionSuggest ( ) ;
break ;
case 1092 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] , [ { value : 'WHEN' , weight : 2 } ] ) ;
break ;
case 1094 :
$$ [ $0 - 6 ] . alias = $$ [ $0 - 4 ] ;
parser . addTablePrimary ( $$ [ $0 - 6 ] ) ;
if ( $$ [ $0 - 2 ] . subQuery ) {
parser . addTablePrimary ( { subQueryAlias : $$ [ $0 ] } ) ;
}
else {
$$ [ $0 - 2 ] . alias = $$ [ $0 ] ;
}
break ;
case 1095 :
parser . suggestKeywords ( [ 'INTO' ] ) ;
break ;
case 1096 :
parser . suggestDatabases ( { appendDot : true } ) ;
parser . suggestTables ( ) ;
break ;
case 1098 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
parser . suggestKeywords ( [ 'AS T USING' ] ) ;
break ;
case 1099 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
parser . suggestKeywords ( [ 'T USING' ] ) ;
break ;
case 1100 :
$$ [ $0 - 3 ] . alias = $$ [ $0 - 1 ] ;
parser . addTablePrimary ( $$ [ $0 - 3 ] ) ;
parser . suggestKeywords ( [ 'USING' ] ) ;
break ;
case 1101 :
$$ [ $0 - 4 ] . alias = $$ [ $0 - 2 ] ;
parser . addTablePrimary ( $$ [ $0 - 4 ] ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
parser . suggestTables ( ) ;
break ;
case 1102 :
$$ [ $0 - 4 ] . alias = $$ [ $0 - 2 ] ;
parser . addTablePrimary ( $$ [ $0 - 4 ] ) ;
break ;
case 1103 :
$$ [ $0 - 5 ] . alias = $$ [ $0 - 3 ] ;
parser . addTablePrimary ( $$ [ $0 - 5 ] ) ;
parser . suggestKeywords ( [ 'AS S ON' ] ) ;
break ;
case 1104 :
$$ [ $0 - 6 ] . alias = $$ [ $0 - 4 ] ;
parser . addTablePrimary ( $$ [ $0 - 6 ] ) ;
parser . suggestKeywords ( [ 'S ON' ] ) ;
break ;
case 1113 :
if ( $$ [ $0 ] . suggestThenKeywords ) {
parser . suggestKeywords ( [ 'DELETE' , 'INSERT VALUES' , 'UPDATE SET' ] ) ;
}
break ;
case 1114 :
case 1116 :
if ( ! $$ [ $0 - 1 ] . notPresent ) {
parser . suggestKeywords ( [ 'WHEN' ] ) ;
}
break ;
case 1115 :
if ( ! $$ [ $0 - 1 ] . notPresent && $$ [ $0 ] . suggestThenKeywords ) {
var keywords = [ ] ;
if ( ! $$ [ $0 - 1 ] . isDelete ) {
keywords . push ( 'DELETE' ) ;
}
if ( ! $$ [ $0 - 1 ] . isInsert ) {
keywords . push ( 'INSERT VALUES' ) ;
}
if ( ! $$ [ $0 - 1 ] . isUpdate ) {
keywords . push ( 'UPDATE SET' ) ;
}
parser . suggestKeywords ( keywords ) ;
}
break ;
case 1117 :
if ( ! $$ [ $0 - 1 ] . notPresent && $$ [ $0 ] . suggestThenKeywords ) {
var keywords = [ ] ;
if ( ! $$ [ $0 - 2 ] . isDelete && ! $$ [ $0 - 1 ] . isDelete ) {
keywords . push ( 'DELETE' ) ;
}
if ( ! $$ [ $0 - 2 ] . isInsert && ! $$ [ $0 - 1 ] . isInsert ) {
keywords . push ( 'INSERT VALUES' ) ;
}
if ( ! $$ [ $0 - 2 ] . isUpdate && ! $$ [ $0 - 1 ] . isUpdate ) {
keywords . push ( 'UPDATE SET' ) ;
}
parser . suggestKeywords ( keywords ) ;
}
break ;
case 1118 :
this . $ = { notPresent : ! ! $$ [ $0 - 4 ] , isDelete : $$ [ $0 ] . isDelete , isInsert : $$ [ $0 ] . isInsert , isUpdate : $$ [ $0 ] . isUpdate } ;
break ;
case 1119 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'NOT MATCHED' , 'MATCHED' ] ) ;
}
else {
parser . suggestKeywords ( [ 'MATCHED' ] ) ;
}
break ;
case 1120 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'AND' , 'THEN' ] ) ;
}
else {
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] , [ { value : 'THEN' , weight : 2 } ] ) ;
}
break ;
case 1122 :
this . $ = { suggestThenKeywords : true } ;
break ;
case 1127 :
this . $ = { isUpdate : true } ;
break ;
case 1128 :
this . $ = { isDelete : true } ;
break ;
case 1129 :
this . $ = { isInsert : true } ;
break ;
case 1130 :
parser . suggestKeywords ( [ 'SET' ] ) ;
break ;
case 1132 :
case 1652 :
case 1655 :
parser . suggestKeywords ( [ 'VALUES' ] ) ;
break ;
case 1134 :
parser . suggestKeywords ( [ 'DATA LOCAL INPATH' , 'DATA INPATH' ] ) ;
break ;
case 1135 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'INPATH' , 'LOCAL INPATH' ] ) ;
}
else {
parser . suggestKeywords ( [ 'INPATH' ] ) ;
}
break ;
case 1137 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'OVERWRITE INTO TABLE' , 'INTO TABLE' ] ) ;
}
else {
parser . suggestKeywords ( [ 'INTO TABLE' ] ) ;
}
break ;
case 1138 :
parser . suggestKeywords ( [ 'TABLE' ] ) ;
break ;
case 1141 :
parser . addTablePrimary ( $$ [ $0 - 3 ] ) ;
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'INPUTFORMAT' , 'PARTITION' ] ) ;
}
else if ( $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'INPUTFORMAT' ] ) ;
}
break ;
case 1152 :
parser . suggestKeywords ( [ 'SERDE' ] ) ;
break ;
case 1154 :
if ( ! $$ [ $0 ] ) {
parser . suggestKeywords ( [ 'EXTERNAL TABLE' , 'FROM' , 'TABLE' ] ) ;
}
else if ( ! $$ [ $0 ] . hasExternal ) {
parser . suggestKeywords ( [ 'EXTERNAL' ] ) ;
}
break ;
case 1155 :
if ( $$ [ $0 - 1 ] . suggestKeywords ) {
parser . suggestKeywords ( parser . createWeightedKeywords ( $$ [ $0 - 1 ] . suggestKeywords , 2 ) . concat ( [ 'FROM' ] ) ) ;
}
else {
parser . suggestKeywords ( [ 'FROM' ] ) ;
}
break ;
case 1159 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'LOCATION' ] ) ;
}
break ;
case 1160 :
if ( ! $$ [ $0 - 4 ] ) {
parser . suggestKeywords ( [ 'EXTERNAL TABLE' , 'TABLE' ] ) ;
}
else if ( ! $$ [ $0 - 4 ] . hasExternal ) {
parser . suggestKeywords ( [ 'EXTERNAL' ] ) ;
}
break ;
case 1162 :
if ( $$ [ $0 - 5 ] . suggestKeywords ) {
parser . suggestKeywords ( parser . createWeightedKeywords ( $$ [ $0 - 5 ] . suggestKeywords , 2 ) . concat ( [ 'FROM' ] ) ) ;
}
break ;
case 1165 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
if ( ! $$ [ $0 ] ) {
this . $ = { hasExternal : true , suggestKeywords : [ 'PARTITION' ] } ;
}
else {
this . $ = { hasExternal : true } ;
}
break ;
case 1166 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
if ( ! $$ [ $0 ] ) {
this . $ = { suggestKeywords : [ 'PARTITION' ] } ;
}
break ;
case 1174 :
case 1181 :
case 1188 :
parser . addTablePrimary ( $$ [ $0 - 4 ] ) ;
break ;
case 1175 :
case 1189 :
case 1190 :
parser . addTablePrimary ( $$ [ $0 - 9 ] ) ;
break ;
case 1179 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { weight : 2 , value : 'PARTITION' } , { weight : 1 , value : 'TO' } ] ) ;
}
else {
parser . suggestKeywords ( [ 'TO' ] ) ;
}
break ;
case 1182 :
parser . addTablePrimary ( $$ [ $0 - 5 ] ) ;
parser . suggestKeywords ( [ 'FOR replication()' ] ) ;
break ;
case 1183 :
parser . addTablePrimary ( $$ [ $0 - 6 ] ) ;
parser . suggestKeywords ( [ 'replication()' ] ) ;
break ;
case 1186 :
parser . addTablePrimary ( $$ [ $0 - 5 ] ) ;
if ( ! $$ [ $0 - 4 ] ) {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 1187 :
parser . addTablePrimary ( $$ [ $0 - 10 ] ) ;
if ( ! $$ [ $0 - 9 ] ) {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 1192 :
case 1193 :
return parser . yy . result ;
break ;
case 1194 :
parser . prepareNewStatement ( ) ;
break ;
case 1196 :
case 1198 :
case 1200 :
parser . addStatementLocation ( _$ [ $0 ] ) ;
break ;
case 1199 :
case 1201 :
parser . addStatementLocation ( _$ [ $0 - 3 ] ) ;
break ;
case 1603 :
case 1606 :
case 1721 :
this . $ = '' ;
break ;
case 1621 :
parser . suggestKeywords ( [ 'INDEX' , 'INDEXES' ] ) ;
break ;
case 1622 :
parser . suggestKeywords ( [ 'FORMATTED' ] ) ;
break ;
case 1636 :
case 1639 :
parser . yy . correlatedSubQuery = false ;
break ;
case 1637 :
case 1641 :
parser . suggestKeywords ( [ 'EXISTS' ] ) ;
break ;
case 1640 :
parser . suggestKeywords ( [ 'NOT EXISTS' ] ) ;
break ;
case 1651 :
case 1653 :
case 1654 :
case 1656 :
parser . suggestKeywords ( [ '<' , '<=' , '<>' , '=' , '>' , '>=' ] ) ;
break ;
case 1691 :
case 1722 :
parser . addTableLocation ( _$ [ $0 ] , [ { name : $$ [ $0 ] } ] ) ;
this . $ = { identifierChain : [ { name : $$ [ $0 ] } ] } ;
break ;
case 1692 :
case 1723 :
parser . addDatabaseLocation ( _$ [ $0 - 2 ] , [ { name : $$ [ $0 - 2 ] } ] ) ;
parser . addTableLocation ( _$ [ $0 ] , [ { name : $$ [ $0 - 2 ] } , { name : $$ [ $0 ] } ] ) ;
this . $ = { identifierChain : [ { name : $$ [ $0 - 2 ] } , { name : $$ [ $0 ] } ] } ;
break ;
case 1694 :
case 1699 :
parser . suggestDatabases ( ) ;
this . $ = { identifierChain : [ { name : $$ [ $0 - 2 ] } ] } ;
break ;
case 1695 :
case 1725 :
parser . suggestTablesOrColumns ( $$ [ $0 - 2 ] ) ;
break ;
case 1696 :
this . $ = [ { name : $$ [ $0 ] } ] ;
break ;
case 1697 :
this . $ = [ { name : $$ [ $0 - 2 ] } , { name : $$ [ $0 - 1 ] } ] ;
break ;
case 1724 :
case 2634 :
parser . suggestTables ( ) ;
parser . suggestDatabases ( { prependDot : true } ) ;
break ;
case 1727 :
this . $ = { identifierChain : $$ [ $0 - 1 ] . identifierChain , alias : $$ [ $0 ] } ;
break ;
case 1730 :
parser . yy . locations [ parser . yy . locations . length - 1 ] . type = 'column' ;
break ;
case 1731 :
case 2125 :
parser . addAsteriskLocation ( _$ [ $0 ] , $$ [ $0 - 2 ] . concat ( { asterisk : true } ) ) ;
break ;
case 1733 :
this . $ = [ $$ [ $0 ] . identifier ] ;
parser . yy . firstChainLocation = parser . addUnknownLocation ( $$ [ $0 ] . location , [ $$ [ $0 ] . identifier ] ) ;
break ;
case 1734 :
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 1735 :
case 1743 :
if ( $$ [ $0 ] . insideKey ) {
parser . suggestKeyValues ( { identifierChain : [ $$ [ $0 ] . identifier ] } ) ;
parser . suggestColumns ( ) ;
parser . suggestFunctions ( ) ;
}
break ;
case 1736 :
case 1744 :
if ( $$ [ $0 ] . insideKey ) {
parser . suggestKeyValues ( { identifierChain : $$ [ $0 - 2 ] . concat ( [ $$ [ $0 ] . identifier ] ) } ) ;
parser . suggestColumns ( ) ;
parser . suggestFunctions ( ) ;
}
break ;
case 1739 :
parser . suggestColumns ( {
identifierChain : $$ [ $0 - 2 ]
} ) ;
this . $ = { suggestKeywords : [ { value : '*' , weight : 10000 } ] } ;
break ;
case 1740 :
parser . suggestColumns ( {
identifierChain : $$ [ $0 - 4 ]
} ) ;
this . $ = { suggestKeywords : [ { value : '*' , weight : 10000 } ] } ;
break ;
case 1741 :
this . $ = [ $$ [ $0 ] . identifier ] ;
break ;
case 1742 :
$$ [ $0 - 2 ] . push ( $$ [ $0 ] . identifier ) ;
break ;
case 1745 :
if ( $$ [ $0 - 2 ] . insideKey ) {
parser . suggestKeyValues ( { identifierChain : $$ [ $0 - 4 ] . concat ( [ $$ [ $0 - 2 ] . identifier ] ) } ) ;
parser . suggestColumns ( ) ;
parser . suggestFunctions ( ) ;
}
break ;
case 1746 :
if ( $$ [ $0 - 2 ] . insideKey ) {
parser . suggestKeyValues ( { identifierChain : [ $$ [ $0 - 2 ] . identifier ] } ) ;
parser . suggestColumns ( ) ;
parser . suggestFunctions ( ) ;
}
break ;
case 1748 :
parser . suggestColumns ( { identifierChain : $$ [ $0 - 2 ] } ) ;
break ;
case 1749 :
parser . suggestColumns ( { identifierChain : $$ [ $0 - 4 ] } ) ;
break ;
case 1751 :
this . $ = { identifier : { name : $$ [ $0 ] } , location : _$ [ $0 ] } ;
break ;
case 1752 :
this . $ = { identifier : { name : $$ [ $0 - 3 ] , keySet : true } , location : _$ [ $0 - 3 ] } ;
break ;
case 1753 :
this . $ = { identifier : { name : $$ [ $0 - 2 ] , keySet : true } , location : _$ [ $0 - 2 ] } ;
break ;
case 1754 :
this . $ = { identifier : { name : $$ [ $0 - 3 ] } , insideKey : true } ;
break ;
case 1755 :
this . $ = { identifier : { name : $$ [ $0 - 3 ] } } ;
break ;
case 1781 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
parser . addColumnLocation ( _$ [ $0 - 1 ] , $$ [ $0 - 1 ] ) ;
break ;
case 1783 :
parser . addDatabaseLocation ( _$ [ $0 ] , [ { name : $$ [ $0 ] } ] ) ;
break ;
case 1787 :
if ( ! $$ [ $0 - 4 ] ) {
parser . suggestKeywords ( [ 'EXTENDED' , 'FORMATTED' ] ) ;
}
break ;
case 1788 :
if ( ! $$ [ $0 - 3 ] ) {
parser . suggestKeywords ( [ 'EXTENDED' , 'FORMATTED' ] ) ;
}
break ;
case 1789 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
parser . suggestColumns ( ) ;
if ( ! $$ [ $0 ] ) {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 1790 :
if ( ! $$ [ $0 ] ) {
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
}
break ;
case 1793 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'DATABASE' , 'EXTENDED' , 'FORMATTED' , 'FUNCTION' , 'SCHEMA' ] ) ;
}
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 1794 :
case 1796 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'EXTENDED' ] ) ;
}
break ;
case 1795 :
case 1797 :
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'EXTENDED' ] ) ;
}
break ;
case 1800 :
case 2172 :
this . $ = $$ [ $0 - 2 ] ;
break ;
case 1803 :
parser . addCommonTableExpressions ( $$ [ $0 - 3 ] ) ;
break ;
case 1804 :
case 1805 :
case 1837 :
parser . addCommonTableExpressions ( $$ [ $0 - 2 ] ) ;
break ;
case 1809 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] ) , _$ [ $0 ] ) ;
this . $ = { selectList : $$ [ $0 ] } ;
break ;
case 1810 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) , _$ [ $0 - 1 ] ) ;
this . $ = { selectList : $$ [ $0 - 1 ] , tableExpression : $$ [ $0 ] } ;
break ;
case 1821 :
parser . suggestKeywords ( [ 'ALL' , 'DISTINCT' , 'SELECT' ] ) ;
break ;
case 1822 :
parser . suggestKeywords ( [ 'ALL' , 'DISTINCT' ] ) ;
break ;
case 1824 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] ) , _$ [ $0 ] ) ;
if ( $$ [ $0 ] . cursorAtStart ) {
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'ALL' , weight : 2 } ) ;
keywords . push ( { value : 'DISTINCT' , weight : 2 } ) ;
}
parser . suggestKeywords ( keywords ) ;
}
else {
parser . checkForSelectListKeywords ( $$ [ $0 ] ) ;
}
if ( $$ [ $0 ] . suggestFunctions ) {
parser . suggestFunctions ( ) ;
}
if ( $$ [ $0 ] . suggestColumns ) {
parser . suggestColumns ( { identifierChain : [ ] , source : 'select' } ) ;
}
if ( $$ [ $0 ] . suggestTables ) {
parser . suggestTables ( { prependQuestionMark : true , prependFrom : true } ) ;
}
if ( $$ [ $0 ] . suggestDatabases ) {
parser . suggestDatabases ( { prependQuestionMark : true , prependFrom : true , appendDot : true } ) ;
}
if ( $$ [ $0 ] . suggestAggregateFunctions && ( ! $$ [ $0 - 1 ] || $$ [ $0 - 1 ] === 'ALL' ) ) {
parser . suggestAggregateFunctions ( ) ;
parser . suggestAnalyticFunctions ( ) ;
}
break ;
case 1825 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] ) , _$ [ $0 ] , true ) ;
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 1 ] || $$ [ $0 - 1 ] === 'ALL' ) {
parser . suggestAggregateFunctions ( ) ;
parser . suggestAnalyticFunctions ( ) ;
}
if ( ! $$ [ $0 - 1 ] ) {
keywords . push ( { value : 'ALL' , weight : 2 } ) ;
keywords . push ( { value : 'DISTINCT' , weight : 2 } ) ;
}
parser . suggestKeywords ( keywords ) ;
parser . suggestFunctions ( ) ;
parser . suggestColumns ( { identifierChain : [ ] , source : 'select' } ) ;
parser . suggestTables ( { prependQuestionMark : true , prependFrom : true } ) ;
parser . suggestDatabases ( { prependQuestionMark : true , prependFrom : true , appendDot : true } ) ;
break ;
case 1826 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) , _$ [ $0 - 1 ] ) ;
break ;
case 1827 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) , _$ [ $0 - 1 ] ) ;
parser . selectListNoTableSuggest ( $$ [ $0 - 1 ] , $$ [ $0 - 2 ] ) ;
if ( parser . yy . result . suggestColumns ) {
parser . yy . result . suggestColumns . source = 'select' ;
}
break ;
case 1828 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) , _$ [ $0 - 1 ] , true ) ;
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 2 ] || $$ [ $0 - 2 ] === 'ALL' ) {
parser . suggestAggregateFunctions ( ) ;
parser . suggestAnalyticFunctions ( ) ;
}
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( { value : 'ALL' , weight : 2 } ) ;
keywords . push ( { value : 'DISTINCT' , weight : 2 } ) ;
}
parser . suggestKeywords ( keywords ) ;
parser . suggestFunctions ( ) ;
parser . suggestColumns ( { identifierChain : [ ] , source : 'select' } ) ;
parser . suggestTables ( { prependQuestionMark : true , prependFrom : true } ) ;
parser . suggestDatabases ( { prependQuestionMark : true , prependFrom : true , appendDot : true } ) ;
break ;
case 1829 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] ) , _$ [ $0 - 2 ] ) ;
parser . checkForSelectListKeywords ( $$ [ $0 - 2 ] ) ;
break ;
case 1830 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 4 ] , _$ [ $0 - 4 ] , $$ [ $0 - 5 ] , _$ [ $0 - 5 ] ) , _$ [ $0 - 3 ] ) ;
parser . checkForSelectListKeywords ( $$ [ $0 - 3 ] ) ;
break ;
case 1831 :
parser . addClauseLocation ( 'selectList' , parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) , _$ [ $0 - 1 ] ) ;
parser . checkForSelectListKeywords ( $$ [ $0 - 1 ] ) ;
var keywords = [ 'FROM' ] ;
if ( parser . yy . result . suggestKeywords ) {
keywords = parser . yy . result . suggestKeywords . concat ( keywords ) ;
}
parser . suggestKeywords ( keywords ) ;
parser . suggestTables ( { prependFrom : true } ) ;
parser . suggestDatabases ( { prependFrom : true , appendDot : true } ) ;
break ;
case 1835 :
this . $ = $$ [ $0 - 2 ] . concat ( [ $$ [ $0 ] ] ) ;
break ;
case 1839 :
parser . addCommonTableExpressions ( $$ [ $0 - 4 ] ) ;
break ;
case 1840 :
parser . addCteAliasLocation ( _$ [ $0 - 4 ] , $$ [ $0 - 4 ] ) ;
$$ [ $0 - 1 ] . alias = $$ [ $0 - 4 ] ;
this . $ = $$ [ $0 - 1 ] ;
break ;
case 1847 :
case 1848 :
parser . addClauseLocation ( 'whereClause' , _$ [ $0 - 1 ] , $$ [ $0 ] . whereClauseLocation ) ;
parser . addClauseLocation ( 'limitClause' , $$ [ $0 ] . limitClausePreceding || _$ [ $0 - 1 ] , $$ [ $0 ] . limitClauseLocation ) ;
break ;
case 1849 :
var keywords = [ ] ;
parser . addClauseLocation ( 'whereClause' , _$ [ $0 - 3 ] , $$ [ $0 - 1 ] . whereClauseLocation ) ;
parser . addClauseLocation ( 'limitClause' , $$ [ $0 - 2 ] . limitClausePreceding || _$ [ $0 - 3 ] , $$ [ $0 - 2 ] . limitClauseLocation ) ;
if ( $$ [ $0 - 3 ] ) {
if ( ! $$ [ $0 - 3 ] . hasLateralViews && typeof $$ [ $0 - 3 ] . tableReferenceList . hasJoinCondition !== 'undefined' && ! $$ [ $0 - 3 ] . tableReferenceList . hasJoinCondition ) {
keywords . push ( { value : 'ON' , weight : 3 } ) ;
}
if ( $$ [ $0 - 3 ] . suggestKeywords ) {
keywords = parser . createWeightedKeywords ( $$ [ $0 - 3 ] . suggestKeywords , 3 ) ;
}
if ( $$ [ $0 - 3 ] . tableReferenceList . suggestJoinConditions ) {
parser . suggestJoinConditions ( $$ [ $0 - 3 ] . tableReferenceList . suggestJoinConditions ) ;
}
if ( $$ [ $0 - 3 ] . tableReferenceList . suggestJoins ) {
parser . suggestJoins ( $$ [ $0 - 3 ] . tableReferenceList . suggestJoins ) ;
}
if ( ! $$ [ $0 - 3 ] . hasLateralViews && $$ [ $0 - 3 ] . tableReferenceList . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 3 ] . tableReferenceList . suggestKeywords , 3 ) ) ;
}
// Lower the weights for 'TABLESAMPLE' and 'LATERAL VIEW'
keywords . forEach ( function ( keyword ) {
if ( keyword . value === 'TABLESAMPLE' || keyword . value === 'LATERAL VIEW' ) {
keyword . weight = 1.1 ;
}
} ) ;
if ( ! $$ [ $0 - 3 ] . hasLateralViews && $$ [ $0 - 3 ] . tableReferenceList . types ) {
var veKeywords = parser . getValueExpressionKeywords ( $$ [ $0 - 3 ] . tableReferenceList ) ;
keywords = keywords . concat ( veKeywords . suggestKeywords ) ;
if ( veKeywords . suggestColRefKeywords ) {
parser . suggestColRefKeywords ( veKeywords . suggestColRefKeywords ) ;
parser . addColRefIfExists ( $$ [ $0 - 3 ] . tableReferenceList ) ;
}
}
}
if ( $$ [ $0 - 1 ] . empty && $$ [ $0 ] && $$ [ $0 ] . joinType . toUpperCase ( ) === 'JOIN' ) {
keywords = keywords . concat ( [ 'CROSS' , 'FULL' , 'FULL OUTER' , 'INNER' , 'LEFT' , 'LEFT OUTER' , 'LEFT SEMI' , 'RIGHT' , 'RIGHT OUTER' ] ) ;
parser . suggestKeywords ( keywords ) ;
return ;
}
if ( $$ [ $0 - 1 ] . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 1 ] . suggestKeywords , 2 ) ) ;
}
if ( $$ [ $0 - 1 ] . suggestFilters ) {
parser . suggestFilters ( $$ [ $0 - 1 ] . suggestFilters ) ;
}
if ( $$ [ $0 - 1 ] . suggestGroupBys ) {
parser . suggestGroupBys ( $$ [ $0 - 1 ] . suggestGroupBys ) ;
}
if ( $$ [ $0 - 1 ] . suggestOrderBys ) {
parser . suggestOrderBys ( $$ [ $0 - 1 ] . suggestOrderBys ) ;
}
if ( $$ [ $0 - 1 ] . empty ) {
keywords . push ( { value : 'UNION' , weight : 2.11 } ) ;
}
keywords = keywords . concat ( [
{ value : 'CROSS JOIN' , weight : 1 } ,
{ value : 'FULL JOIN' , weight : 1 } ,
{ value : 'FULL OUTER JOIN' , weight : 1 } ,
{ value : 'INNER JOIN' , weight : 1 } ,
{ value : 'JOIN' , weight : 1 } ,
{ value : 'LEFT JOIN' , weight : 1 } ,
{ value : 'LEFT OUTER JOIN' , weight : 1 } ,
{ value : 'LEFT SEMI JOIN' , weight : 1 } ,
{ value : 'RIGHT JOIN' , weight : 1 } ,
{ value : 'RIGHT OUTER JOIN' , weight : 1 }
] ) ;
parser . suggestKeywords ( keywords ) ;
break ;
case 1850 :
// 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 1854 :
this . $ = { tableReferenceList : $$ [ $0 - 1 ] , suggestKeywords : [ 'LATERAL VIEW' ] } ;
if ( $$ [ $0 ] ) {
parser . yy . lateralViews = $$ [ $0 ] . lateralViews ;
this . $ . hasLateralViews = true ;
if ( $$ [ $0 ] . suggestKeywords ) {
this . $ . suggestKeywords = this . $ . suggestKeywords . concat ( $$ [ $0 ] . suggestKeywords ) ;
}
}
break ;
case 1855 :
case 2179 :
parser . suggestTables ( ) ;
parser . suggestDatabases ( { appendDot : true } ) ;
break ;
case 1856 :
if ( $$ [ $0 ] ) {
parser . yy . lateralViews = $$ [ $0 ] . lateralViews ;
}
break ;
case 1858 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 6 ] , $$ [ $0 - 5 ] , $$ [ $0 - 4 ] , $$ [ $0 - 3 ] , $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'WHERE' , weight : 9 } , { value : 'GROUP BY' , weight : 8 } , { value : 'HAVING' , weight : 7 } , { value : 'WINDOW' , weight : 6 } , { value : 'ORDER BY' , weight : 5 } , [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } ] , { value : 'SORT BY' , weight : 4 } , { value : 'LIMIT' , weight : 3 } ] , [ true , true , true , true , true , true , ! $$ [ $0 - 2 ] , true ] ) ;
if ( keywords . length > 0 ) {
this . $ = { suggestKeywords : keywords , empty : ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] } ;
}
else {
this . $ = { } ;
}
this . $ . whereClauseLocation = $$ [ $0 - 6 ] ? _$ [ $0 - 6 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] , $$ [ $0 - 5 ] , _$ [ $0 - 5 ] , $$ [ $0 - 6 ] , _$ [ $0 - 6 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
if ( ! $$ [ $0 - 6 ] && ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ . suggestFilters = { prefix : 'WHERE' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ;
}
if ( ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ . suggestGroupBys = { prefix : 'GROUP BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ;
}
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ) {
this . $ . suggestOrderBys = { prefix : 'ORDER BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ;
}
break ;
case 1859 :
if ( parser . yy . result . suggestColumns ) {
parser . yy . result . suggestColumns . source = 'where' ;
}
break ;
case 1860 :
if ( parser . yy . result . suggestColumns ) {
parser . yy . result . suggestColumns . source = 'group by' ;
}
break ;
case 1863 :
if ( parser . yy . result . suggestColumns ) {
parser . yy . result . suggestColumns . source = 'order by' ;
}
break ;
case 1866 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 5 ] , $$ [ $0 - 4 ] , $$ [ $0 - 3 ] , $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'GROUP BY' , weight : 8 } , { value : 'HAVING' , weight : 7 } , { value : 'WINDOW' , weight : 6 } , { value : 'ORDER BY' , weight : 5 } , [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } ] , { value : 'SORT BY' , weight : 4 } , { value : 'LIMIT' , weight : 3 } ] , [ true , true , true , true , true , ! $$ [ $0 - 2 ] , true ] ) ;
if ( $$ [ $0 - 7 ] . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 7 ] . suggestKeywords , 1 ) ) ;
}
this . $ = parser . getValueExpressionKeywords ( $$ [ $0 - 7 ] , keywords ) ;
this . $ . cursorAtEnd = ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ;
if ( $$ [ $0 - 7 ] . columnReference ) {
this . $ . columnReference = $$ [ $0 - 7 ] . columnReference ;
}
if ( ! $$ [ $0 - 5 ] ) {
parser . suggestGroupBys ( { prefix : 'GROUP BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
if ( ! $$ [ $0 - 5 ] && ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestOrderBys ( { prefix : 'ORDER BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] , $$ [ $0 - 5 ] , _$ [ $0 - 5 ] , $$ [ $0 - 7 ] , _$ [ $0 - 7 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1867 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 4 ] , $$ [ $0 - 3 ] , $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'HAVING' , weight : 7 } , { value : 'WINDOW' , weight : 6 } , { value : 'ORDER BY' , weight : 5 } , [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } ] , { value : 'SORT BY' , weight : 4 } , { value : 'LIMIT' , weight : 3 } ] , [ true , true , true , true , ! $$ [ $0 - 2 ] , true ] ) ;
if ( $$ [ $0 - 6 ] . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 6 ] . suggestKeywords , 8 ) ) ;
}
if ( $$ [ $0 - 6 ] . valueExpression ) {
this . $ = parser . getValueExpressionKeywords ( $$ [ $0 - 6 ] . valueExpression , keywords ) ;
if ( $$ [ $0 - 6 ] . valueExpression . columnReference ) {
this . $ . columnReference = $$ [ $0 - 6 ] . valueExpression . columnReference ;
}
}
else {
this . $ = { suggestKeywords : keywords } ;
}
this . $ . cursorAtEnd = ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] ;
if ( ! $$ [ $0 - 4 ] && ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestOrderBys ( { prefix : 'ORDER BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] , $$ [ $0 - 6 ] , _$ [ $0 - 6 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1868 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 3 ] , $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'WINDOW' , weight : 6 } , { value : 'ORDER BY' , weight : 5 } , [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } ] , { value : 'SORT BY' , weight : 4 } , { value : 'LIMIT' , weight : 3 } ] , [ true , true , true , ! $$ [ $0 - 2 ] , true ] ) ;
this . $ = { suggestKeywords : keywords , cursorAtEnd : ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] } ;
if ( ! $$ [ $0 - 3 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestOrderBys ( { prefix : 'ORDER BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 5 ] , _$ [ $0 - 5 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1869 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 2 ] , $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ { value : 'ORDER BY' , weight : 5 } , [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } , { value : 'SORT BY' , weight : 4 } ] , { value : 'LIMIT' , weight : 3 } ] , [ true , true , true ] ) ;
this . $ = { suggestKeywords : keywords , cursorAtEnd : ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] && ! $$ [ $0 ] } ;
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestOrderBys ( { prefix : 'ORDER BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1870 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 - 1 ] , $$ [ $0 ] ] , [ [ { value : 'CLUSTER BY' , weight : 4 } , { value : 'DISTRIBUTE BY' , weight : 4 } ] , { value : 'LIMIT' , weight : 3 } ] , [ true , true ] ) ;
if ( $$ [ $0 - 3 ] . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 3 ] . suggestKeywords , 5 ) ) ;
}
this . $ = { suggestKeywords : keywords , cursorAtEnd : ! $$ [ $0 - 1 ] && ! $$ [ $0 ] } ;
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 1 ] , _$ [ $0 - 1 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1871 :
var keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 ] ] , [ { value : 'LIMIT' , weight : 3 } ] , [ true ] ) ;
if ( $$ [ $0 - 2 ] . suggestKeywords ) {
keywords = keywords . concat ( parser . createWeightedKeywords ( $$ [ $0 - 2 ] . suggestKeywords , 4 ) ) ;
}
this . $ = { suggestKeywords : keywords , cursorAtEnd : ! $$ [ $0 ] } ;
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = _$ [ $0 - 2 ] ;
this . $ . limitClauseLocation = $$ [ $0 ] ? _$ [ $0 ] : undefined ;
break ;
case 1872 :
this . $ = { suggestKeywords : [ ] , cursorAtEnd : true } ;
this . $ . whereClauseLocation = $$ [ $0 - 7 ] ? _$ [ $0 - 7 ] : undefined ;
this . $ . limitClausePreceding = parser . firstDefined ( $$ [ $0 - 2 ] , _$ [ $0 - 2 ] , $$ [ $0 - 3 ] , _$ [ $0 - 3 ] , $$ [ $0 - 4 ] , _$ [ $0 - 4 ] , $$ [ $0 - 5 ] , _$ [ $0 - 5 ] , $$ [ $0 - 6 ] , _$ [ $0 - 6 ] , $$ [ $0 - 7 ] , _$ [ $0 - 7 ] ) ;
this . $ . limitClauseLocation = $$ [ $0 - 1 ] ? _$ [ $0 - 1 ] : undefined ;
break ;
case 1876 :
if ( $$ [ $0 ] . suggestFilters ) {
parser . suggestFilters ( { tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
break ;
case 1877 :
parser . suggestFunctions ( ) ;
parser . suggestColumns ( ) ;
parser . suggestKeywords ( [ 'EXISTS' , 'NOT EXISTS' ] ) ;
parser . suggestFilters ( { tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
break ;
case 1880 :
this . $ = { valueExpression : $$ [ $0 ] ? false : $$ [ $0 - 1 ] } ;
if ( ! $$ [ $0 ] ) {
this . $ . suggestKeywords = [ 'GROUPING SETS' , 'WITH CUBE' , 'WITH ROLLUP' ] ;
}
break ;
case 1881 :
case 1930 :
case 1955 :
case 1959 :
case 1962 :
parser . suggestSelectListAliases ( ) ;
break ;
case 1882 :
parser . valueExpressionSuggest ( ) ;
parser . suggestSelectListAliases ( ) ;
parser . suggestGroupBys ( { tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
break ;
case 1883 :
parser . suggestKeywords ( [ 'BY' ] ) ;
parser . suggestGroupBys ( { prefix : 'BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
break ;
case 1890 :
parser . suggestKeywords ( [ 'CUBE' , 'ROLLUP' ] ) ;
break ;
case 1892 :
parser . suggestKeywords ( [ 'SETS' ] ) ;
break ;
case 1920 :
if ( $$ [ $0 ] . emptyOrderBy ) {
parser . suggestOrderBys ( { tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
}
break ;
case 1921 :
parser . suggestKeywords ( [ 'BY' ] ) ;
parser . suggestOrderBys ( { prefix : 'BY' , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ) ;
break ;
case 1925 :
this . $ = { emptyOrderBy : false } ;
parser . valueExpressionSuggest ( ) ;
parser . suggestAnalyticFunctions ( ) ;
parser . suggestSelectListAliases ( ) ;
break ;
case 1926 :
case 1927 :
case 1928 :
this . $ = { emptyOrderBy : false } ;
break ;
case 1929 :
if ( $$ [ $0 - 1 ] . suggestKeywords && $$ [ $0 ] . suggestKeywords ) {
this . $ = parser . mergeSuggestKeywords ( $$ [ $0 - 1 ] , $$ [ $0 ] ) ;
}
else {
this . $ = parser . mergeSuggestKeywords ( $$ [ $0 ] ) ;
}
break ;
case 1931 :
this . $ = { emptyOrderBy : true } ;
parser . valueExpressionSuggest ( ) ;
parser . suggestAnalyticFunctions ( ) ;
parser . suggestSelectListAliases ( ) ;
break ;
case 1933 :
this . $ = { suggestKeywords : [ 'ASC' , 'DESC' ] } ;
;
break ;
case 1936 :
this . $ = { suggestKeywords : [ 'NULLS FIRST' , 'NULLS LAST' ] } ;
break ;
case 1940 :
parser . suggestKeywords ( [ 'FIRST' , 'LAST' ] ) ;
break ;
case 1944 :
this . $ = { suggestKeywords : [ 'SORT BY' ] } ;
break ;
case 1953 :
case 1957 :
case 1961 :
suggestKeywords : [ 'BY' ] ;
break ;
case 1954 :
case 1958 :
parser . suggestColumns ( ) ;
parser . suggestSelectListAliases ( ) ;
break ;
case 1969 :
parser . addColumnLocation ( $$ [ $0 - 1 ] . location , [ $$ [ $0 - 1 ] . identifier ] ) ;
this . $ = $$ [ $0 ] ;
break ;
case 1982 :
case 1983 :
// verifyType($$[$0], 'BOOLEAN');
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 1985 :
// verifyType($$[$0], 'NUMBER');
this . $ = $$ [ $0 ] ;
$$ [ $0 ] . types = [ 'NUMBER' ] ;
break ;
case 1986 :
case 1987 :
case 1988 :
case 1989 :
case 1996 :
case 1997 :
case 1998 :
case 1999 :
case 2000 :
case 2001 :
case 2007 :
case 2008 :
case 2029 :
case 2087 :
case 2088 :
case 2146 :
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 1990 :
this . $ = { types : [ 'BOOLEAN' ] } ;
// clear correlated flag after completed sub-query (set by lexer)
parser . yy . correlatedSubQuery = false ;
break ;
case 1992 :
case 1993 :
case 1994 :
case 1995 :
parser . addColRefToVariableIfExists ( $$ [ $0 - 2 ] , $$ [ $0 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2002 :
case 2003 :
// verifyType($$[$0-2], 'BOOLEAN');
// verifyType($$[$0], 'BOOLEAN');
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2004 :
case 2005 :
case 2006 :
// verifyType($$[$0-2], 'NUMBER');
// verifyType($$[$0], 'NUMBER');
this . $ = { types : [ 'NUMBER' ] } ;
break ;
case 2012 :
parser . suggestKeywords ( [ 'BETWEEN' , 'EXISTS' , 'IN' , 'LIKE' , 'REGEXP' , 'RLIKE' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2013 :
case 2015 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2014 :
parser . suggestFunctions ( ) ;
parser . suggestColumns ( ) ;
parser . suggestKeywords ( [ 'EXISTS' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2016 :
parser . suggestFunctions ( { types : [ 'BOOLEAN' ] } ) ;
parser . suggestColumns ( { types : [ 'BOOLEAN' ] } ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2017 :
this . $ = { types : [ 'T' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2018 :
parser . suggestFunctions ( ) ;
parser . suggestColumns ( ) ;
this . $ = { types : [ 'T' ] } ;
break ;
case 2019 :
if ( ! $$ [ $0 ] . typeSet ) {
parser . applyTypeToSuggestions ( 'NUMBER' ) ;
}
this . $ = { types : [ 'NUMBER' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2020 :
parser . suggestFunctions ( { types : [ 'NUMBER' ] } ) ;
parser . suggestColumns ( { types : [ 'NUMBER' ] } ) ;
this . $ = { types : [ 'NUMBER' ] } ;
break ;
case 2021 :
parser . suggestKeywords ( [ 'FALSE' , 'NOT NULL' , 'NOT TRUE' , 'NOT FALSE' , 'NULL' , 'TRUE' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2022 :
parser . suggestKeywords ( [ 'FALSE' , 'NULL' , 'TRUE' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2023 :
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2024 :
case 2025 :
case 2026 :
parser . suggestKeywords ( [ 'NOT' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2027 :
parser . valueExpressionSuggest ( $$ [ $0 - 5 ] , $$ [ $0 - 3 ] ? 'IS NOT DISTINCT FROM' : 'IS DISTINCT FROM' ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2028 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2030 :
this . $ = $$ [ $0 - 1 ] ;
break ;
case 2031 :
parser . valueExpressionSuggest ( ) ;
this . $ = { types : [ 'T' ] , typeSet : true } ;
break ;
case 2032 :
parser . valueExpressionSuggest ( $$ [ $0 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2033 :
case 2034 :
case 2035 :
parser . valueExpressionSuggest ( $$ [ $0 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2036 :
case 2037 :
case 2038 :
case 2039 :
if ( ! $$ [ $0 - 2 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 ] . types ) ;
parser . addColRefIfExists ( $$ [ $0 ] ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2040 :
case 2042 :
parser . valueExpressionSuggest ( $$ [ $0 - 2 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2041 :
parser . valueExpressionSuggest ( $$ [ $0 - 2 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true , endsWithLessThanOrEqual : true } ;
break ;
case 2043 :
parser . valueExpressionSuggest ( $$ [ $0 - 2 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true , endsWithLessThanOrEqual : $$ [ $0 - 1 ] === '<=' } ;
break ;
case 2044 :
case 2045 :
case 2046 :
case 2047 :
if ( ! $$ [ $0 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
parser . addColRefIfExists ( $$ [ $0 - 2 ] ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2048 :
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 2049 :
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 2050 :
case 2051 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 5 ] . suggestFilters } ;
break ;
case 2052 :
case 2053 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 4 ] . suggestFilters } ;
break ;
case 2054 :
if ( $$ [ $0 - 2 ] . types [ 0 ] === $$ [ $0 ] . types [ 0 ] && ! $$ [ $0 - 5 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 5 ] . suggestFilters } ;
break ;
case 2055 :
if ( $$ [ $0 - 5 ] . types [ 0 ] === $$ [ $0 ] . types [ 0 ] && ! $$ [ $0 - 2 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 5 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2056 :
if ( $$ [ $0 - 5 ] . types [ 0 ] === $$ [ $0 - 2 ] . types [ 0 ] && ! $$ [ $0 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 5 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2057 :
parser . valueExpressionSuggest ( $$ [ $0 - 5 ] , $$ [ $0 - 1 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2058 :
case 2064 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] , [ 'AND' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2059 :
parser . valueExpressionSuggest ( $$ [ $0 - 3 ] , $$ [ $0 - 2 ] + ' ' + $$ [ $0 - 1 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2060 :
if ( $$ [ $0 - 4 ] . types [ 0 ] === $$ [ $0 - 2 ] . types [ 0 ] && ! $$ [ $0 - 4 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 4 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 4 ] . suggestFilters } ;
break ;
case 2061 :
if ( $$ [ $0 - 4 ] . types [ 0 ] === $$ [ $0 - 2 ] . types [ 0 ] && ! $$ [ $0 - 2 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 4 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2062 :
if ( $$ [ $0 - 4 ] . types [ 0 ] === $$ [ $0 - 2 ] . types [ 0 ] && ! $$ [ $0 ] . typeSet ) {
parser . applyTypeToSuggestions ( $$ [ $0 - 4 ] . types ) ;
}
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2063 :
parser . valueExpressionSuggest ( $$ [ $0 - 4 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 - 4 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2065 :
parser . valueExpressionSuggest ( $$ [ $0 - 2 ] , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( $$ [ $0 - 2 ] . types ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2066 :
case 2068 :
case 2070 :
case 2072 :
parser . valueExpressionSuggest ( undefined , $$ [ $0 - 1 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true , suggestFilters : true } ;
break ;
case 2067 :
case 2071 :
parser . addColRefIfExists ( $$ [ $0 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2069 :
case 2073 :
parser . addColRefIfExists ( $$ [ $0 - 2 ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2074 :
case 2075 :
parser . valueExpressionSuggest ( undefined , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( [ 'NUMBER' ] ) ;
this . $ = { types : [ 'NUMBER' ] , typeSet : true } ;
break ;
case 2076 :
case 2077 :
case 2078 :
if ( ! $$ [ $0 - 2 ] . typeSet ) {
parser . applyTypeToSuggestions ( [ 'NUMBER' ] ) ;
parser . addColRefIfExists ( $$ [ $0 ] ) ;
}
this . $ = { types : [ 'NUMBER' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2079 :
case 2080 :
case 2081 :
parser . valueExpressionSuggest ( undefined , $$ [ $0 - 1 ] ) ;
parser . applyTypeToSuggestions ( [ 'NUMBER' ] ) ;
this . $ = { types : [ 'NUMBER' ] , typeSet : true } ;
break ;
case 2082 :
case 2083 :
case 2084 :
if ( ! $$ [ $0 ] . typeSet ) {
parser . applyTypeToSuggestions ( [ 'NUMBER' ] ) ;
parser . addColRefIfExists ( $$ [ $0 - 2 ] ) ;
}
this . $ = { types : [ 'NUMBER' ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2085 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 1 ] . suggestFilters } ;
break ;
case 2086 :
this . $ = { types : [ 'BOOLEAN' ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2089 :
parser . valueExpressionSuggest ( undefined , $$ [ $0 ] ) ;
parser . applyTypeToSuggestions ( [ 'STRING' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2090 :
parser . valueExpressionSuggest ( undefined , $$ [ $0 - 1 ] + ' ' + $$ [ $0 ] ) ;
parser . applyTypeToSuggestions ( [ 'STRING' ] ) ;
this . $ = { types : [ 'BOOLEAN' ] , typeSet : true } ;
break ;
case 2092 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { types : [ 'T' ] , typeSet : true } ;
break ;
case 2094 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] , [ 'WHEN' ] ) ;
this . $ = { types : [ 'T' ] , typeSet : true } ;
break ;
case 2095 :
this . $ = $$ [ $0 ] ;
this . $ . suggestFilters = $$ [ $0 - 1 ] . suggestFilters ;
break ;
case 2096 :
this . $ = { types : [ 'T' ] , suggestFilters : $$ [ $0 - 1 ] . suggestFilters } ;
break ;
case 2097 :
case 2400 :
case 2405 :
case 2406 :
this . $ = { types : [ 'T' ] } ;
break ;
case 2098 :
case 2100 :
$$ [ $0 ] . position = 1 ;
break ;
case 2099 :
$$ [ $0 ] . position = $$ [ $0 - 2 ] . position + 1 ;
this . $ = $$ [ $0 ] ;
break ;
case 2101 :
$$ [ $0 - 2 ] . position += 1 ;
break ;
case 2102 :
$$ [ $0 - 2 ] . position = 1 ;
break ;
case 2103 :
$$ [ $0 - 4 ] . position += 1 ;
break ;
case 2104 :
parser . valueExpressionSuggest ( ) ;
$$ [ $0 - 2 ] . position += 1 ;
break ;
case 2105 :
parser . valueExpressionSuggest ( ) ;
$$ [ $0 - 4 ] . position += 1 ;
break ;
case 2106 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 3 ] ) ;
break ;
case 2107 :
case 2108 :
parser . valueExpressionSuggest ( ) ;
this . $ = { cursorAtStart : true , position : 1 } ;
break ;
case 2109 :
case 2110 :
parser . valueExpressionSuggest ( ) ;
this . $ = { position : 2 } ;
break ;
case 2114 :
this . $ = { types : [ 'COLREF' ] , columnReference : $$ [ $0 ] . chain } ;
break ;
case 2115 :
// 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 2116 :
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 2118 :
this . $ = { types : [ 'NULL' ] } ;
break ;
case 2120 :
if ( $$ [ $0 ] . suggestKeywords ) {
this . $ = { types : [ 'COLREF' ] , columnReference : $$ [ $0 ] , suggestKeywords : $$ [ $0 ] . suggestKeywords } ;
}
else {
this . $ = { types : [ 'COLREF' ] , columnReference : $$ [ $0 ] } ;
}
break ;
case 2121 :
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 2122 :
case 2311 :
case 2312 :
parser . addFunctionLocation ( _$ [ $0 - 1 ] , $$ [ $0 - 1 ] ) ;
if ( $$ [ $0 ] . position ) {
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 1 ] , $$ [ $0 ] . position ) ;
}
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 1 ] ) } ;
break ;
case 2124 :
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 2131 :
parser . suggestValues ( $$ [ $0 ] ) ;
break ;
case 2132 :
this . $ = { types : [ 'NUMBER' ] } ;
break ;
case 2138 :
case 2140 :
this . $ = $$ [ $0 - 1 ] + $$ [ $0 ] ;
break ;
case 2139 :
this . $ = $$ [ $0 - 2 ] + $$ [ $0 - 1 ] + $$ [ $0 ] ;
break ;
case 2144 :
case 2145 :
if ( /\$\{[^}]*\}/ . test ( $$ [ $0 ] ) ) {
parser . addVariableLocation ( _$ [ $0 ] , $$ [ $0 ] ) ;
this . $ = { types : [ 'STRING' ] , columnReference : [ { name : $$ [ $0 ] } ] } ;
}
else {
this . $ = { types : [ 'STRING' ] } ;
}
break ;
case 2147 :
this . $ = { partialQuote : '\'' , missingEndQuote : parser . yy . missingEndQuote } ;
break ;
case 2148 :
this . $ = { partialQuote : '"' , missingEndQuote : parser . yy . missingEndQuote } ;
break ;
case 2153 :
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 2154 :
parser . addAsteriskLocation ( _$ [ $0 ] , [ { asterisk : true } ] ) ;
this . $ = { asterisk : true } ;
break ;
case 2155 :
if ( $$ [ $0 ] ) {
parser . addColumnAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias , _$ [ $0 - 1 ] ) ;
}
break ;
case 2156 :
parser . suggestFunctions ( ) ;
parser . suggestColumns ( ) ;
parser . addColumnAliasLocation ( _$ [ $0 ] , $$ [ $0 ] , _$ [ $0 - 2 ] ) ;
this . $ = { suggestAggregateFunctions : true } ;
break ;
case 2158 :
case 2475 :
this . $ = [ $$ [ $0 ] ] ;
break ;
case 2159 :
$$ [ $0 - 2 ] . push ( $$ [ $0 ] ) ;
break ;
case 2161 :
case 2162 :
this . $ = { cursorAtStart : true , suggestFunctions : true , suggestColumns : true , suggestAggregateFunctions : true } ;
break ;
case 2164 :
parser . checkForSelectListKeywords ( $$ [ $0 - 2 ] ) ;
break ;
case 2165 :
parser . checkForSelectListKeywords ( $$ [ $0 - 3 ] ) ;
break ;
case 2166 :
this . $ = { suggestKeywords : parser . getSelectListKeywords ( ) , suggestTables : true , suggestDatabases : true , suggestFunctions : true , suggestColumns : true , suggestAggregateFunctions : true } ;
break ;
case 2168 :
case 2169 :
case 2171 :
this . $ = { suggestKeywords : parser . getSelectListKeywords ( ) , suggestFunctions : true , suggestColumns : true , suggestAggregateFunctions : true , } ;
break ;
case 2182 :
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 2189 :
if ( $$ [ $0 ] && $$ [ $0 ] . valueExpression ) {
this . $ = $$ [ $0 ] . valueExpression ;
}
else {
this . $ = { } ;
}
this . $ . joinType = $$ [ $0 - 2 ] ;
if ( $$ [ $0 ] . noJoinCondition ) {
this . $ . suggestJoinConditions = { prependOn : true , tablePrimaries : parser . yy . latestTablePrimaries . concat ( ) } ;
}
if ( $$ [ $0 ] . suggestKeywords ) {
this . $ . suggestKeywords = $$ [ $0 ] . suggestKeywords ;
}
if ( parser . yy . latestTablePrimaries . length > 0 ) {
parser . yy . latestTablePrimaries [ parser . yy . latestTablePrimaries . length - 1 ] . join = true ;
}
break ;
case 2190 :
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 2191 :
this . $ = { joinType : $$ [ $0 ] } ;
break ;
case 2192 :
this . $ = { joinType : $$ [ $0 - 1 ] } ;
break ;
case 2193 :
if ( $$ [ $0 - 2 ] . suggestKeywords ) {
parser . suggestKeywords ( $$ [ $0 - 2 ] . suggestKeywords ) ;
}
break ;
case 2194 :
if ( $$ [ $0 ] . suggestKeywords ) {
parser . suggestKeywords ( $$ [ $0 ] . suggestKeywords ) ;
}
break ;
case 2197 :
if ( parser . yy . latestTablePrimaries . length > 0 ) {
var idx = parser . yy . latestTablePrimaries . length - 1 ;
var tables = [ ] ;
do {
var tablePrimary = parser . yy . latestTablePrimaries [ idx ] ;
if ( ! tablePrimary . subQueryAlias ) {
tables . unshift ( tablePrimary . alias ? { identifierChain : tablePrimary . identifierChain , alias : tablePrimary . alias } : { identifierChain : tablePrimary . identifierChain } ) ;
}
idx -- ;
} while ( idx >= 0 && tablePrimary . join && ! tablePrimary . subQueryAlias ) ;
if ( tables . length > 0 ) {
parser . suggestJoins ( {
prependJoin : false ,
joinType : $$ [ $0 - 2 ] ,
tables : tables
} ) ;
}
}
parser . suggestTables ( ) ;
parser . suggestDatabases ( {
appendDot : true
} ) ;
break ;
case 2202 :
this . $ = 'CROSS JOIN' ;
break ;
case 2203 :
this . $ = 'FULL JOIN' ;
break ;
case 2204 :
this . $ = 'FULL OUTER JOIN' ;
break ;
case 2205 :
this . $ = 'INNER JOIN' ;
break ;
case 2206 :
this . $ = 'JOIN' ;
break ;
case 2207 :
this . $ = 'LEFT INNER JOIN' ;
break ;
case 2208 :
this . $ = 'LEFT JOIN' ;
break ;
case 2209 :
this . $ = 'LEFT OUTER JOIN' ;
break ;
case 2210 :
this . $ = 'LEFT SEMI JOIN' ;
break ;
case 2211 :
this . $ = 'OUTER JOIN' ;
break ;
case 2212 :
case 2214 :
this . $ = 'RIGHT OUTER JOIN' ;
break ;
case 2213 :
this . $ = 'RIGHT JOIN' ;
break ;
case 2215 :
this . $ = 'RIGHT SEMI JOIN' ;
break ;
case 2216 :
this . $ = 'SEMI JOIN' ;
break ;
case 2217 :
case 2219 :
case 2220 :
case 2222 :
case 2223 :
case 2224 :
case 2225 :
case 2227 :
case 2228 :
case 2229 :
case 2230 :
this . $ = { suggestKeywords : [ 'JOIN' ] } ;
break ;
case 2218 :
case 2226 :
this . $ = { suggestKeywords : [ 'OUTER' ] } ;
break ;
case 2221 :
this . $ = { suggestKeywords : [ 'OUTER' , 'SEMI' ] } ;
break ;
case 2231 :
this . $ = { noJoinCondition : true , suggestKeywords : [ 'ON' ] } ;
break ;
case 2232 :
this . $ = { valueExpression : $$ [ $0 ] } ;
break ;
case 2236 :
parser . valueExpressionSuggest ( ) ;
parser . suggestJoinConditions ( { prependOn : false } ) ;
break ;
case 2237 :
this . $ = {
primary : $$ [ $0 - 2 ]
} ;
if ( $$ [ $0 - 2 ] . identifierChain ) {
if ( $$ [ $0 ] ) {
$$ [ $0 - 2 ] . alias = $$ [ $0 ] . alias ;
parser . addTableAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias , $$ [ $0 - 2 ] . identifierChain ) ;
}
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
}
var keywords = [ ] ;
// Right-to-left for cursor after TablePrimary
keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 ] , $$ [ $0 - 1 ] ] , [ { value : 'AS' , weight : 2 } , { value : 'TABLESAMPLE' , weight : 3 } ] , [ true , true ] ) ;
if ( keywords . length > 0 ) {
this . $ . suggestKeywords = keywords ;
}
break ;
case 2238 :
this . $ = {
primary : $$ [ $0 - 1 ]
} ;
if ( $$ [ $0 ] ) {
this . $ . primary . alias = $$ [ $0 ] . alias ;
parser . addTablePrimary ( { subQueryAlias : $$ [ $0 ] . alias } ) ;
parser . addSubqueryAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias , $$ [ $0 - 1 ] . identifierChain ) ;
}
var keywords = [ ] ;
keywords = parser . getKeywordsForOptionalsLR ( [ $$ [ $0 ] ] , [ { value : 'AS' , weight : 2 } ] , [ true ] ) ;
if ( keywords . length > 0 ) {
this . $ . suggestKeywords = keywords ;
}
break ;
case 2239 :
if ( $$ [ $0 ] ) {
parser . addTableAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias , $$ [ $0 - 2 ] . identifierChain ) ;
}
break ;
case 2240 :
if ( $$ [ $0 ] ) {
$$ [ $0 - 2 ] . alias = $$ [ $0 ] . alias ;
parser . addTableAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias , $$ [ $0 - 2 ] . identifierChain ) ;
}
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
break ;
case 2241 :
if ( $$ [ $0 ] ) {
parser . addTablePrimary ( { subQueryAlias : $$ [ $0 ] . alias } ) ;
parser . addSubqueryAliasLocation ( $$ [ $0 ] . location , $$ [ $0 ] . alias ) ;
}
break ;
case 2252 :
parser . suggestKeywords ( [ 'BUCKET' ] ) ;
break ;
case 2253 :
parser . suggestKeywords ( [ 'OUT OF' ] ) ;
break ;
case 2254 :
parser . suggestKeywords ( [ 'OF' ] ) ;
break ;
case 2255 :
if ( ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ 'ON' ] ) ;
}
break ;
case 2257 :
if ( $$ [ $0 - 2 ] . indexOf ( '.' ) === - 1 ) {
parser . suggestKeywords ( [ 'PERCENT' , 'ROWS' ] ) ;
}
else {
parser . suggestKeywords ( [ 'PERCENT' ] ) ;
}
break ;
case 2262 :
parser . pushQueryState ( ) ;
break ;
case 2263 :
parser . popQueryState ( ) ;
break ;
case 2265 :
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 2268 :
var subQuery = parser . getSubQuery ( $$ [ $0 ] ) ;
subQuery . columns . forEach ( function ( column ) {
parser . expandIdentifierChain ( { wrapper : column } ) ;
delete column . linked ;
} ) ;
parser . popQueryState ( subQuery ) ;
this . $ = subQuery ;
break ;
case 2285 :
case 2286 :
case 2287 :
case 2288 :
this . $ = { alias : $$ [ $0 ] , location : _$ [ $0 ] } ;
break ;
case 2295 :
if ( $$ [ $0 - 1 ] && $$ [ $0 ] . lateralView ) {
$$ [ $0 - 1 ] . lateralViews . push ( $$ [ $0 ] . lateralView ) ;
this . $ = $$ [ $0 - 1 ] ;
}
else if ( $$ [ $0 ] . lateralView ) {
this . $ = { lateralViews : [ $$ [ $0 ] . lateralView ] } ;
}
if ( $$ [ $0 ] . suggestKeywords ) {
this . $ . suggestKeywords = $$ [ $0 ] . suggestKeywords ;
}
break ;
case 2297 :
if ( ! $$ [ $0 ] ) {
$$ [ $0 - 1 ] . suggestKeywords = [ 'OVER' ] ;
}
break ;
case 2305 :
parser . suggestKeywords ( [ 'OVER' ] ) ;
break ;
case 2309 :
case 2310 :
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 2319 :
this . $ = { expression : $$ [ $0 - 1 ] } ;
break ;
case 2320 :
parser . valueExpressionSuggest ( ) ;
this . $ = { position : 1 } ;
break ;
case 2321 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] ) ;
break ;
case 2329 :
case 2412 :
case 2458 :
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 2 ] ) } ;
break ;
case 2330 :
this . $ = { function : $$ [ $0 - 3 ] , expression : $$ [ $0 - 2 ] , types : parser . findReturnTypes ( $$ [ $0 - 3 ] ) } ;
break ;
case 2331 :
parser . valueExpressionSuggest ( ) ;
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 3 ] , 1 ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 3 ] ) } ;
break ;
case 2332 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2333 :
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 3 ] , $$ [ $0 - 1 ] . position ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 3 ] ) } ;
break ;
case 2341 :
case 2342 :
if ( parser . yy . result . suggestFunctions ) {
parser . suggestAggregateFunctions ( ) ;
}
break ;
case 2343 :
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 2344 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestValueExpressionKeywords ( $$ [ $0 - 3 ] , [ { value : 'ORDER BY' , weight : 2 } ] ) ;
}
else {
parser . suggestValueExpressionKeywords ( $$ [ $0 - 3 ] ) ;
}
break ;
case 2353 :
// Only allowed in last order by
delete parser . yy . result . suggestAnalyticFunctions ;
break ;
case 2354 :
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 2360 :
parser . suggestKeywords ( [ 'BETWEEN' , 'UNBOUNDED' ] ) ;
break ;
case 2361 :
if ( ! $$ [ $0 - 2 ] && ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'CURRENT ROW' , 'UNBOUNDED PRECEDING' ] ) ;
}
else if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'AND' ] ) ;
}
break ;
case 2364 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'PRECEDING' ] ) ;
}
break ;
case 2366 :
lexer . popState ( ) ;
break ;
case 2367 :
lexer . begin ( 'hdfs' ) ;
break ;
case 2369 :
parser . suggestHdfs ( { path : $$ [ $0 - 3 ] } ) ;
break ;
case 2370 :
parser . suggestHdfs ( { path : $$ [ $0 - 2 ] } ) ;
break ;
case 2371 :
parser . suggestHdfs ( { path : $$ [ $0 - 1 ] } ) ;
break ;
case 2372 :
parser . suggestHdfs ( { path : '' } ) ;
break ;
case 2373 :
parser . suggestHdfs ( { path : '' } ) ;
break ;
case 2379 :
parser . suggestKeywords ( [ 'PRECEDING' ] ) ;
break ;
case 2380 :
case 2385 :
parser . suggestKeywords ( [ 'ROW' ] ) ;
break ;
case 2384 :
parser . suggestKeywords ( [ 'CURRENT ROW' , 'UNBOUNDED FOLLOWING' ] ) ;
break ;
case 2386 :
parser . suggestKeywords ( [ 'FOLLOWING' ] ) ;
break ;
case 2392 :
parser . valueExpressionSuggest ( ) ;
parser . suggestAggregateFunctions ( ) ;
parser . suggestSelectListAliases ( true ) ;
break ;
case 2393 :
parser . suggestAggregateFunctions ( ) ;
parser . suggestSelectListAliases ( true ) ;
break ;
case 2399 :
case 2404 :
this . $ = { types : [ $$ [ $0 - 1 ] . toUpperCase ( ) ] } ;
break ;
case 2401 :
parser . valueExpressionSuggest ( ) ;
this . $ = { types : [ $$ [ $0 - 1 ] . toUpperCase ( ) ] } ;
break ;
case 2402 :
case 2403 :
parser . valueExpressionSuggest ( ) ;
this . $ = { types : [ 'T' ] } ;
break ;
case 2407 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 3 ] , [ { value : 'AS' , weight : 2 } ] ) ;
this . $ = { types : [ $$ [ $0 - 1 ] . toUpperCase ( ) ] } ;
break ;
case 2408 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] , [ { value : 'AS' , weight : 2 } ] ) ;
this . $ = { types : [ 'T' ] } ;
break ;
case 2409 :
case 2410 :
parser . suggestKeywords ( parser . getTypeKeywords ( ) ) ;
this . $ = { types : [ 'T' ] } ;
break ;
case 2411 :
case 2433 :
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 3 ] ) } ;
break ;
case 2413 :
case 2434 :
case 2457 :
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2414 :
parser . valueExpressionSuggest ( ) ;
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( 'DISTINCT' ) ;
if ( parser . yy . result . suggestKeywords ) {
keywords = parser . yy . result . suggestKeywords . concat ( keywords ) ;
}
}
parser . suggestKeywords ( keywords ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2415 :
case 2436 :
case 2460 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 5 ] ) } ;
break ;
case 2416 :
if ( $$ [ $0 - 1 ] . cursorAtStart ) {
var keywords = parser . getSelectListKeywords ( ) ;
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( 'DISTINCT' ) ;
}
parser . suggestKeywords ( keywords ) ;
}
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2417 :
case 2421 :
this . $ = { types : [ 'INT' , 'INTEGER' ] } ;
break ;
case 2418 :
parser . suggestKeywords ( [ 'DAY' , 'DAYOFWEEK' , 'HOUR' , 'MINUTE' , 'MONTH' , 'QUARTER' , 'SECOND' , 'WEEK' , 'YEAR' ] ) ;
this . $ = { types : [ 'INT' , 'INTEGER' ] } ;
break ;
case 2419 :
case 2423 :
parser . suggestKeywords ( [ 'FROM' ] ) ;
this . $ = { types : [ 'INT' , 'INTEGER' ] } ;
break ;
case 2420 :
parser . valueExpressionSuggest ( ) ;
this . $ = { types : [ 'INT' , 'INTEGER' ] } ;
break ;
case 2422 :
parser . suggestKeywords ( [ 'DAY' , 'DAYOFWEEK' , 'HOUR' , 'MINUTE' , 'MONTH' , 'QUARTER' , 'SECOND' , 'WEEK' , 'YEAR' ] ) ;
this . $ = { types : [ 'INT' , 'INTEGER' ] } ;
break ;
case 2435 :
parser . valueExpressionSuggest ( ) ;
var keywords = parser . getSelectListKeywords ( true ) ;
if ( ! $$ [ $0 - 2 ] ) {
if ( $$ [ $0 - 4 ] . toLowerCase ( ) === 'group_concat' ) {
keywords . push ( 'ALL' ) ;
}
else {
keywords . push ( 'DISTINCT' ) ;
}
}
if ( parser . yy . result . suggestKeywords ) {
keywords = parser . yy . result . suggestKeywords . concat ( keywords ) ;
}
parser . suggestKeywords ( keywords ) ;
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 4 ] , 1 ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2437 :
if ( $$ [ $0 - 1 ] . cursorAtStart ) {
var keywords = parser . getSelectListKeywords ( true ) ;
if ( ! $$ [ $0 - 2 ] ) {
if ( $$ [ $0 - 4 ] . toLowerCase ( ) === 'group_concat' ) {
keywords . push ( 'ALL' ) ;
}
else {
keywords . push ( 'DISTINCT' ) ;
}
}
if ( parser . yy . result . suggestKeywords ) {
keywords = parser . yy . result . suggestKeywords . concat ( keywords ) ;
}
parser . suggestKeywords ( keywords ) ;
}
if ( parser . yy . result . suggestFunctions && ! parser . yy . result . suggestFunctions . types ) {
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 4 ] , $$ [ $0 - 1 ] . position ) ;
}
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2459 :
parser . valueExpressionSuggest ( ) ;
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 4 ] , 1 ) ;
var keywords = parser . getSelectListKeywords ( true ) ;
if ( ! $$ [ $0 - 2 ] ) {
keywords . push ( 'DISTINCT' ) ;
}
if ( parser . yy . result . suggestKeywords ) {
keywords = parser . yy . result . suggestKeywords . concat ( keywords ) ;
}
parser . suggestKeywords ( keywords ) ;
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2461 :
if ( parser . yy . result . suggestFunctions && ! parser . yy . result . suggestFunctions . types ) {
parser . applyArgumentTypesToSuggestions ( $$ [ $0 - 4 ] , 1 ) ;
}
this . $ = { types : parser . findReturnTypes ( $$ [ $0 - 4 ] ) } ;
break ;
case 2462 :
this . $ = { lateralView : { udtf : $$ [ $0 - 2 ] , tableAlias : $$ [ $0 - 1 ] , columnAliases : $$ [ $0 ] } } ;
break ;
case 2463 :
if ( $$ [ $0 - 1 ] . function . toLowerCase ( ) === 'explode' ) {
this . $ = { lateralView : { udtf : $$ [ $0 - 1 ] , tableAlias : $$ [ $0 ] , columnAliases : [ 'key' , 'value' ] } , suggestKeywords : [ 'AS' ] } ;
}
else if ( $$ [ $0 - 1 ] . function . toLowerCase ( ) === 'posexplode' ) {
this . $ = { lateralView : { udtf : $$ [ $0 - 1 ] , tableAlias : $$ [ $0 ] , columnAliases : [ 'pos' , 'val' ] } , suggestKeywords : [ 'AS' ] } ;
}
else {
this . $ = { lateralView : { udtf : $$ [ $0 - 1 ] , tableAlias : $$ [ $0 ] , columnAliases : [ ] } , suggestKeywords : [ 'AS' ] } ;
}
break ;
case 2464 :
this . $ = { lateralView : { udtf : $$ [ $0 - 1 ] , columnAliases : $$ [ $0 ] } } ;
break ;
case 2471 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ { value : 'OUTER' , weight : 2 } , { value : 'explode' , weight : 1 } , { value : 'posexplode' , weight : 1 } ] ) ;
}
else {
parser . suggestKeywords ( [ 'explode' , 'posexplode' ] ) ;
}
break ;
case 2476 :
this . $ = [ $$ [ $0 - 2 ] , $$ [ $0 ] ] ;
break ;
case 2493 :
parser . suggestKeywords ( [ 'ALL' , 'NONE' ] ) ;
break ;
case 2513 :
parser . suggestKeywords ( [ 'COLUMNS' , 'COMPACTIONS' , 'CONF' , 'CREATE TABLE' , 'CURRENT ROLES' , 'DATABASES' , 'FORMATTED' , 'FUNCTIONS' , 'GRANT' , 'INDEX' , 'INDEXES' , 'LOCKS' , 'MATERIALIZED VIEWS' , 'PARTITIONS' , 'PRINCIPALS' , 'ROLE GRANT' , 'ROLES' , 'SCHEMAS' , 'TABLE EXTENDED' , 'TABLES' , 'TBLPROPERTIES' , 'TRANSACTIONS' , 'VIEWS' ] ) ;
break ;
case 2514 :
// ROLES is considered a non-reserved keywords so we can't match it in ShowCurrentRolesStatement_EDIT
if ( $$ [ $0 ] . identifierChain && $$ [ $0 ] . identifierChain . length === 1 && $$ [ $0 ] . identifierChain [ 0 ] . name . toLowerCase ( ) === 'roles' ) {
parser . suggestKeywords ( [ 'CURRENT' ] ) ;
parser . yy . locations . pop ( ) ;
}
else {
parser . addTablePrimary ( $$ [ $0 ] ) ;
}
break ;
case 2515 :
parser . suggestKeywords ( [ 'DATABASES' , 'SCHEMAS' , 'TABLE EXTENDED' ] ) ;
break ;
case 2532 :
case 2533 :
case 2537 :
case 2538 :
case 2579 :
case 2580 :
parser . suggestKeywords ( [ 'FROM' , 'IN' ] ) ;
break ;
case 2534 :
case 2535 :
case 2536 :
case 2563 :
case 2577 :
parser . suggestTables ( ) ;
break ;
case 2544 :
case 2603 :
parser . suggestTables ( ) ;
parser . suggestDatabases ( {
appendDot : true
} ) ;
break ;
case 2545 :
if ( parser . yy . result . suggestTables && $$ [ $0 - 1 ] . isView ) {
parser . yy . result . suggestTables . onlyViews = true ;
}
break ;
case 2546 :
parser . addTablePrimary ( $$ [ $0 ] ) ;
parser . suggestKeywords ( [ 'TABLE' ] ) ;
break ;
case 2548 :
this . $ = { isView : true } ;
break ;
case 2550 :
parser . suggestKeywords ( [ 'ROLES' ] ) ;
break ;
case 2552 :
case 2625 :
parser . suggestKeywords ( [ 'LIKE' ] ) ;
break ;
case 2561 :
parser . suggestKeywords ( [ 'ALL' , 'TABLE' ] ) ;
parser . suggestTables ( ) ;
break ;
case 2582 :
parser . suggestTables ( { identifierChain : [ { name : $$ [ $0 ] } ] } ) ;
break ;
case 2584 :
parser . suggestKeywords ( [ 'VIEWS' ] ) ;
break ;
case 2585 :
case 2637 :
if ( ! $$ [ $0 - 1 ] && ! $$ [ $0 - 2 ] ) {
parser . suggestKeywords ( [ { value : 'IN' , weight : 2 } , { value : 'FROM' , weight : 2 } , { value : 'LIKE' , weight : 1 } ] ) ;
}
else if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'LIKE' ] ) ;
}
break ;
case 2593 :
parser . suggestTables ( ) ;
parser . suggestDatabases ( {
appendDot : true
} ) ;
parser . suggestKeywords ( [ 'DATABASE' , 'SCHEMA' ] ) ;
break ;
case 2595 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
parser . suggestKeywords ( [ 'EXTENDED' , 'PARTITION' ] ) ;
break ;
case 2598 :
parser . addTablePrimary ( $$ [ $0 - 2 ] ) ;
parser . suggestKeywords ( [ 'EXTENDED' ] ) ;
break ;
case 2605 :
parser . addTablePrimary ( $$ [ $0 - 1 ] ) ;
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
break ;
case 2608 :
case 2609 :
parser . suggestKeywords ( [ 'GRANT' ] ) ;
break ;
case 2610 :
case 2611 :
parser . suggestKeywords ( [ 'ROLE' , 'USER' ] ) ;
break ;
case 2615 :
case 2624 :
parser . suggestKeywords ( [ 'EXTENDED' ] ) ;
break ;
case 2618 :
if ( $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'LIKE' ] ) ;
}
else {
parser . suggestKeywords ( [ 'FROM' , 'IN' , 'LIKE' ] ) ;
}
break ;
case 2620 :
parser . suggestKeywords ( [ 'EXTENDED' ] ) ;
break ;
case 2621 :
parser . suggestKeywords ( [ 'LIKE' ] ) ;
break ;
case 2622 :
parser . suggestKeywords ( [ 'PARTITION' ] ) ;
break ;
case 2630 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'IN' , 'LIKE' ] ) ;
}
else {
parser . suggestKeywords ( [ 'LIKE' ] ) ;
}
break ;
case 2632 :
parser . addTablePrimary ( $$ [ $0 - 3 ] ) ;
break ;
case 2641 :
case 2642 :
parser . addDatabaseLocation ( _$ [ $0 ] , [ { name : $$ [ $0 ] } ] ) ;
break ;
case 2653 :
if ( ! $$ [ $0 - 1 ] ) {
parser . suggestKeywords ( [ 'WHERE' ] ) ;
}
break ;
case 2654 :
parser . suggestKeywords ( [ 'SET' ] ) ;
break ;
case 2670 :
parser . suggestKeywords ( [ '=' ] ) ;
break ;
case 2679 :
if ( ! parser . yy . cursorFound ) {
parser . yy . result . useDatabase = $$ [ $0 ] ;
}
break ;
case 2682 :
this . $ = { inValueEdit : true } ;
break ;
case 2683 :
this . $ = { inValueEdit : true , cursorAtStart : true } ;
break ;
case 2684 :
case 2685 :
case 2686 :
this . $ = { suggestKeywords : [ 'NOT' ] } ;
break ;
case 2690 :
case 2691 :
case 2692 :
parser . suggestFunctions ( { types : [ 'STRING' ] } ) ;
parser . suggestColumns ( { types : [ 'STRING' ] } ) ;
this . $ = { types : [ 'BOOLEAN' ] } ;
break ;
case 2693 :
case 2695 :
this . $ = parser . findCaseType ( $$ [ $0 - 1 ] ) ;
break ;
case 2694 :
case 2697 :
$$ [ $0 - 3 ] . caseTypes . push ( $$ [ $0 - 1 ] ) ;
this . $ = parser . findCaseType ( $$ [ $0 - 3 ] ) ;
break ;
case 2696 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] , [ 'END' ] ) ;
$$ [ $0 - 3 ] . caseTypes . push ( $$ [ $0 - 1 ] ) ;
this . $ = parser . findCaseType ( $$ [ $0 - 3 ] ) ;
break ;
case 2698 :
this . $ = parser . findCaseType ( $$ [ $0 - 2 ] ) ;
break ;
case 2699 :
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 2700 :
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 2701 :
$$ [ $0 - 3 ] . caseTypes . push ( $$ [ $0 - 1 ] ) ;
this . $ = parser . findCaseType ( $$ [ $0 - 3 ] ) ;
this . $ . suggestFilters = $$ [ $0 - 1 ] . suggestFilters ;
break ;
case 2702 :
parser . valueExpressionSuggest ( ) ;
this . $ = parser . findCaseType ( $$ [ $0 - 3 ] ) ;
break ;
case 2703 :
parser . valueExpressionSuggest ( ) ;
this . $ = { types : [ 'T' ] , typeSet : true } ;
break ;
case 2704 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = $$ [ $0 - 1 ] ;
break ;
case 2705 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { types : [ 'T' ] } ;
break ;
case 2708 :
this . $ = { caseTypes : [ $$ [ $0 ] ] , lastType : $$ [ $0 ] } ;
break ;
case 2709 :
$$ [ $0 - 1 ] . caseTypes . push ( $$ [ $0 ] ) ;
this . $ = { caseTypes : $$ [ $0 - 1 ] . caseTypes , lastType : $$ [ $0 ] } ;
break ;
case 2713 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] , [ 'WHEN' ] ) ;
break ;
case 2716 :
this . $ = { caseTypes : [ { types : [ 'T' ] } ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2717 :
this . $ = { caseTypes : [ { types : [ 'T' ] } ] , suggestFilters : $$ [ $0 - 1 ] . suggestFilters } ;
break ;
case 2718 :
this . $ = { caseTypes : [ $$ [ $0 ] ] , suggestFilters : $$ [ $0 - 2 ] . suggestFilters } ;
break ;
case 2719 :
case 2720 :
this . $ = { caseTypes : [ $$ [ $0 ] ] , suggestFilters : $$ [ $0 ] . suggestFilters } ;
break ;
case 2721 :
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
case 2722 :
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { caseTypes : [ $$ [ $0 ] ] } ;
break ;
case 2723 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
case 2724 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'WHEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
case 2725 :
case 2727 :
parser . valueExpressionSuggest ( ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] , suggestFilters : true } ;
break ;
case 2726 :
parser . valueExpressionSuggest ( ) ;
parser . suggestKeywords ( [ 'THEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] , suggestFilters : true } ;
break ;
case 2728 :
parser . valueExpressionSuggest ( ) ;
this . $ = { caseTypes : [ $$ [ $0 ] ] , suggestFilters : true } ;
break ;
case 2729 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 1 ] , [ 'THEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
case 2730 :
parser . suggestValueExpressionKeywords ( $$ [ $0 - 2 ] , [ 'THEN' ] ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
case 2731 :
case 2732 :
case 2733 :
case 2734 :
parser . valueExpressionSuggest ( ) ;
this . $ = { caseTypes : [ { types : [ 'T' ] } ] } ;
break ;
}
} ,
2020-03-26 13:06:16 +08:00
table : [ o ( $V0 , $V1 , { 641 : 1 , 642 : 2 } ) , { 1 : [ 3 ] } , o ( $V2 , $V3 , { 643 : 3 , 209 : 4 , 210 : 5 , 3 : 6 , 211 : 7 , 195 : 8 , 4 : 10 , 5 : 11 , 6 : 12 , 7 : 13 , 8 : 14 , 9 : 15 , 10 : 16 , 11 : 17 , 12 : 18 , 13 : 19 , 14 : 20 , 15 : 21 , 500 : 22 , 501 : 23 , 215 : 24 , 502 : 25 , 503 : 26 , 504 : 27 , 505 : 28 , 506 : 29 , 816 : 30 , 30 : 31 , 31 : 32 , 32 : 33 , 33 : 34 , 34 : 35 , 35 : 36 , 36 : 37 , 251 : 39 , 252 : 40 , 253 : 41 , 254 : 42 , 255 : 43 , 256 : 44 , 257 : 45 , 258 : 46 , 515 : 47 , 516 : 48 , 517 : 49 , 518 : 50 , 519 : 51 , 520 : 52 , 521 : 53 , 522 : 54 , 523 : 55 , 1010 : 61 , 1011 : 62 , 1012 : 63 , 1013 : 64 , 1014 : 65 , 1015 : 66 , 1016 : 67 , 1017 : 68 , 1018 : 69 , 1019 : 70 , 1020 : 71 , 1021 : 72 , 1022 : 73 , 1023 : 74 , 1024 : 75 , 1025 : 76 , 1026 : 77 , 1027 : 78 , 1028 : 79 , 575 : 82 , 576 : 83 , 604 : 85 , 65 : 92 , 194 : 93 , 456 : 97 , 26 : $V4 , 44 : $V5 , 152 : $V6 , 166 : $V7 , 198 : $V8 , 205 : $V9 , 217 : $Va , 231 : $Vb , 266 : $Vc , 533 : $Vd , 534 : $Ve , 535 : $Vf , 538 : $Vg , 542 : $Vh , 562 : $Vi , 564 : $Vj , 566 : $Vk , 571 : $Vl , 608 : $Vm , 625 : $Vn , 633 : $Vo , 639 : $Vp , 669 : $Vq , 674 : $Vr , 815 : $Vs } ) , { 644 : [ 1 , 104 ] , 647 : [ 1 , 105 ] } , o ( $V2 , [ 2 , 1196 ] ) , { 3 : 106 , 4 : 10 , 5 : 11 , 6 : 12 , 7 : 13 , 8 : 14 , 9 : 15 , 10 : 16 , 11 : 17 , 12 : 18 , 13 : 19 , 14 : 20 , 15 : 21 , 26 : $V4 , 30 : 31 , 31 : 32 , 32 : 33 , 33 : 34 , 34 : 35 , 35 : 36 , 36 : 37 , 44 : $V5 , 65 : 92 , 152 : $V6 , 166 : $V7 , 194 : 93 , 195 : 108 , 198 : $V8 , 205 : $V9 , 211 : 107 , 215 : 24 , 217 : $Va , 251 : 39 , 252 : 40 , 253 : 41 , 254 : 42 , 255 : 43 , 256 : 44 , 257 : 45 , 258 : 46 , 266 : $Vc , 456 : 97 , 500 : 22 , 501 : 23 , 502 : 25 , 503 : 26 , 504 : 27 , 505 : 28 , 506 : 29 , 515 : 47 , 516 : 48 , 517 : 49 , 518 : 50 , 519 : 51 , 520 : 52 , 521 : 53 , 522 : 54 , 523 : 55 , 533 : $Vd , 534 : $Ve , 535 : $Vf , 538 : $Vg , 542 : $Vh , 562 : $Vi , 564 : $Vj , 566 : $Vk , 571 : $Vl , 575 : 82 , 576 : 83 , 604 : 85 , 608 : $Vm , 625 : $Vn , 633 : $Vo , 639 : $Vp , 669 : $Vq , 674 : $Vr , 815 : $Vs , 816 : 30 , 1010 : 61 , 1011 : 62 , 1012 : 63 , 1013 : 64 , 1014 : 65 , 1015 : 66 , 1016 : 67 , 1017 : 68 , 1018 : 69 , 1019 : 70 , 1020 : 71 , 1021 : 72 , 1022 : 73 , 1023 : 74 , 1024 : 75 , 1025 : 76 , 1026 : 77 , 1027 : 78 , 1028 : 79 } , o ( $V2 , [ 2 , 299 ] ) , o ( $V2 , [ 2 , 300 ] ) , o ( $V2 , [ 2 , 301 ] ) , o ( $Vt , [ 2 , 344 ] , { 232 : 109 , 233 : [ 1 , 112 ] , 234 : [ 1 , 110 ] , 235 : [ 1 , 111 ] , 236 : [ 1 , 113 ] , 238 : [ 1 , 114 ] , 239 : [ 1 , 115 ] , 240 : [ 1 , 116 ] , 241 : [ 1 , 117 ] } ) , o ( $V2 , [ 2 , 1 ] ) , o ( $V2 , [ 2 , 2 ] ) , o ( $V2 , [ 2 , 3 ] ) , o ( $V2 , [ 2 , 4 ] ) , o ( $V2 , [ 2 , 5 ] ) , o ( $V2 , [ 2 , 6 ] ) , o ( $V2 , [ 2 , 7 ] ) , o ( $V2 , [ 2 , 8 ] ) , o ( $V2 , [ 2 , 9 ] ) , o ( $V2 , [ 2 , 10 ] ) , o ( $V2 , [ 2 , 11 ] ) , o ( $V2 , [ 2 , 12 ] ) , o ( $V2 , [ 2 , 814 ] ) , o ( $V2 , [ 2 , 815 ] ) , { 116 : $Vu , 501 : 118 , 535 : $Vf , 562 : $Vi , 564 : $Vj , 575 : 82 , 576 : 83 , 816 : 119 } , o ( $V2 , [ 2 , 817 ] ) , o ( $V2 , [ 2 , 818 ] ) , o ( $V2 , [ 2 , 819 ] ) , o ( $V2 , [ 2 , 820 ] ) , o ( $V2 , [ 2 , 821 ] ) , o ( $Vv , $Vw , { 817 : 121 , 821 : 122 , 823 : 123 , 765 : $Vx } ) , o ( $V2 , [ 2 , 25 ] ) , o ( $V2 , [ 2 , 26 ] ) , o ( $V2 , [ 2 , 27 ] ) , o ( $V2 , [ 2 , 28 ] ) , o ( $V2 , [ 2 , 29 ] ) , o ( $V2 , [ 2 , 30 ] ) , o ( $V2 , [ 2 , 31 ] ) , { 158 : [ 1 , 125 ] } , o ( $V2 , [ 2 , 363 ] ) , o ( $V2 , [ 2 , 364 ] ) , o ( $V2 , [ 2 , 365 ] ) , o ( $V2 , [ 2 , 366 ] ) , o ( $V2 , [ 2 , 367 ] ) , o ( $V2 , [ 2 , 368 ] ) , o ( $V2 , [ 2 , 369 ] ) , o ( $V2 , [ 2 , 370 ] ) , o ( $V2 , [ 2 , 831 ] ) , o ( $V2 , [ 2 , 832 ] ) , o ( $V2 , [ 2 , 833 ] ) , o ( $V2 , [ 2 , 834 ] ) , o ( $V2 , [ 2 , 835 ] ) , o ( $V2 , [ 2 , 836 ] ) , o ( $V2 , [ 2 , 837 ] ) , o ( $V2 , [ 2 , 838 ] ) , o ( $V2 , [ 2 , 839 ] ) , { 539 : [ 1 , 126 ] } , { 44 : $Vy , 46 : 131 , 47 : $Vz , 50 : $VA , 54 : $VB , 58 : $VC , 61 : $VD , 62 : $VE , 64 : $VF , 66 : $VG , 74 : $VH , 78 : $VI , 84 : $VJ , 85 : $VK , 86 : $VL , 89 : $VM , 90 : $VN , 92 : $VO , 99 : $VP , 107 : $VQ , 127 : $VR , 129 : $VS , 130 : $VT , 132 : $VU , 134 : $VV , 135 : $VW , 151 : $VX , 153 : $VY , 154 : $VZ , 156 : $V _ , 166 : $V$ , 174 : $V01 , 175 : $V11 , 176 : $V21 , 177 : $V31 , 178 : $V41 , 180 : $V51 , 181 : $V61 , 182 : $V71 , 198 : $V81 , 202 : $V91 , 205 : $Va1 , 217 : $Vb1 , 218 : $Vc1 , 219 : $Vd1 , 229 : $Ve1 , 230 : $Vf1 , 231 : $Vg1 , 234 : $Vh1 , 236 : $Vi1 , 238 : $Vj1 , 240 : $Vk1 , 241 : $Vl1 , 244 : $Vm1 , 245 : $Vn1 , 246 : $Vo1 , 247 : $Vp1 , 248 : $Vq1 , 249 : $Vr1 , 250 : $Vs1 , 266 : $Vt1 , 270 : 133 , 277 : $Vu1 , 318 : $Vv1 , 320 : $Vw1 , 321 : $Vx1 , 323 : $Vy1 , 328 : $Vz1 , 329 : $VA1 , 330 : $VB1 , 331 : $VC1 , 333 : $VD1 , 352 : $VE1 , 359 : $VF1 , 373 : $VG1 , 374 : $VH1 , 376 : $VI1 , 382 : $VJ1 , 386 : $VK1 , 396 : $VL1 , 397 : $VM1 , 410 : $VN1 , 417 : $VO1 , 418 : $VP1 , 419 : $VQ1 , 420 : $VR1 , 421 : $VS1 , 422 : $VT1 , 423 : $VU1 , 424 : $VV1 , 425 : $VW1 , 428 : $VX1 , 439 : $VY1 , 440 : $VZ1 , 442 : $V _1 , 443 : $V$1 , 444 : $V02 , 445 : $V
2020-03-26 11:47:47 +08:00
defaultActions : { 104 : [ 2 , 1191 ] , 324 : [ 2 , 1164 ] , 329 : [ 2 , 2658 ] , 330 : [ 2 , 2660 ] , 356 : [ 2 , 228 ] , 357 : [ 2 , 229 ] , 368 : [ 2 , 214 ] , 372 : [ 2 , 285 ] , 410 : [ 2 , 1598 ] , 411 : [ 2 , 1599 ] , 413 : [ 2 , 1620 ] , 414 : [ 2 , 1596 ] , 415 : [ 2 , 1597 ] , 467 : [ 2 , 1022 ] , 504 : [ 2 , 2313 ] , 505 : [ 2 , 2314 ] , 506 : [ 2 , 2315 ] , 507 : [ 2 , 2316 ] , 508 : [ 2 , 2317 ] , 533 : [ 2 , 2438 ] , 534 : [ 2 , 2439 ] , 535 : [ 2 , 2440 ] , 536 : [ 2 , 2441 ] , 537 : [ 2 , 2442 ] , 538 : [ 2 , 2443 ] , 539 : [ 2 , 2444 ] , 540 : [ 2 , 2445 ] , 541 : [ 2 , 2446 ] , 542 : [ 2 , 2447 ] , 543 : [ 2 , 2448 ] , 544 : [ 2 , 2449 ] , 545 : [ 2 , 2450 ] , 546 : [ 2 , 2451 ] , 547 : [ 2 , 2452 ] , 548 : [ 2 , 2453 ] , 549 : [ 2 , 2454 ] , 551 : [ 2 , 1148 ] , 557 : [ 2 , 1727 ] , 593 : [ 2 , 213 ] , 661 : [ 2 , 1619 ] , 728 : [ 2 , 1023 ] , 809 : [ 2 , 1166 ] , 814 : [ 2 , 2672 ] , 871 : [ 2 , 1618 ] , 949 : [ 2 , 2268 ] , 950 : [ 2 , 2270 ] , 951 : [ 2 , 2272 ] , 952 : [ 2 , 2274 ] , 953 : [ 2 , 2276 ] , 954 : [ 2 , 2278 ] , 955 : [ 2 , 2280 ] , 956 : [ 2 , 2282 ] , 1028 : [ 2 , 2329 ] , 1033 : [ 2 , 2424 ] , 1034 : [ 2 , 2425 ] , 1035 : [ 2 , 2426 ] , 1036 : [ 2 , 2427 ] , 1037 : [ 2 , 2428 ] , 1038 : [ 2 , 2429 ] , 1039 : [ 2 , 2430 ] , 1040 : [ 2 , 2431 ] , 1041 : [ 2 , 2432 ] , 1054 : [ 2 , 1165 ] , 1117 : [ 2 , 289 ] , 1118 : [ 2 , 290 ] , 1119 : [ 2 , 291 ] , 1153 : [ 2 , 1624 ] , 1219 : [ 2 , 2330 ] , 1229 : [ 2 , 1146 ] , 1250 : [ 2 , 562 ] , 1268 : [ 2 , 194 ] , 1270 : [ 2 , 195 ] , 1324 : [ 2 , 772 ] , 1411 : [ 2 , 607 ] , 1458 : [ 2 , 741 ] , 1459 : [ 2 , 742 ] , 1460 : [ 2 , 743 ] , 1482 : [ 2 , 1106 ] , 1511 : [ 2 , 2352 ] , 1512 : [ 2 , 2357 ] , 1628 : [ 2 , 610 ] , 1671 : [ 2 , 787 ] , 1683 : [ 2 , 1094 ] , 1684 : [ 2 , 1105 ] , 1777 : [ 2 , 600 ] , 1797 : [ 2 , 2358 ] , 1801 : [ 2 , 2359 ] , 1835 : [ 2 , 2382 ] , 1836 : [ 2 , 2383 ] } ,
2019-12-31 18:47:24 +08:00
parseError : function parseError ( str , hash ) {
if ( hash . recoverable ) {
this . trace ( str ) ;
}
else {
var error = new Error ( str ) ;
error . hash = hash ;
throw error ;
}
} ,
parse : function parse ( input ) {
var self = this , stack = [ 0 ] , tstack = [ ] , // token stack
vstack = [ null ] , // semantic value stack
lstack = [ ] , // location stack
table = this . table , yytext = '' , yylineno = 0 , yyleng = 0 , recovering = 0 , TERROR = 2 , EOF = 1 ;
var args = lstack . slice . call ( arguments , 1 ) ;
//this.reductionCount = this.shiftCount = 0;
var lexer = Object . create ( this . lexer ) ;
var sharedState = { yy : { } } ;
// copy state
for ( var k in this . yy ) {
if ( Object . prototype . hasOwnProperty . call ( this . yy , k ) ) {
sharedState . yy [ k ] = this . yy [ k ] ;
}
}
lexer . setInput ( input , sharedState . yy ) ;
sharedState . yy . lexer = lexer ;
sharedState . yy . parser = this ;
if ( typeof lexer . yylloc == 'undefined' ) {
lexer . yylloc = { } ;
}
var yyloc = lexer . yylloc ;
lstack . push ( yyloc ) ;
var ranges = lexer . options && lexer . options . ranges ;
if ( typeof sharedState . yy . parseError === 'function' ) {
this . parseError = sharedState . yy . parseError ;
}
else {
this . parseError = Object . getPrototypeOf ( this ) . parseError ;
}
function popStack ( n ) {
stack . length = stack . length - 2 * n ;
vstack . length = vstack . length - n ;
lstack . length = lstack . length - n ;
}
_token _stack : var lex = function ( ) {
var token ;
token = lexer . lex ( ) || EOF ;
// if token isn't its numeric value, convert
if ( typeof token !== 'number' ) {
token = self . symbols _ [ token ] || token ;
}
return token ;
} ;
var symbol , preErrorSymbol , state , action , a , r , yyval = { } , p , len , newState , expected ;
while ( true ) {
// retreive state number from top of stack
state = stack [ stack . length - 1 ] ;
// use default actions if available
if ( this . defaultActions [ state ] ) {
action = this . defaultActions [ state ] ;
}
else {
if ( symbol === null || typeof symbol == 'undefined' ) {
symbol = lex ( ) ;
}
// read action for current state and first input
action = table [ state ] && table [ state ] [ symbol ] ;
}
_handle _error :
// handle parse error
if ( typeof action === 'undefined' || ! action . length || ! action [ 0 ] ) {
var error _rule _depth ;
var errStr = '' ;
// Return the rule stack depth where the nearest error rule can be found.
// Return FALSE when no error recovery rule was found.
function locateNearestErrorRecoveryRule ( state ) {
var stack _probe = stack . length - 1 ;
var depth = 0 ;
// try to recover from error
for ( ; ; ) {
// check for error recovery rule in this state
if ( ( TERROR . toString ( ) ) in table [ state ] ) {
return depth ;
}
if ( state === 0 || stack _probe < 2 ) {
return false ; // No suitable error recovery rule available.
}
stack _probe -= 2 ; // popStack(1): [symbol, action]
state = stack [ stack _probe ] ;
++ depth ;
}
}
if ( ! recovering ) {
// first see if there's any chance at hitting an error recovery rule:
error _rule _depth = locateNearestErrorRecoveryRule ( state ) ;
// Report error
expected = [ ] ;
for ( p in table [ state ] ) {
if ( this . terminals _ [ p ] && p > TERROR ) {
expected . push ( "'" + this . terminals _ [ p ] + "'" ) ;
}
}
if ( lexer . showPosition ) {
errStr = 'Parse error on line ' + ( yylineno + 1 ) + ":\n" + lexer . showPosition ( ) + "\nExpecting " + expected . join ( ', ' ) + ", got '" + ( this . terminals _ [ symbol ] || symbol ) + "'" ;
}
else {
errStr = 'Parse error on line ' + ( yylineno + 1 ) + ": Unexpected " +
( symbol == EOF ? "end of input" :
( "'" + ( this . terminals _ [ symbol ] || symbol ) + "'" ) ) ;
}
this . parseError ( errStr , {
text : lexer . match ,
token : this . terminals _ [ symbol ] || symbol ,
line : lexer . yylineno ,
loc : lexer . yylloc , ruleId : stack . slice ( stack . length - 2 , stack . length ) . join ( '' ) ,
expected : expected ,
recoverable : ( error _rule _depth !== false )
} ) ;
}
else if ( preErrorSymbol !== EOF ) {
error _rule _depth = locateNearestErrorRecoveryRule ( state ) ;
}
// just recovered from another error
if ( recovering == 3 ) {
if ( symbol === EOF || preErrorSymbol === EOF ) {
throw new Error ( errStr || 'Parsing halted while starting to recover from another error.' ) ;
}
// discard current lookahead and grab another
yyleng = lexer . yyleng ;
yytext = lexer . yytext ;
yylineno = lexer . yylineno ;
yyloc = lexer . yylloc ;
symbol = lex ( ) ;
}
// try to recover from error
if ( error _rule _depth === false ) {
throw new Error ( errStr || 'Parsing halted. No suitable error recovery rule available.' ) ;
}
popStack ( error _rule _depth ) ;
preErrorSymbol = ( symbol == TERROR ? null : symbol ) ; // save the lookahead token
symbol = TERROR ; // insert generic error symbol as new lookahead
state = stack [ stack . length - 1 ] ;
action = table [ state ] && table [ state ] [ TERROR ] ;
recovering = 3 ; // allow 3 real symbols to be shifted before reporting a new error
}
// this shouldn't happen, unless resolve defaults are off
if ( action [ 0 ] instanceof Array && action . length > 1 ) {
throw new Error ( 'Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol ) ;
}
switch ( action [ 0 ] ) {
case 1 : // shift
//this.shiftCount++;
stack . push ( symbol ) ;
vstack . push ( lexer . yytext ) ;
lstack . push ( lexer . yylloc ) ;
stack . push ( action [ 1 ] ) ; // push state
symbol = null ;
if ( ! preErrorSymbol ) { // normal execution/no error
yyleng = lexer . yyleng ;
yytext = lexer . yytext ;
yylineno = lexer . yylineno ;
yyloc = lexer . yylloc ;
if ( recovering > 0 ) {
recovering -- ;
}
}
else {
// error just occurred, resume old lookahead f/ before error
symbol = preErrorSymbol ;
preErrorSymbol = null ;
}
break ;
case 2 :
// reduce
//this.reductionCount++;
len = this . productions _ [ action [ 1 ] ] [ 1 ] ;
// perform semantic action
yyval . $ = vstack [ vstack . length - len ] ; // default to $$ = $1
// default location, uses first token for firsts, last for lasts
yyval . _$ = {
first _line : lstack [ lstack . length - ( len || 1 ) ] . first _line ,
last _line : lstack [ lstack . length - 1 ] . last _line ,
first _column : lstack [ lstack . length - ( len || 1 ) ] . first _column ,
last _column : lstack [ lstack . length - 1 ] . last _column
} ;
if ( ranges ) {
yyval . _$ . range = [ lstack [ lstack . length - ( len || 1 ) ] . range [ 0 ] , lstack [ lstack . length - 1 ] . range [ 1 ] ] ;
}
r = this . performAction . apply ( yyval , [ yytext , yyleng , yylineno , sharedState . yy , action [ 1 ] , vstack , lstack ] . concat ( args ) ) ;
if ( typeof r !== 'undefined' ) {
return r ;
}
// pop off stack
if ( len ) {
stack = stack . slice ( 0 , - 1 * len * 2 ) ;
vstack = vstack . slice ( 0 , - 1 * len ) ;
lstack = lstack . slice ( 0 , - 1 * len ) ;
}
stack . push ( this . productions _ [ action [ 1 ] ] [ 0 ] ) ; // push nonterminal (reduce)
vstack . push ( yyval . $ ) ;
lstack . push ( yyval . _$ ) ;
// goto new state = table[STATE][NONTERMINAL]
newState = table [ stack [ stack . length - 2 ] ] [ stack [ stack . length - 1 ] ] ;
stack . push ( newState ) ;
break ;
case 3 :
// accept
return true ;
}
}
return true ;
} } ;
sqlParseSupport _1 . default . initSyntaxParser ( parser ) ; /* generated by jison-lex 0.3.4 */
var lexer = ( function ( ) {
var lexer = ( {
EOF : 1 ,
parseError : function parseError ( str , hash ) {
if ( this . yy . parser ) {
this . yy . parser . parseError ( str , hash ) ;
}
else {
throw new Error ( str ) ;
}
} ,
// resets the lexer, sets new input
setInput : function ( input , yy ) {
this . yy = yy || this . yy || { } ;
this . _input = input ;
this . _more = this . _backtrack = this . done = false ;
this . yylineno = this . yyleng = 0 ;
this . yytext = this . matched = this . match = '' ;
this . conditionStack = [ 'INITIAL' ] ;
this . yylloc = {
first _line : 1 ,
first _column : 0 ,
last _line : 1 ,
last _column : 0
} ;
if ( this . options . ranges ) {
this . yylloc . range = [ 0 , 0 ] ;
}
this . offset = 0 ;
return this ;
} ,
// consumes and returns one char from the input
input : function ( ) {
var ch = this . _input [ 0 ] ;
this . yytext += ch ;
this . yyleng ++ ;
this . offset ++ ;
this . match += ch ;
this . matched += ch ;
var lines = ch . match ( /(?:\r\n?|\n).*/g ) ;
if ( lines ) {
this . yylineno ++ ;
this . yylloc . last _line ++ ;
}
else {
this . yylloc . last _column ++ ;
}
if ( this . options . ranges ) {
this . yylloc . range [ 1 ] ++ ;
}
this . _input = this . _input . slice ( 1 ) ;
return ch ;
} ,
// unshifts one char (or a string) into the input
unput : function ( ch ) {
var len = ch . length ;
var lines = ch . split ( /(?:\r\n?|\n)/g ) ;
this . _input = ch + this . _input ;
this . yytext = this . yytext . substr ( 0 , this . yytext . length - len ) ;
//this.yyleng -= len;
this . offset -= len ;
var oldLines = this . match . split ( /(?:\r\n?|\n)/g ) ;
this . match = this . match . substr ( 0 , this . match . length - 1 ) ;
this . matched = this . matched . substr ( 0 , this . matched . length - 1 ) ;
if ( lines . length - 1 ) {
this . yylineno -= lines . length - 1 ;
}
var r = this . yylloc . range ;
this . yylloc = {
first _line : this . yylloc . first _line ,
last _line : this . yylineno + 1 ,
first _column : this . yylloc . first _column ,
last _column : lines ?
( lines . length === oldLines . length ? this . yylloc . first _column : 0 )
+ oldLines [ oldLines . length - lines . length ] . length - lines [ 0 ] . length :
this . yylloc . first _column - len
} ;
if ( this . options . ranges ) {
this . yylloc . range = [ r [ 0 ] , r [ 0 ] + this . yyleng - len ] ;
}
this . yyleng = this . yytext . length ;
return this ;
} ,
// When called from action, caches matched text and appends it on next action
more : function ( ) {
this . _more = true ;
return this ;
} ,
// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
reject : function ( ) {
if ( this . options . backtrack _lexer ) {
this . _backtrack = true ;
}
else {
return this . parseError ( 'Lexical error on line ' + ( this . yylineno + 1 ) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this . showPosition ( ) , {
text : "" ,
token : null ,
line : this . yylineno
} ) ;
}
return this ;
} ,
// retain first n characters of the match
less : function ( n ) {
this . unput ( this . match . slice ( n ) ) ;
} ,
// displays already matched input, i.e. for error messages
pastInput : function ( ) {
var past = this . matched . substr ( 0 , this . matched . length - this . match . length ) ;
return ( past . length > 20 ? '...' : '' ) + past . substr ( - 20 ) . replace ( /\n/g , "" ) ;
} ,
// displays upcoming input, i.e. for error messages
upcomingInput : function ( ) {
var next = this . match ;
if ( next . length < 20 ) {
next += this . _input . substr ( 0 , 20 - next . length ) ;
}
return ( next . substr ( 0 , 20 ) + ( next . length > 20 ? '...' : '' ) ) . replace ( /\n/g , "" ) ;
} ,
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition : function ( ) {
var pre = this . pastInput ( ) ;
var c = new Array ( pre . length + 1 ) . join ( "-" ) ;
return pre + this . upcomingInput ( ) + "\n" + c + "^" ;
} ,
// test the lexed token: return FALSE when not a match, otherwise return token
test _match : function ( match , indexed _rule ) {
var token , lines , backup ;
if ( this . options . backtrack _lexer ) {
// save context
backup = {
yylineno : this . yylineno ,
yylloc : {
first _line : this . yylloc . first _line ,
last _line : this . last _line ,
first _column : this . yylloc . first _column ,
last _column : this . yylloc . last _column
} ,
yytext : this . yytext ,
match : this . match ,
matches : this . matches ,
matched : this . matched ,
yyleng : this . yyleng ,
offset : this . offset ,
_more : this . _more ,
_input : this . _input ,
yy : this . yy ,
conditionStack : this . conditionStack . slice ( 0 ) ,
done : this . done
} ;
if ( this . options . ranges ) {
backup . yylloc . range = this . yylloc . range . slice ( 0 ) ;
}
}
lines = match [ 0 ] . match ( /(?:\r\n?|\n).*/g ) ;
if ( lines ) {
this . yylineno += lines . length ;
}
this . yylloc = {
first _line : this . yylloc . last _line ,
last _line : this . yylineno + 1 ,
first _column : this . yylloc . last _column ,
last _column : lines ?
lines [ lines . length - 1 ] . length - lines [ lines . length - 1 ] . match ( /\r?\n?/ ) [ 0 ] . length :
this . yylloc . last _column + match [ 0 ] . length
} ;
this . yytext += match [ 0 ] ;
this . match += match [ 0 ] ;
this . matches = match ;
this . yyleng = this . yytext . length ;
if ( this . options . ranges ) {
this . yylloc . range = [ this . offset , this . offset += this . yyleng ] ;
}
this . _more = false ;
this . _backtrack = false ;
this . _input = this . _input . slice ( match [ 0 ] . length ) ;
this . matched += match [ 0 ] ;
token = this . performAction . call ( this , this . yy , this , indexed _rule , this . conditionStack [ this . conditionStack . length - 1 ] ) ;
if ( this . done && this . _input ) {
this . done = false ;
}
if ( token ) {
return token ;
}
else if ( this . _backtrack ) {
// recover context
for ( var k in backup ) {
this [ k ] = backup [ k ] ;
}
return false ; // rule action called reject() implying the next rule should be tested instead.
}
return false ;
} ,
// return next match in input
next : function ( ) {
if ( this . done ) {
return this . EOF ;
}
if ( ! this . _input ) {
this . done = true ;
}
var token , match , tempMatch , index ;
if ( ! this . _more ) {
this . yytext = '' ;
this . match = '' ;
}
var rules = this . _currentRules ( ) ;
for ( var i = 0 ; i < rules . length ; i ++ ) {
tempMatch = this . _input . match ( this . rules [ rules [ i ] ] ) ;
if ( tempMatch && ( ! match || tempMatch [ 0 ] . length > match [ 0 ] . length ) ) {
match = tempMatch ;
index = i ;
if ( this . options . backtrack _lexer ) {
token = this . test _match ( tempMatch , rules [ i ] ) ;
if ( token !== false ) {
return token ;
}
else if ( this . _backtrack ) {
match = false ;
continue ; // rule action called reject() implying a rule MISmatch.
}
else {
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false ;
}
}
else if ( ! this . options . flex ) {
break ;
}
}
}
if ( match ) {
token = this . test _match ( match , rules [ index ] ) ;
if ( token !== false ) {
return token ;
}
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false ;
}
if ( this . _input === "" ) {
return this . EOF ;
}
else {
return this . parseError ( 'Lexical error on line ' + ( this . yylineno + 1 ) + '. Unrecognized text.\n' + this . showPosition ( ) , {
text : "" ,
token : null ,
line : this . yylineno
} ) ;
}
} ,
// return next match that has a token
lex : function lex ( ) {
var r = this . next ( ) ;
if ( r ) {
return r ;
}
else {
return this . lex ( ) ;
}
} ,
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin : function begin ( condition ) {
this . conditionStack . push ( condition ) ;
} ,
// pop the previously active lexer condition state off the condition stack
popState : function popState ( ) {
var n = this . conditionStack . length - 1 ;
if ( n > 0 ) {
return this . conditionStack . pop ( ) ;
}
else {
return this . conditionStack [ 0 ] ;
}
} ,
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules : function _currentRules ( ) {
if ( this . conditionStack . length && this . conditionStack [ this . conditionStack . length - 1 ] ) {
return this . conditions [ this . conditionStack [ this . conditionStack . length - 1 ] ] . rules ;
}
else {
return this . conditions [ "INITIAL" ] . rules ;
}
} ,
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState : function topState ( n ) {
n = this . conditionStack . length - 1 - Math . abs ( n || 0 ) ;
if ( n >= 0 ) {
return this . conditionStack [ n ] ;
}
else {
return "INITIAL" ;
}
} ,
// alias for begin(condition)
pushState : function pushState ( condition ) {
this . begin ( condition ) ;
} ,
// return the number of states currently on the stack
stateStackSize : function stateStackSize ( ) {
return this . conditionStack . length ;
} ,
options : { "case-insensitive" : true , "flex" : true } ,
performAction : function anonymous ( yy , yy _ , $avoiding _name _collisions , YY _START ) {
var YYSTATE = YY _START ;
switch ( $avoiding _name _collisions ) {
case 0 : /* skip whitespace */
break ;
case 1 : /* skip comments */
break ;
case 2 : /* skip comments */
break ;
case 3 :
parser . yy . partialCursor = false ;
parser . yy . cursorFound = yy _ . yylloc ;
return 27 ;
break ;
case 4 :
parser . yy . partialCursor = true ;
parser . yy . cursorFound = yy _ . yylloc ;
2020-03-26 11:47:47 +08:00
return 775 ;
2019-12-31 18:47:24 +08:00
break ;
case 5 :
return 561 ;
break ;
case 6 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'ALTER' , yy _ . yylloc , yy . lexer . upcomingInput ( ) ) ;
return 44 ;
break ;
case 7 :
return 150 ;
break ;
case 8 :
return 347 ;
break ;
case 9 :
return 108 ;
break ;
case 10 :
return 235 ;
break ;
case 11 :
this . begin ( 'between' ) ;
2020-03-26 11:47:47 +08:00
return 691 ;
2019-12-31 18:47:24 +08:00
break ;
case 12 :
2020-03-26 11:47:47 +08:00
return 692 ;
2019-12-31 18:47:24 +08:00
break ;
case 13 :
2020-03-26 11:47:47 +08:00
return 693 ;
2019-12-31 18:47:24 +08:00
break ;
case 14 :
2020-03-26 11:47:47 +08:00
return 694 ;
2019-12-31 18:47:24 +08:00
break ;
case 15 :
return 79 ;
break ;
case 16 :
return 228 ;
break ;
case 17 :
2020-03-26 11:47:47 +08:00
return 695 ;
2019-12-31 18:47:24 +08:00
break ;
case 18 :
2020-03-26 11:47:47 +08:00
return 697 ;
2019-12-31 18:47:24 +08:00
break ;
case 19 :
return 93 ;
break ;
case 20 :
2020-03-26 11:47:47 +08:00
return 701 ;
2019-12-31 18:47:24 +08:00
break ;
case 21 :
return 71 ;
break ;
case 22 :
parser . determineCase ( yy _ . yytext ) ;
return 266 ;
break ;
case 23 :
2020-03-26 11:47:47 +08:00
return 706 ;
2019-12-31 18:47:24 +08:00
break ;
case 24 :
2020-03-26 11:47:47 +08:00
return 707 ;
2019-12-31 18:47:24 +08:00
break ;
case 25 :
2020-03-26 11:47:47 +08:00
return 708 ;
2019-12-31 18:47:24 +08:00
break ;
case 26 :
return 556 ;
break ;
case 27 :
2020-03-26 11:47:47 +08:00
return 709 ;
2019-12-31 18:47:24 +08:00
break ;
case 28 :
2020-03-26 11:47:47 +08:00
return 710 ;
2019-12-31 18:47:24 +08:00
break ;
case 29 :
parser . determineCase ( yy _ . yytext ) ;
return 534 ;
break ;
case 30 :
parser . determineCase ( yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 815 ;
2019-12-31 18:47:24 +08:00
break ;
case 31 :
2020-03-26 11:47:47 +08:00
return 712 ;
2019-12-31 18:47:24 +08:00
break ;
case 32 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 33 :
2020-03-26 11:47:47 +08:00
return 714 ;
2019-12-31 18:47:24 +08:00
break ;
case 34 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'DROP' , yy _ . yylloc , yy . lexer . upcomingInput ( ) ) ;
return 166 ;
break ;
case 35 :
2020-03-26 11:47:47 +08:00
return 715 ;
2019-12-31 18:47:24 +08:00
break ;
case 36 :
2020-03-26 11:47:47 +08:00
return 716 ;
2019-12-31 18:47:24 +08:00
break ;
case 37 :
parser . yy . correlatedSubQuery = true ;
2020-03-26 11:47:47 +08:00
return 717 ;
2019-12-31 18:47:24 +08:00
break ;
case 38 :
return 239 ;
break ;
case 39 :
2020-03-26 11:47:47 +08:00
return 638 ;
2019-12-31 18:47:24 +08:00
break ;
case 40 :
2020-03-26 11:47:47 +08:00
return 718 ;
2019-12-31 18:47:24 +08:00
break ;
case 41 :
2020-03-26 11:47:47 +08:00
return 719 ;
2019-12-31 18:47:24 +08:00
break ;
case 42 :
2020-03-26 11:47:47 +08:00
return 720 ;
2019-12-31 18:47:24 +08:00
break ;
case 43 :
return 227 ;
break ;
case 44 :
return 371 ;
break ;
case 45 :
parser . determineCase ( yy _ . yytext ) ;
return 535 ;
break ;
case 46 :
2020-03-26 11:47:47 +08:00
return 721 ;
2019-12-31 18:47:24 +08:00
break ;
case 47 :
return 206 ;
break ;
case 48 :
return 542 ;
break ;
case 49 :
return 568 ;
break ;
case 50 :
2020-03-26 11:47:47 +08:00
return 722 ;
2019-12-31 18:47:24 +08:00
break ;
case 51 :
2020-03-26 11:47:47 +08:00
return 723 ;
2019-12-31 18:47:24 +08:00
break ;
case 52 :
2020-03-26 11:47:47 +08:00
return 726 ;
2019-12-31 18:47:24 +08:00
break ;
case 53 :
parser . determineCase ( yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 633 ;
2019-12-31 18:47:24 +08:00
break ;
case 54 :
return 488 ;
break ;
case 55 :
2020-03-26 11:47:47 +08:00
return 728 ;
2019-12-31 18:47:24 +08:00
break ;
case 56 :
parser . determineCase ( yy _ . yytext ) ;
return 562 ;
break ;
case 57 :
2020-03-26 11:47:47 +08:00
return 729 ;
2019-12-31 18:47:24 +08:00
break ;
case 58 :
2020-03-26 11:47:47 +08:00
return 730 ;
2019-12-31 18:47:24 +08:00
break ;
case 59 :
return 384 ;
break ;
case 60 :
2020-03-26 11:47:47 +08:00
return 731 ;
2019-12-31 18:47:24 +08:00
break ;
case 61 :
2020-03-26 11:47:47 +08:00
return 732 ;
2019-12-31 18:47:24 +08:00
break ;
case 62 :
2020-03-26 11:47:47 +08:00
return 733 ;
2019-12-31 18:47:24 +08:00
break ;
case 63 :
2020-03-26 11:47:47 +08:00
return 734 ;
2019-12-31 18:47:24 +08:00
break ;
case 64 :
return 307 ;
break ;
case 65 :
2020-03-26 11:47:47 +08:00
return 735 ;
2019-12-31 18:47:24 +08:00
break ;
case 66 :
return 588 ;
break ;
case 67 :
return 499 ;
break ;
case 68 :
return 491 ;
break ;
case 69 :
return 351 ;
break ;
case 70 :
2020-03-26 11:47:47 +08:00
return 738 ;
2019-12-31 18:47:24 +08:00
break ;
case 71 :
return 88 ;
break ;
case 72 :
return 208 ;
break ;
case 73 :
2020-03-26 11:47:47 +08:00
return 740 ;
2019-12-31 18:47:24 +08:00
break ;
case 74 :
2020-03-26 11:47:47 +08:00
return 741 ;
2019-12-31 18:47:24 +08:00
break ;
case 75 :
return 55 ;
break ;
case 76 :
2020-03-26 11:47:47 +08:00
return 742 ;
2019-12-31 18:47:24 +08:00
break ;
case 77 :
2020-03-26 11:47:47 +08:00
return 743 ;
2019-12-31 18:47:24 +08:00
break ;
case 78 :
2020-03-26 11:47:47 +08:00
return 744 ;
2019-12-31 18:47:24 +08:00
break ;
case 79 :
2020-03-26 11:47:47 +08:00
return 745 ;
2019-12-31 18:47:24 +08:00
break ;
case 80 :
return 161 ;
break ;
case 81 :
2020-03-26 11:47:47 +08:00
return 749 ;
2019-12-31 18:47:24 +08:00
break ;
case 82 :
return 'PRECISION' ;
break ;
case 83 :
return 317 ;
break ;
case 84 :
2020-03-26 11:47:47 +08:00
return 750 ;
2019-12-31 18:47:24 +08:00
break ;
case 85 :
return 372 ;
break ;
case 86 :
2020-03-26 11:47:47 +08:00
return 751 ;
2019-12-31 18:47:24 +08:00
break ;
case 87 :
return 571 ;
break ;
case 88 :
2020-03-26 11:47:47 +08:00
return 752 ;
2019-12-31 18:47:24 +08:00
break ;
case 89 :
2020-03-26 11:47:47 +08:00
return 753 ;
2019-12-31 18:47:24 +08:00
break ;
case 90 :
2020-03-26 11:47:47 +08:00
return 754 ;
2019-12-31 18:47:24 +08:00
break ;
case 91 :
return 409 ;
break ;
case 92 :
2020-03-26 11:47:47 +08:00
return 755 ;
2019-12-31 18:47:24 +08:00
break ;
case 93 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'SELECT' , yy _ . yylloc ) ;
return 564 ;
break ;
case 94 :
2020-03-26 11:47:47 +08:00
return 757 ;
2019-12-31 18:47:24 +08:00
break ;
case 95 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'SET' , yy _ . yylloc ) ;
return 26 ;
break ;
case 96 :
2020-03-26 11:47:47 +08:00
return 758 ;
2019-12-31 18:47:24 +08:00
break ;
case 97 :
return 204 ;
break ;
case 98 :
return 158 ;
break ;
case 99 :
2020-03-26 11:47:47 +08:00
return 619 ;
2019-12-31 18:47:24 +08:00
break ;
case 100 :
2020-03-26 11:47:47 +08:00
return 763 ;
2019-12-31 18:47:24 +08:00
break ;
case 101 :
return 75 ;
break ;
case 102 :
2020-03-26 11:47:47 +08:00
return 764 ;
2019-12-31 18:47:24 +08:00
break ;
case 103 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'TRUNCATE' , yy _ . yylloc , yy . lexer . upcomingInput ( ) ) ;
return 533 ;
break ;
case 104 :
2020-03-26 11:47:47 +08:00
return 995 ;
2019-12-31 18:47:24 +08:00
break ;
case 105 :
2020-03-26 11:47:47 +08:00
return 765 ;
2019-12-31 18:47:24 +08:00
break ;
case 106 :
parser . determineCase ( yy _ . yytext ) ;
return 566 ;
break ;
case 107 :
return 567 ;
break ;
case 108 :
return 464 ;
break ;
case 109 :
return 'UTC_TIMESTAMP' ;
break ;
case 110 :
return 586 ;
break ;
case 111 :
2020-03-26 11:47:47 +08:00
return 769 ;
2019-12-31 18:47:24 +08:00
break ;
case 112 :
2020-03-26 11:47:47 +08:00
return 771 ;
2019-12-31 18:47:24 +08:00
break ;
case 113 :
2020-03-26 11:47:47 +08:00
return 615 ;
2019-12-31 18:47:24 +08:00
break ;
case 114 :
2020-03-26 11:47:47 +08:00
return 772 ;
2019-12-31 18:47:24 +08:00
break ;
case 115 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'WITH' , yy _ . yylloc ) ;
return 152 ;
break ;
case 116 :
parser . determineCase ( yy _ . yytext ) ;
return 538 ;
break ;
case 117 :
return 66 ;
break ;
case 118 :
return 570 ;
break ;
case 119 :
return 174 ;
break ;
case 120 :
parser . determineCase ( yy _ . yytext ) ;
return 217 ;
break ;
case 121 :
return 181 ;
break ;
case 122 :
2020-03-26 11:47:47 +08:00
return 688 ;
2019-12-31 18:47:24 +08:00
break ;
case 123 :
return 234 ;
break ;
case 124 :
return 417 ;
break ;
case 125 :
2020-03-26 11:47:47 +08:00
return 649 ;
2019-12-31 18:47:24 +08:00
break ;
case 126 :
return 386 ;
break ;
case 127 :
2020-03-26 11:47:47 +08:00
return 650 ;
2019-12-31 18:47:24 +08:00
break ;
case 128 :
return 236 ;
break ;
case 129 :
return 92 ;
break ;
case 130 :
return 323 ;
break ;
case 131 :
2020-03-26 11:47:47 +08:00
return 698 ;
2019-12-31 18:47:24 +08:00
break ;
case 132 :
return 382 ;
break ;
case 133 :
return 443 ;
break ;
case 134 :
return 154 ;
break ;
case 135 :
return 277 ;
break ;
case 136 :
return 135 ;
break ;
case 137 :
2020-03-26 11:47:47 +08:00
return 651 ;
2019-12-31 18:47:24 +08:00
break ;
case 138 :
return 218 ;
break ;
case 139 :
return 134 ;
break ;
case 140 :
return 244 ;
break ;
case 141 :
return 330 ;
break ;
case 142 :
return 331 ;
break ;
case 143 :
return 329 ;
break ;
case 144 :
2020-03-26 11:47:47 +08:00
return 626 ;
2019-12-31 18:47:24 +08:00
break ;
case 145 :
2020-03-26 11:47:47 +08:00
return 652 ;
2019-12-31 18:47:24 +08:00
break ;
case 146 :
2020-03-26 11:47:47 +08:00
return 653 ;
2019-12-31 18:47:24 +08:00
break ;
case 147 :
2020-03-26 11:47:47 +08:00
return 654 ;
2019-12-31 18:47:24 +08:00
break ;
case 148 :
return 47 ;
break ;
case 149 :
return 321 ;
break ;
case 150 :
return 486 ;
break ;
case 151 :
return 447 ;
break ;
case 152 :
return 428 ;
break ;
case 153 :
return 238 ;
break ;
case 154 :
2020-03-26 11:47:47 +08:00
return 711 ;
2019-12-31 18:47:24 +08:00
break ;
case 155 :
return 247 ;
break ;
case 156 :
this . begin ( 'hdfs' ) ;
return 589 ;
break ;
case 157 :
return 177 ;
break ;
case 158 :
2020-03-26 11:47:47 +08:00
return 713 ;
2019-12-31 18:47:24 +08:00
break ;
case 159 :
return 396 ;
break ;
case 160 :
2020-03-26 11:47:47 +08:00
return 655 ;
2019-12-31 18:47:24 +08:00
break ;
case 161 :
return 176 ;
break ;
case 162 :
return 442 ;
break ;
case 163 :
return 156 ;
break ;
case 164 :
parser . determineCase ( yy _ . yytext ) ;
return 231 ;
break ;
case 165 :
parser . determineCase ( yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 639 ;
2019-12-31 18:47:24 +08:00
break ;
case 166 :
return 248 ;
break ;
case 167 :
return 439 ;
break ;
case 168 :
return 468 ;
break ;
case 169 :
return 127 ;
break ;
case 170 :
return 175 ;
break ;
case 171 :
return 410 ;
break ;
case 172 :
return 233 ;
break ;
case 173 :
2020-03-26 11:47:47 +08:00
return 656 ;
2019-12-31 18:47:24 +08:00
break ;
case 174 :
2020-03-26 11:47:47 +08:00
return 657 ;
2019-12-31 18:47:24 +08:00
break ;
case 175 :
return 487 ;
break ;
case 176 :
return 54 ;
break ;
case 177 :
2020-03-26 11:47:47 +08:00
return 727 ;
2019-12-31 18:47:24 +08:00
break ;
case 178 :
this . begin ( 'hdfs' ) ;
2020-03-26 11:47:47 +08:00
return 628 ;
2019-12-31 18:47:24 +08:00
break ;
case 179 :
return 418 ;
break ;
case 180 :
return 444 ;
break ;
case 181 :
return 469 ;
break ;
case 182 :
return 245 ;
break ;
case 183 :
return 420 ;
break ;
case 184 :
return 318 ;
break ;
case 185 :
return 445 ;
break ;
case 186 :
2020-03-26 11:47:47 +08:00
return 658 ;
2019-12-31 18:47:24 +08:00
break ;
case 187 :
return 446 ;
break ;
case 188 :
return 328 ;
break ;
case 189 :
parser . determineCase ( yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 625 ;
2019-12-31 18:47:24 +08:00
break ;
case 190 :
this . begin ( 'hdfs' ) ;
2020-03-26 11:47:47 +08:00
return 659 ;
2019-12-31 18:47:24 +08:00
break ;
case 191 :
return 563 ;
break ;
case 192 :
return 240 ;
break ;
case 193 :
2020-03-26 11:47:47 +08:00
return 617 ;
2019-12-31 18:47:24 +08:00
break ;
case 194 :
return 61 ;
break ;
case 195 :
2020-03-26 11:47:47 +08:00
return 608 ;
2019-12-31 18:47:24 +08:00
break ;
case 196 :
return 229 ;
break ;
case 197 :
2020-03-26 11:47:47 +08:00
return 660 ;
2019-12-31 18:47:24 +08:00
break ;
case 198 :
2020-03-26 11:47:47 +08:00
return 661 ;
2019-12-31 18:47:24 +08:00
break ;
case 199 :
return 198 ;
break ;
case 200 :
return 178 ;
break ;
case 201 :
return 374 ;
break ;
case 202 :
return 230 ;
break ;
case 203 :
return 333 ;
break ;
case 204 :
return 180 ;
break ;
case 205 :
return 246 ;
break ;
case 206 :
return 249 ;
break ;
case 207 :
return 569 ;
break ;
case 208 :
return 421 ;
break ;
case 209 :
return 419 ;
break ;
case 210 :
2020-03-26 11:47:47 +08:00
return 746 ;
2019-12-31 18:47:24 +08:00
break ;
case 211 :
return 153 ;
break ;
case 212 :
this . begin ( 'hdfs' ) ;
return 592 ;
break ;
case 213 :
return 50 ;
break ;
case 214 :
return 422 ;
break ;
case 215 :
return 376 ;
break ;
case 216 :
return 85 ;
break ;
case 217 :
2020-03-26 11:47:47 +08:00
return 662 ;
2019-12-31 18:47:24 +08:00
break ;
case 218 :
return 574 ;
break ;
case 219 :
return 532 ;
break ;
case 220 :
2020-03-26 11:47:47 +08:00
return 663 ;
2019-12-31 18:47:24 +08:00
break ;
case 221 :
return 423 ;
break ;
case 222 :
return 58 ;
break ;
case 223 :
return 84 ;
break ;
case 224 :
parser . determineCase ( yy _ . yytext ) ;
return 205 ;
break ;
case 225 :
return 373 ;
break ;
case 226 :
return 74 ;
break ;
case 227 :
return 202 ;
break ;
case 228 :
return 99 ;
break ;
case 229 :
2020-03-26 11:47:47 +08:00
return 640 ;
2019-12-31 18:47:24 +08:00
break ;
case 230 :
2020-03-26 11:47:47 +08:00
return 664 ;
2019-12-31 18:47:24 +08:00
break ;
case 231 :
return 64 ;
break ;
case 232 :
return 473 ;
break ;
case 233 :
2020-03-26 11:47:47 +08:00
return 665 ;
2019-12-31 18:47:24 +08:00
break ;
case 234 :
2020-03-26 11:47:47 +08:00
return 756 ;
2019-12-31 18:47:24 +08:00
break ;
case 235 :
2020-03-26 11:47:47 +08:00
return 666 ;
2019-12-31 18:47:24 +08:00
break ;
case 236 :
2020-03-26 11:47:47 +08:00
return 667 ;
2019-12-31 18:47:24 +08:00
break ;
case 237 :
return 424 ;
break ;
case 238 :
return 130 ;
break ;
case 239 :
return 132 ;
break ;
case 240 :
2020-03-26 11:47:47 +08:00
return 668 ;
2019-12-31 18:47:24 +08:00
break ;
case 241 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'SHOW' , yy _ . yylloc ) ;
2020-03-26 11:47:47 +08:00
return 669 ;
2019-12-31 18:47:24 +08:00
break ;
case 242 :
return 565 ;
break ;
case 243 :
return 90 ;
break ;
case 244 :
return 78 ;
break ;
case 245 :
2020-03-26 11:47:47 +08:00
return 881 ;
2019-12-31 18:47:24 +08:00
break ;
case 246 :
return 397 ;
break ;
case 247 :
return 219 ;
break ;
case 248 :
return 107 ;
break ;
case 249 :
return 89 ;
break ;
case 250 :
2020-03-26 11:47:47 +08:00
return 670 ;
2019-12-31 18:47:24 +08:00
break ;
case 251 :
return 352 ;
break ;
case 252 :
return 250 ;
break ;
case 253 :
2020-03-26 11:47:47 +08:00
return 671 ;
2019-12-31 18:47:24 +08:00
break ;
case 254 :
2020-03-26 11:47:47 +08:00
return 762 ;
2019-12-31 18:47:24 +08:00
break ;
case 255 :
return 129 ;
break ;
case 256 :
return 460 ;
break ;
case 257 :
return 440 ;
break ;
case 258 :
return 425 ;
break ;
case 259 :
2020-03-26 11:47:47 +08:00
return 672 ;
2019-12-31 18:47:24 +08:00
break ;
case 260 :
return 86 ;
break ;
case 261 :
2020-03-26 11:47:47 +08:00
return 673 ;
2019-12-31 18:47:24 +08:00
break ;
case 262 :
return 539 ;
break ;
case 263 :
return 182 ;
break ;
case 264 :
return 359 ;
break ;
case 265 :
return 320 ;
break ;
case 266 :
parser . determineCase ( yy _ . yytext ) ;
parser . addStatementTypeLocation ( 'USE' , yy _ . yylloc ) ;
2020-03-26 11:47:47 +08:00
return 674 ;
2019-12-31 18:47:24 +08:00
break ;
case 267 :
return 241 ;
break ;
case 268 :
return 62 ;
break ;
case 269 :
return 151 ;
break ;
case 270 :
2020-03-26 11:47:47 +08:00
return 675 ;
2019-12-31 18:47:24 +08:00
break ;
case 271 :
2020-03-26 11:47:47 +08:00
return 773 ;
2019-12-31 18:47:24 +08:00
break ;
case 272 :
2020-03-26 11:47:47 +08:00
return 676 ;
2019-12-31 18:47:24 +08:00
break ;
case 273 :
2020-03-26 11:47:47 +08:00
return 683 ;
2019-12-31 18:47:24 +08:00
break ;
case 274 :
2020-03-26 11:47:47 +08:00
return 684 ;
2019-12-31 18:47:24 +08:00
break ;
case 275 :
2020-03-26 11:47:47 +08:00
return 685 ;
2019-12-31 18:47:24 +08:00
break ;
case 276 :
this . popState ( ) ;
2020-03-26 11:47:47 +08:00
return 889 ;
2019-12-31 18:47:24 +08:00
break ;
case 277 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'avg' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 689 ;
2019-12-31 18:47:24 +08:00
break ;
case 278 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'cast' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 696 ;
2019-12-31 18:47:24 +08:00
break ;
case 279 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'collect_list' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 699 ;
2019-12-31 18:47:24 +08:00
break ;
case 280 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'collect_set' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 700 ;
2019-12-31 18:47:24 +08:00
break ;
case 281 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'corr' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 702 ;
2019-12-31 18:47:24 +08:00
break ;
case 282 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'count' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 703 ;
2019-12-31 18:47:24 +08:00
break ;
case 283 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'covar_pop' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 704 ;
2019-12-31 18:47:24 +08:00
break ;
case 284 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'covar_samp' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 705 ;
2019-12-31 18:47:24 +08:00
break ;
case 285 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'extract' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 1001 ;
2019-12-31 18:47:24 +08:00
break ;
case 286 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'histogram_numeric' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 725 ;
2019-12-31 18:47:24 +08:00
break ;
case 287 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'max' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 736 ;
2019-12-31 18:47:24 +08:00
break ;
case 288 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'min' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 737 ;
2019-12-31 18:47:24 +08:00
break ;
case 289 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'ntile' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 739 ;
2019-12-31 18:47:24 +08:00
break ;
case 290 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'percentile' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 747 ;
2019-12-31 18:47:24 +08:00
break ;
case 291 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'percentile_approx' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 748 ;
2019-12-31 18:47:24 +08:00
break ;
case 292 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'stddev_pop' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 759 ;
2019-12-31 18:47:24 +08:00
break ;
case 293 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'stddev_samp' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 760 ;
2019-12-31 18:47:24 +08:00
break ;
case 294 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'sum' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 761 ;
2019-12-31 18:47:24 +08:00
break ;
case 295 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'var_pop' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 767 ;
2019-12-31 18:47:24 +08:00
break ;
case 296 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'var_samp' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 768 ;
2019-12-31 18:47:24 +08:00
break ;
case 297 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'variance' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 770 ;
2019-12-31 18:47:24 +08:00
break ;
case 298 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'cume_dist' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 299 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'cume_dist' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 300 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'dense_rank' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 301 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'first_value' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 302 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'lag' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 303 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'last_value' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 304 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'lead' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 305 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'percent_rank' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 306 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'rank' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 307 :
yy . lexer . unput ( '(' ) ;
yy _ . yytext = 'row_number' ;
parser . addFunctionLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 686 ;
2019-12-31 18:47:24 +08:00
break ;
case 308 :
return 385 ;
break ;
case 309 :
return 385 ;
break ;
case 310 :
2020-03-26 11:47:47 +08:00
return 766 ;
2019-12-31 18:47:24 +08:00
break ;
case 311 :
2020-03-26 11:47:47 +08:00
return 677 ;
2019-12-31 18:47:24 +08:00
break ;
case 312 :
parser . yy . cursorFound = true ;
return 27 ;
break ;
case 313 :
parser . yy . cursorFound = true ;
2020-03-26 11:47:47 +08:00
return 775 ;
2019-12-31 18:47:24 +08:00
break ;
case 314 :
2020-03-26 11:47:47 +08:00
return 724 ;
2019-12-31 18:47:24 +08:00
break ;
case 315 :
parser . addFileLocation ( yy _ . yylloc , yy _ . yytext ) ;
2020-03-26 11:47:47 +08:00
return 998 ;
2019-12-31 18:47:24 +08:00
break ;
case 316 :
this . popState ( ) ;
2020-03-26 11:47:47 +08:00
return 999 ;
2019-12-31 18:47:24 +08:00
break ;
case 317 :
2020-03-26 11:47:47 +08:00
return 644 ;
2019-12-31 18:47:24 +08:00
break ;
case 318 :
return 150 ;
break ;
case 319 :
2020-03-26 11:47:47 +08:00
return 742 ;
2019-12-31 18:47:24 +08:00
break ;
case 320 :
return 126 ;
break ;
case 321 :
return 348 ;
break ;
case 322 :
return 349 ;
break ;
case 323 :
return 381 ;
break ;
case 324 :
return 381 ;
break ;
case 325 :
return 381 ;
break ;
case 326 :
return 381 ;
break ;
case 327 :
return 381 ;
break ;
case 328 :
2020-03-26 11:47:47 +08:00
return 682 ;
2019-12-31 18:47:24 +08:00
break ;
case 329 :
2020-03-26 11:47:47 +08:00
return 681 ;
2019-12-31 18:47:24 +08:00
break ;
case 330 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 331 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 332 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 333 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 334 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 335 :
2020-03-26 11:47:47 +08:00
return 687 ;
2019-12-31 18:47:24 +08:00
break ;
case 336 :
return 123 ;
break ;
case 337 :
2020-03-26 11:47:47 +08:00
return 683 ;
2019-12-31 18:47:24 +08:00
break ;
case 338 :
return 358 ;
break ;
case 339 :
2020-03-26 11:47:47 +08:00
return 647 ;
2019-12-31 18:47:24 +08:00
break ;
case 340 :
2020-03-26 11:47:47 +08:00
return 774 ;
2019-12-31 18:47:24 +08:00
break ;
case 341 :
2020-03-26 11:47:47 +08:00
return 680 ;
2019-12-31 18:47:24 +08:00
break ;
case 342 :
return 116 ;
break ;
case 343 :
return 118 ;
break ;
case 344 :
2020-03-26 11:47:47 +08:00
return 684 ;
2019-12-31 18:47:24 +08:00
break ;
case 345 :
2020-03-26 11:47:47 +08:00
return 685 ;
2019-12-31 18:47:24 +08:00
break ;
case 346 :
2020-03-26 11:47:47 +08:00
return 678 ;
2019-12-31 18:47:24 +08:00
break ;
case 347 :
this . begin ( 'backtickedValue' ) ;
2020-03-26 11:47:47 +08:00
return 690 ;
2019-12-31 18:47:24 +08:00
break ;
case 348 :
if ( parser . handleQuotedValueWithCursor ( this , yy _ . yytext , yy _ . yylloc , '`' ) ) {
2020-03-26 11:47:47 +08:00
return 780 ;
2019-12-31 18:47:24 +08:00
}
return 281 ;
break ;
case 349 :
this . popState ( ) ;
2020-03-26 11:47:47 +08:00
return 690 ;
2019-12-31 18:47:24 +08:00
break ;
case 350 :
this . begin ( 'singleQuotedValue' ) ;
return 279 ;
break ;
case 351 :
if ( parser . handleQuotedValueWithCursor ( this , yy _ . yytext , yy _ . yylloc , '\'' ) ) {
2020-03-26 11:47:47 +08:00
return 780 ;
2019-12-31 18:47:24 +08:00
}
return 281 ;
break ;
case 352 :
this . popState ( ) ;
return 279 ;
break ;
case 353 :
this . begin ( 'doubleQuotedValue' ) ;
return 280 ;
break ;
case 354 :
if ( parser . handleQuotedValueWithCursor ( this , yy _ . yytext , yy _ . yylloc , '"' ) ) {
2020-03-26 11:47:47 +08:00
return 780 ;
2019-12-31 18:47:24 +08:00
}
return 281 ;
break ;
case 355 :
this . popState ( ) ;
return 280 ;
break ;
case 356 :
2020-03-26 11:47:47 +08:00
return 644 ;
2019-12-31 18:47:24 +08:00
break ;
case 357 : /* To prevent console logging of unknown chars */
break ;
case 358 :
break ;
case 359 :
break ;
case 360 :
break ;
case 361 :
break ;
case 362 :
break ;
case 363 :
console . log ( yy _ . yytext ) ;
break ;
}
} ,
rules : [ /^(?:\s)/i , /^(?:--.*)/i , /^(?:[\/][*][^*]*[*]+([^\/*][^*]*[*]+)*[\/])/i , /^(?:\u2020)/i , /^(?:\u2021)/i , /^(?:ALL)/i , /^(?:ALTER)/i , /^(?:AND)/i , /^(?:ARRAY)/i , /^(?:AS)/i , /^(?:AUTHORIZATION)/i , /^(?:BETWEEN)/i , /^(?:BIGINT)/i , /^(?:BINARY)/i , /^(?:BOOLEAN)/i , /^(?:BY)/i , /^(?:CACHE)/i , /^(?:CASE)/i , /^(?:CHAR)/i , /^(?:COLUMN)/i , /^(?:CONF)/i , /^(?:CONSTRAINT)/i , /^(?:CREATE)/i , /^(?:CROSS)/i , /^(?:CUBE)/i , /^(?:CURRENT)/i , /^(?:DATABASE)/i , /^(?:DATE)/i , /^(?:DECIMAL)/i , /^(?:DELETE)/i , /^(?:DESCRIBE)/i , /^(?:DISTINCT)/i , /^(?:DIV)/i , /^(?:DOUBLE)/i , /^(?:DROP)/i , /^(?:ELSE)/i , /^(?:END)/i , /^(?:EXISTS)/i , /^(?:EXTENDED)/i , /^(?:EXTERNAL)/i , /^(?:FALSE)/i , /^(?:FLOAT)/i , /^(?:FOLLOWING)/i , /^(?:FOR)/i , /^(?:FOREIGN)/i , /^(?:FROM)/i , /^(?:FULL)/i , /^(?:FUNCTION)/i , /^(?:GRANT)/i , /^(?:GROUP)/i , /^(?:GROUPING)/i , /^(?:HAVING)/i , /^(?:IF)/i , /^(?:IMPORT)/i , /^(?:IN)/i , /^(?:INNER)/i , /^(?:INSERT)/i , /^(?:INT)/i , /^(?:INTEGER)/i , /^(?:INTO)/i , /^(?:IS)/i , /^(?:JOIN)/i , /^(?:LATERAL)/i , /^(?:LEFT)/i , /^(?:LIKE)/i , /^(?:LIMIT)/i , /^(?:LOCAL)/i , /^(?:LIFECYCLE)/i , /^(?:MACRO)/i , /^(?:MAP)/i , /^(?:NONE)/i , /^(?:NOT)/i , /^(?:NULL)/i , /^(?:NULLS)/i , /^(?:OF)/i , /^(?:ON)/i , /^(?:OR)/i , /^(?:ORDER)/i , /^(?:OUT)/i , /^(?:OUTER)/i , /^(?:PARTITION)/i , /^(?:PRECEDING)/i , /^(?:PRECISION)/i , /^(?:PRIMARY)/i , /^(?:RANGE)/i , /^(?:REFERENCES)/i , /^(?:REGEXP)/i , /^(?:REVOKE)/i , /^(?:RIGHT)/i , /^(?:RLIKE)/i , /^(?:ROLLUP)/i , /^(?:ROW)/i , /^(?:ROWS)/i , /^(?:SELECT)/i , /^(?:SEMI)/i , /^(?:SET)/i , /^(?:SMALLINT)/i , /^(?:SYNC)/i , /^(?:TABLE)/i , /^(?:THEN)/i , /^(?:TIMESTAMP)/i , /^(?:TO)/i , /^(?:TRUE)/i , /^(?:TRUNCATE)/i , /^(?:UNBOUNDED)/i , /^(?:UNION)/i , /^(?:UPDATE)/i , /^(?:USER)/i , /^(?:USING)/i , /^(?:UTC_TIMESTAMP)/i , /^(?:VALUES)/i , /^(?:VARCHAR)/i , /^(?:VIEWS)/i , /^(?:WHEN)/i , /^(?:WHERE)/i , /^(?:WITH)/i , /^(?:ABORT)/i , /^(?:ADD)/i , /^(?:ADMIN)/i , /^(?:AFTER)/i , /^(?:ANALYZE)/i , /^(?:ARCHIVE)/i , /^(?:ASC)/i , /^(?:AST)/i , /^(?:AVRO)/i , /^(?:BUCKET)/i , /^(?:BUCKETS)/i , /^(?:CASCADE)/i , /^(?:CBO)/i , /^(?:CHANGE)/i , /^(?:CHECK)/i , /^(?:CLUSTER)/i , /^(?:CLUSTERED)/i , /^(?:COLLECTION)/i , /^(?:COLUMNS)/i , /^(?:COMMENT)/i , /^(?:COMPACT)/i , /^(?:COMPACTIONS)/i , /^(?:COMPUTE)/i , /^(?:CONCATENATE)/i , /^(?:COST)/i , /^(?:CURRENT_DATE)/i , /^(?:CURRENT_TIMESTAMP)/i , /^(?:CURRENT_USER)/i , /^(?:DATA)/i , /^(?:DATABASES)/i , /^(?:DAY)/i , /^(?:DAYOFWEEK)/i , /^(?:DBPROPERTIES)/i , /^(?:DEFAULT)/i , /^(?:DEFERRED)/i , /^(?:DEFINED)/i , /^(?:DELIMITED)/i , /^(?:DEPENDENCY)/i , /^(?:DESC)/i , /^(?:DETAIL)/i , /^(?:DIRECTORY)/i , /^(?:DISABLE)/i , /^(?:DISTRIBUTE)/i , /^(?:DISTRIBUTED)/i , /^(?:DOUBLE\s+PRECISION)/i , /^(?:ENABLE)/i , /^(?:ESCAPED)/i , /^(?:EXCHANGE)/i , /^(?:EXPLAIN)/i , /^(?:EXPORT)/i , /^(?:EXPRESSION)/i , /^(?:FIELDS)/i , /^(?:FILE)/i , /^(?:FILEFORMAT)/i , /^(?:FIRST)/i , /^(?:FORMAT)/i , /^(?:FORMATTED)/i , /^(?:FUNCTIONS)/i , /^(?:HOUR)/i , /^(?:IDXPROPERTIES)/i , /^(?:INDEX)/i , /^(?:INDEXES)/i , /^(?:INPATH)/i , /^(?:INPUTFORMAT)/i , /^(?:ITEMS)/i , /^(?:JAR)/i , /^(?:JOINCOST)/i , /^(?:JSONFILE)/i , /^(?:KEY)/i , /^(?:KEYS)/i , /^(?:LAST)/i , /^(?:LINES)/i , /^(?:LITERAL)/i , /^(?:LOAD)/i , /^(?:LOCATION)/i , /^(?:LOCK)/i , /^(?:LOCKS)/i , /^(?:MATCHED)/i , /^(?:MATERIALIZED)/i , /^(?:MERGE)/i , /^(?:METADATA)/i , /^(?:MINUTE)/i , /^(?:MONTH)/i , /^(?:MSCK)/i , /^(?:NO_DROP)/i , /^(?:NORELY)/i , /^(?:NOSCAN)/i , /^(?:NOVALIDATE)/i , /^(?:OFFLINE)/i , /^(?:ONLY)/i , /^(?:OPERATOR)/i , /^(?:OPTION)/i , /^(?:ORC)/i , /^(?:OUTPUTFORMAT)/i , /^(?:OVER)/i , /^(?:OVERWRITE)/i , /^(?:OVERWRITE\s+DIRECTORY)/i , /^(?:OWNER)/i , /^(?:PARQUET)/i , /^(?:PARTITIONED)/i , /^(?:PARTITIONS)/i , /^(?:PERCENT)/i , /^(?:PRIVILEGES)/i , /^(?:PURGE)/i , /^(?:QUARTER)/i , /^(?:RCFILE)/i , /^(?:REBUILD)/i , /^(?:RECOVER)/i , /^(?:RELOAD)/i , /^(?:RELY)/i , /^(?:RENAME)/i , /^(?:REPAIR)/i , /^(?:REPLACE)/i , /^(?:REPLICATION)/i , /^(?:RESTRICT)/i , /^(?:REWRITE)/i , /^(?:ROLE)/i , /^(?:ROLES)/i , /^(?:SCHEMA)/i , /^(?:SCHEMAS)/i , /^(?:SECOND)/i , /^(?:SEQUENCEFILE)/i , /^(?:SERDE)/i , /^(?:SERDEPROPERTIES)/i , /^(?:SETS)/i , /^(?:SHOW)/i , /^(?:SHOW_DATABASE)/i , /^(?:SKEWED LOCATION)/i , /^(?:SKEWED)/i , /^(?:SORT)/i , /^(?:SORTED)/i , / ^ ( ? :
conditions : { "hdfs" : { "rules" : [ 312 , 313 , 314 , 315 , 316 , 317 , 359 ] , "inclusive" : false } , "doubleQuotedValue" : { "rules" : [ 354 , 355 , 362 ] , "inclusive" : false } , "singleQuotedValue" : { "rules" : [ 351 , 352 , 361 ] , "inclusive" : false } , "backtickedValue" : { "rules" : [ 348 , 349 , 360 ] , "inclusive" : false } , "between" : { "rules" : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103 , 104 , 105 , 106 , 107 , 108 , 109 , 110 , 111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 , 122 , 123 , 124 , 125 , 126 , 127 , 128 , 129 , 130 , 131 , 132 , 133 , 134 , 135 , 136 , 137 , 138 , 139 , 140 , 141 , 142 , 143 , 144 , 145 , 146 , 147 , 148 , 149 , 150 , 151 , 152 , 153 , 154 , 155 , 156 , 157 , 158 , 159 , 160 , 161 , 162 , 163 , 164 , 165 , 166 , 167 , 168 , 169 , 170 , 171 , 172 , 173 , 174 , 175 , 176 , 177 , 178 , 179 , 180 , 181 , 182 , 183 , 184 , 185 , 186 , 187 , 188 , 189 , 190 , 191 , 192 , 193 , 194 , 195 , 196 , 197 , 198 , 199 , 200 , 201 , 202 , 203 , 204 , 205 , 206 , 207 , 208 , 209 , 210 , 211 , 212 , 213 , 214 , 215 , 216 , 217 , 218 , 219 , 220 , 221 , 222 , 223 , 224 , 225 , 226 , 227 , 228 , 229 , 230 , 231 , 232 , 233 , 234 , 235 , 236 , 237 , 238 , 239 , 240 , 241 , 242 , 243 , 244 , 245 , 246 , 247 , 248 , 249 , 250 , 251 , 252 , 253 , 254 , 255 , 256 , 257 , 258 , 259 , 260 , 261 , 262 , 263 , 264 , 265 , 266 , 267 , 268 , 269 , 270 , 271 , 272 , 273 , 274 , 275 , 276 , 277 , 278 , 279 , 280 , 281 , 282 , 283 , 284 , 285 , 286 , 287 , 288 , 289 , 290 , 291 , 292 , 293 , 294 , 295 , 296 , 297 , 298 , 299 , 300 , 301 , 302 , 303 , 304 , 305 , 306 , 307 , 308 , 309 , 310 , 311 , 318 , 319 , 320 , 321 , 322 , 323 , 324 , 325 , 326 , 327 , 328 , 329 , 330 , 331 , 332 , 333 , 334 , 335 , 336 , 337 , 338 , 339 , 340 , 341 , 342 , 343 , 344 , 345 , 346 , 347 , 350 , 353 , 356 , 357 , 358 , 363 ] , "inclusive" : true } , "INITIAL" : { "rules" : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103 , 104 , 105 , 106 , 107 , 108 , 109 , 110 , 111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 , 122 , 123 , 124 , 125 , 126 , 127 , 128 , 129 , 130 , 131 , 132 , 133 , 134 , 135 , 136 , 137 , 138 , 139 , 140 , 141 , 142 , 143 , 144 , 145 , 146 , 147 , 148 , 149 , 150 , 151 , 152 , 153 , 154 , 155 , 156 , 157 , 158 , 159 , 160 , 161 , 162 , 163 , 164 , 165 , 166 , 167 , 168 , 169 , 170 , 171 , 172 , 173 , 174 , 175 , 176 , 177 , 178 , 179 , 180 , 181 , 182 , 183 , 184 , 185 , 186 , 187 , 188 , 189 , 190 , 191 , 192 , 193 , 194 , 195 , 196 , 197 , 198 , 199 , 200 , 201 , 202 , 203 , 204 , 205 , 206 , 207 , 208 , 209 , 210 , 211 , 212 , 213 , 214 , 215 , 216 , 217 , 218 , 219 , 220 , 221 , 222 , 223 , 224 , 225 , 226 , 227 , 228 , 229 , 230 , 231 , 232 , 233 , 234 , 235 , 236 , 237 , 238 , 239 , 240 , 241 , 242 , 243 , 244 , 245 , 246 , 247 , 248 , 249 , 250 , 251 , 252 , 253 , 254 , 255 , 256 , 257 , 258 , 259 , 260 , 261 , 262 , 263 , 264 , 265 , 266 , 267 , 268 , 269 , 270 , 271 , 272 , 273 , 274 , 275 , 277 , 278 , 279 , 280 , 281 , 282 , 283 , 284 , 285 , 286 , 287 , 288 , 289 , 290 , 291 , 292 , 293 , 294 , 295 , 296 , 297 , 298 , 299 , 300 , 301 , 302 , 303 , 304 , 305 , 306 , 307 , 308 , 309 , 310 , 311 , 318 , 319 , 320 , 321 , 322 , 323 , 324 , 325 , 326 , 327 , 328 , 329 , 330 , 331 , 332 , 333 , 334 , 335 , 336 , 337 , 338 , 339 , 340 , 341 , 342 , 343 , 344 , 345 , 346 , 347 , 350 , 353 , 356 , 357 , 363 ] , "inclusive" : true } }
} ) ;
return lexer ;
} ) ( ) ;
parser . lexer = lexer ;
function Parser ( ) {
this . yy = { } ;
}
Parser . prototype = parser ;
parser . Parser = Parser ;
return new Parser ;
} ) ( ) ;
exports . default = hiveSyntaxParser ;