├── README.md ├── antlr-4.5.3-complete.jar ├── gen └── com │ └── tencent │ ├── SqlBase.tokens │ ├── SqlBaseBaseListener.java │ ├── SqlBaseBaseVisitor.java │ ├── SqlBaseLexer.java │ ├── SqlBaseLexer.tokens │ ├── SqlBaseListener.java │ ├── SqlBaseParser.java │ └── SqlBaseVisitor.java └── src ├── SqlBase.g4 └── com └── tencent ├── MyVisitor.java └── ParserDriver.java /README.md: -------------------------------------------------------------------------------- 1 | # ANTLR4-SqlBase 2 | 剥离的Parser模块,用于查看Spark SQL语法解析SQL后生成的语法树 3 | -------------------------------------------------------------------------------- /antlr-4.5.3-complete.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DonnyZone/ANTLR4-SqlBase/00d9091c091d75117424248e6359f8540c2f1544/antlr-4.5.3-complete.jar -------------------------------------------------------------------------------- /gen/com/tencent/SqlBase.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | SELECT=8 9 | FROM=9 10 | ADD=10 11 | AS=11 12 | ALL=12 13 | DISTINCT=13 14 | WHERE=14 15 | GROUP=15 16 | BY=16 17 | GROUPING=17 18 | SETS=18 19 | CUBE=19 20 | ROLLUP=20 21 | ORDER=21 22 | HAVING=22 23 | LIMIT=23 24 | AT=24 25 | OR=25 26 | AND=26 27 | IN=27 28 | NOT=28 29 | NO=29 30 | EXISTS=30 31 | BETWEEN=31 32 | LIKE=32 33 | RLIKE=33 34 | IS=34 35 | NULL=35 36 | TRUE=36 37 | FALSE=37 38 | NULLS=38 39 | ASC=39 40 | DESC=40 41 | FOR=41 42 | INTERVAL=42 43 | CASE=43 44 | WHEN=44 45 | THEN=45 46 | ELSE=46 47 | END=47 48 | JOIN=48 49 | CROSS=49 50 | OUTER=50 51 | INNER=51 52 | LEFT=52 53 | SEMI=53 54 | RIGHT=54 55 | FULL=55 56 | NATURAL=56 57 | ON=57 58 | LATERAL=58 59 | WINDOW=59 60 | OVER=60 61 | PARTITION=61 62 | RANGE=62 63 | ROWS=63 64 | UNBOUNDED=64 65 | PRECEDING=65 66 | FOLLOWING=66 67 | CURRENT=67 68 | FIRST=68 69 | LAST=69 70 | ROW=70 71 | WITH=71 72 | VALUES=72 73 | CREATE=73 74 | TABLE=74 75 | VIEW=75 76 | REPLACE=76 77 | INSERT=77 78 | DELETE=78 79 | INTO=79 80 | DESCRIBE=80 81 | EXPLAIN=81 82 | FORMAT=82 83 | LOGICAL=83 84 | CODEGEN=84 85 | CAST=85 86 | SHOW=86 87 | TABLES=87 88 | COLUMNS=88 89 | COLUMN=89 90 | USE=90 91 | PARTITIONS=91 92 | FUNCTIONS=92 93 | DROP=93 94 | UNION=94 95 | EXCEPT=95 96 | SETMINUS=96 97 | INTERSECT=97 98 | TO=98 99 | TABLESAMPLE=99 100 | STRATIFY=100 101 | ALTER=101 102 | RENAME=102 103 | ARRAY=103 104 | MAP=104 105 | STRUCT=105 106 | COMMENT=106 107 | SET=107 108 | RESET=108 109 | DATA=109 110 | START=110 111 | TRANSACTION=111 112 | COMMIT=112 113 | ROLLBACK=113 114 | MACRO=114 115 | IF=115 116 | EQ=116 117 | NSEQ=117 118 | NEQ=118 119 | NEQJ=119 120 | LT=120 121 | LTE=121 122 | GT=122 123 | GTE=123 124 | PLUS=124 125 | MINUS=125 126 | ASTERISK=126 127 | SLASH=127 128 | PERCENT=128 129 | DIV=129 130 | TILDE=130 131 | AMPERSAND=131 132 | PIPE=132 133 | HAT=133 134 | RSHIFT=134 135 | PERCENTLIT=135 136 | BUCKET=136 137 | OUT=137 138 | OF=138 139 | SORT=139 140 | CLUSTER=140 141 | DISTRIBUTE=141 142 | OVERWRITE=142 143 | TRANSFORM=143 144 | REDUCE=144 145 | USING=145 146 | SERDE=146 147 | SERDEPROPERTIES=147 148 | RECORDREADER=148 149 | RECORDWRITER=149 150 | DELIMITED=150 151 | FIELDS=151 152 | TERMINATED=152 153 | COLLECTION=153 154 | ITEMS=154 155 | KEYS=155 156 | ESCAPED=156 157 | LINES=157 158 | SEPARATED=158 159 | FUNCTION=159 160 | EXTENDED=160 161 | REFRESH=161 162 | CLEAR=162 163 | CACHE=163 164 | UNCACHE=164 165 | LAZY=165 166 | FORMATTED=166 167 | GLOBAL=167 168 | TEMPORARY=168 169 | OPTIONS=169 170 | UNSET=170 171 | TBLPROPERTIES=171 172 | DBPROPERTIES=172 173 | BUCKETS=173 174 | SKEWED=174 175 | STORED=175 176 | DIRECTORIES=176 177 | LOCATION=177 178 | EXCHANGE=178 179 | ARCHIVE=179 180 | UNARCHIVE=180 181 | FILEFORMAT=181 182 | TOUCH=182 183 | COMPACT=183 184 | CONCATENATE=184 185 | CHANGE=185 186 | CASCADE=186 187 | RESTRICT=187 188 | CLUSTERED=188 189 | SORTED=189 190 | PURGE=190 191 | INPUTFORMAT=191 192 | OUTPUTFORMAT=192 193 | DATABASE=193 194 | DATABASES=194 195 | DFS=195 196 | TRUNCATE=196 197 | ANALYZE=197 198 | COMPUTE=198 199 | LIST=199 200 | STATISTICS=200 201 | PARTITIONED=201 202 | EXTERNAL=202 203 | DEFINED=203 204 | REVOKE=204 205 | GRANT=205 206 | LOCK=206 207 | UNLOCK=207 208 | MSCK=208 209 | REPAIR=209 210 | RECOVER=210 211 | EXPORT=211 212 | IMPORT=212 213 | LOAD=213 214 | ROLE=214 215 | ROLES=215 216 | COMPACTIONS=216 217 | PRINCIPALS=217 218 | TRANSACTIONS=218 219 | INDEX=219 220 | INDEXES=220 221 | LOCKS=221 222 | OPTION=222 223 | ANTI=223 224 | LOCAL=224 225 | INPATH=225 226 | CURRENT_DATE=226 227 | CURRENT_TIMESTAMP=227 228 | STRING=228 229 | BIGINT_LITERAL=229 230 | SMALLINT_LITERAL=230 231 | TINYINT_LITERAL=231 232 | BYTELENGTH_LITERAL=232 233 | INTEGER_VALUE=233 234 | DECIMAL_VALUE=234 235 | DOUBLE_LITERAL=235 236 | BIGDECIMAL_LITERAL=236 237 | IDENTIFIER=237 238 | BACKQUOTED_IDENTIFIER=238 239 | SIMPLE_COMMENT=239 240 | BRACKETED_COMMENT=240 241 | WS=241 242 | UNRECOGNIZED=242 243 | DELIMITER=243 244 | '('=1 245 | ')'=2 246 | ','=3 247 | '.'=4 248 | '['=5 249 | ']'=6 250 | ':'=7 251 | 'SELECT'=8 252 | 'FROM'=9 253 | 'ADD'=10 254 | 'AS'=11 255 | 'ALL'=12 256 | 'DISTINCT'=13 257 | 'WHERE'=14 258 | 'GROUP'=15 259 | 'BY'=16 260 | 'GROUPING'=17 261 | 'SETS'=18 262 | 'CUBE'=19 263 | 'ROLLUP'=20 264 | 'ORDER'=21 265 | 'HAVING'=22 266 | 'LIMIT'=23 267 | 'AT'=24 268 | 'OR'=25 269 | 'AND'=26 270 | 'IN'=27 271 | 'NO'=29 272 | 'EXISTS'=30 273 | 'BETWEEN'=31 274 | 'LIKE'=32 275 | 'IS'=34 276 | 'NULL'=35 277 | 'TRUE'=36 278 | 'FALSE'=37 279 | 'NULLS'=38 280 | 'ASC'=39 281 | 'DESC'=40 282 | 'FOR'=41 283 | 'INTERVAL'=42 284 | 'CASE'=43 285 | 'WHEN'=44 286 | 'THEN'=45 287 | 'ELSE'=46 288 | 'END'=47 289 | 'JOIN'=48 290 | 'CROSS'=49 291 | 'OUTER'=50 292 | 'INNER'=51 293 | 'LEFT'=52 294 | 'SEMI'=53 295 | 'RIGHT'=54 296 | 'FULL'=55 297 | 'NATURAL'=56 298 | 'ON'=57 299 | 'LATERAL'=58 300 | 'WINDOW'=59 301 | 'OVER'=60 302 | 'PARTITION'=61 303 | 'RANGE'=62 304 | 'ROWS'=63 305 | 'UNBOUNDED'=64 306 | 'PRECEDING'=65 307 | 'FOLLOWING'=66 308 | 'CURRENT'=67 309 | 'FIRST'=68 310 | 'LAST'=69 311 | 'ROW'=70 312 | 'WITH'=71 313 | 'VALUES'=72 314 | 'CREATE'=73 315 | 'TABLE'=74 316 | 'VIEW'=75 317 | 'REPLACE'=76 318 | 'INSERT'=77 319 | 'DELETE'=78 320 | 'INTO'=79 321 | 'DESCRIBE'=80 322 | 'EXPLAIN'=81 323 | 'FORMAT'=82 324 | 'LOGICAL'=83 325 | 'CODEGEN'=84 326 | 'CAST'=85 327 | 'SHOW'=86 328 | 'TABLES'=87 329 | 'COLUMNS'=88 330 | 'COLUMN'=89 331 | 'USE'=90 332 | 'PARTITIONS'=91 333 | 'FUNCTIONS'=92 334 | 'DROP'=93 335 | 'UNION'=94 336 | 'EXCEPT'=95 337 | 'MINUS'=96 338 | 'INTERSECT'=97 339 | 'TO'=98 340 | 'TABLESAMPLE'=99 341 | 'STRATIFY'=100 342 | 'ALTER'=101 343 | 'RENAME'=102 344 | 'ARRAY'=103 345 | 'MAP'=104 346 | 'STRUCT'=105 347 | 'COMMENT'=106 348 | 'SET'=107 349 | 'RESET'=108 350 | 'DATA'=109 351 | 'START'=110 352 | 'TRANSACTION'=111 353 | 'COMMIT'=112 354 | 'ROLLBACK'=113 355 | 'MACRO'=114 356 | 'IF'=115 357 | '<=>'=117 358 | '<>'=118 359 | '!='=119 360 | '<'=120 361 | '>'=122 362 | '+'=124 363 | '-'=125 364 | '*'=126 365 | '%'=128 366 | 'DIV'=129 367 | '~'=130 368 | '&'=131 369 | '|'=132 370 | '^'=133 371 | '>>'=134 372 | 'PERCENT'=135 373 | 'BUCKET'=136 374 | 'OUT'=137 375 | 'OF'=138 376 | 'SORT'=139 377 | 'CLUSTER'=140 378 | 'DISTRIBUTE'=141 379 | 'OVERWRITE'=142 380 | 'TRANSFORM'=143 381 | 'REDUCE'=144 382 | 'USING'=145 383 | 'SERDE'=146 384 | 'SERDEPROPERTIES'=147 385 | 'RECORDREADER'=148 386 | 'RECORDWRITER'=149 387 | 'DELIMITED'=150 388 | 'FIELDS'=151 389 | 'TERMINATED'=152 390 | 'COLLECTION'=153 391 | 'ITEMS'=154 392 | 'KEYS'=155 393 | 'ESCAPED'=156 394 | 'LINES'=157 395 | 'SEPARATED'=158 396 | 'FUNCTION'=159 397 | 'EXTENDED'=160 398 | 'REFRESH'=161 399 | 'CLEAR'=162 400 | 'CACHE'=163 401 | 'UNCACHE'=164 402 | 'LAZY'=165 403 | 'FORMATTED'=166 404 | 'GLOBAL'=167 405 | 'OPTIONS'=169 406 | 'UNSET'=170 407 | 'TBLPROPERTIES'=171 408 | 'DBPROPERTIES'=172 409 | 'BUCKETS'=173 410 | 'SKEWED'=174 411 | 'STORED'=175 412 | 'DIRECTORIES'=176 413 | 'LOCATION'=177 414 | 'EXCHANGE'=178 415 | 'ARCHIVE'=179 416 | 'UNARCHIVE'=180 417 | 'FILEFORMAT'=181 418 | 'TOUCH'=182 419 | 'COMPACT'=183 420 | 'CONCATENATE'=184 421 | 'CHANGE'=185 422 | 'CASCADE'=186 423 | 'RESTRICT'=187 424 | 'CLUSTERED'=188 425 | 'SORTED'=189 426 | 'PURGE'=190 427 | 'INPUTFORMAT'=191 428 | 'OUTPUTFORMAT'=192 429 | 'DFS'=195 430 | 'TRUNCATE'=196 431 | 'ANALYZE'=197 432 | 'COMPUTE'=198 433 | 'LIST'=199 434 | 'STATISTICS'=200 435 | 'PARTITIONED'=201 436 | 'EXTERNAL'=202 437 | 'DEFINED'=203 438 | 'REVOKE'=204 439 | 'GRANT'=205 440 | 'LOCK'=206 441 | 'UNLOCK'=207 442 | 'MSCK'=208 443 | 'REPAIR'=209 444 | 'RECOVER'=210 445 | 'EXPORT'=211 446 | 'IMPORT'=212 447 | 'LOAD'=213 448 | 'ROLE'=214 449 | 'ROLES'=215 450 | 'COMPACTIONS'=216 451 | 'PRINCIPALS'=217 452 | 'TRANSACTIONS'=218 453 | 'INDEX'=219 454 | 'INDEXES'=220 455 | 'LOCKS'=221 456 | 'OPTION'=222 457 | 'ANTI'=223 458 | 'LOCAL'=224 459 | 'INPATH'=225 460 | 'CURRENT_DATE'=226 461 | 'CURRENT_TIMESTAMP'=227 462 | -------------------------------------------------------------------------------- /gen/com/tencent/SqlBaseBaseVisitor.java: -------------------------------------------------------------------------------- 1 | // Generated from D:/Development/AntlrTest/src\SqlBase.g4 by ANTLR 4.5.3 2 | package com.tencent; 3 | import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; 4 | 5 | /** 6 | * This class provides an empty implementation of {@link SqlBaseVisitor}, 7 | * which can be extended to create a visitor which only needs to handle a subset 8 | * of the available methods. 9 | * 10 | * @param The return type of the visit operation. Use {@link Void} for 11 | * operations with no return type. 12 | */ 13 | public class SqlBaseBaseVisitor extends AbstractParseTreeVisitor implements SqlBaseVisitor { 14 | /** 15 | * {@inheritDoc} 16 | * 17 | *

The default implementation returns the result of calling 18 | * {@link #visitChildren} on {@code ctx}.

19 | */ 20 | @Override public T visitSingleStatement(SqlBaseParser.SingleStatementContext ctx) { return visitChildren(ctx); } 21 | /** 22 | * {@inheritDoc} 23 | * 24 | *

The default implementation returns the result of calling 25 | * {@link #visitChildren} on {@code ctx}.

26 | */ 27 | @Override public T visitSingleExpression(SqlBaseParser.SingleExpressionContext ctx) { return visitChildren(ctx); } 28 | /** 29 | * {@inheritDoc} 30 | * 31 | *

The default implementation returns the result of calling 32 | * {@link #visitChildren} on {@code ctx}.

33 | */ 34 | @Override public T visitSingleTableIdentifier(SqlBaseParser.SingleTableIdentifierContext ctx) { return visitChildren(ctx); } 35 | /** 36 | * {@inheritDoc} 37 | * 38 | *

The default implementation returns the result of calling 39 | * {@link #visitChildren} on {@code ctx}.

40 | */ 41 | @Override public T visitSingleDataType(SqlBaseParser.SingleDataTypeContext ctx) { return visitChildren(ctx); } 42 | /** 43 | * {@inheritDoc} 44 | * 45 | *

The default implementation returns the result of calling 46 | * {@link #visitChildren} on {@code ctx}.

47 | */ 48 | @Override public T visitStatementDefault(SqlBaseParser.StatementDefaultContext ctx) { return visitChildren(ctx); } 49 | /** 50 | * {@inheritDoc} 51 | * 52 | *

The default implementation returns the result of calling 53 | * {@link #visitChildren} on {@code ctx}.

54 | */ 55 | @Override public T visitUse(SqlBaseParser.UseContext ctx) { return visitChildren(ctx); } 56 | /** 57 | * {@inheritDoc} 58 | * 59 | *

The default implementation returns the result of calling 60 | * {@link #visitChildren} on {@code ctx}.

61 | */ 62 | @Override public T visitCreateDatabase(SqlBaseParser.CreateDatabaseContext ctx) { return visitChildren(ctx); } 63 | /** 64 | * {@inheritDoc} 65 | * 66 | *

The default implementation returns the result of calling 67 | * {@link #visitChildren} on {@code ctx}.

68 | */ 69 | @Override public T visitSetDatabaseProperties(SqlBaseParser.SetDatabasePropertiesContext ctx) { return visitChildren(ctx); } 70 | /** 71 | * {@inheritDoc} 72 | * 73 | *

The default implementation returns the result of calling 74 | * {@link #visitChildren} on {@code ctx}.

75 | */ 76 | @Override public T visitDropDatabase(SqlBaseParser.DropDatabaseContext ctx) { return visitChildren(ctx); } 77 | /** 78 | * {@inheritDoc} 79 | * 80 | *

The default implementation returns the result of calling 81 | * {@link #visitChildren} on {@code ctx}.

82 | */ 83 | @Override public T visitCreateTableUsing(SqlBaseParser.CreateTableUsingContext ctx) { return visitChildren(ctx); } 84 | /** 85 | * {@inheritDoc} 86 | * 87 | *

The default implementation returns the result of calling 88 | * {@link #visitChildren} on {@code ctx}.

89 | */ 90 | @Override public T visitCreateTable(SqlBaseParser.CreateTableContext ctx) { return visitChildren(ctx); } 91 | /** 92 | * {@inheritDoc} 93 | * 94 | *

The default implementation returns the result of calling 95 | * {@link #visitChildren} on {@code ctx}.

96 | */ 97 | @Override public T visitCreateTableLike(SqlBaseParser.CreateTableLikeContext ctx) { return visitChildren(ctx); } 98 | /** 99 | * {@inheritDoc} 100 | * 101 | *

The default implementation returns the result of calling 102 | * {@link #visitChildren} on {@code ctx}.

103 | */ 104 | @Override public T visitAnalyze(SqlBaseParser.AnalyzeContext ctx) { return visitChildren(ctx); } 105 | /** 106 | * {@inheritDoc} 107 | * 108 | *

The default implementation returns the result of calling 109 | * {@link #visitChildren} on {@code ctx}.

110 | */ 111 | @Override public T visitRenameTable(SqlBaseParser.RenameTableContext ctx) { return visitChildren(ctx); } 112 | /** 113 | * {@inheritDoc} 114 | * 115 | *

The default implementation returns the result of calling 116 | * {@link #visitChildren} on {@code ctx}.

117 | */ 118 | @Override public T visitSetTableProperties(SqlBaseParser.SetTablePropertiesContext ctx) { return visitChildren(ctx); } 119 | /** 120 | * {@inheritDoc} 121 | * 122 | *

The default implementation returns the result of calling 123 | * {@link #visitChildren} on {@code ctx}.

124 | */ 125 | @Override public T visitUnsetTableProperties(SqlBaseParser.UnsetTablePropertiesContext ctx) { return visitChildren(ctx); } 126 | /** 127 | * {@inheritDoc} 128 | * 129 | *

The default implementation returns the result of calling 130 | * {@link #visitChildren} on {@code ctx}.

131 | */ 132 | @Override public T visitSetTableSerDe(SqlBaseParser.SetTableSerDeContext ctx) { return visitChildren(ctx); } 133 | /** 134 | * {@inheritDoc} 135 | * 136 | *

The default implementation returns the result of calling 137 | * {@link #visitChildren} on {@code ctx}.

138 | */ 139 | @Override public T visitAddTablePartition(SqlBaseParser.AddTablePartitionContext ctx) { return visitChildren(ctx); } 140 | /** 141 | * {@inheritDoc} 142 | * 143 | *

The default implementation returns the result of calling 144 | * {@link #visitChildren} on {@code ctx}.

145 | */ 146 | @Override public T visitRenameTablePartition(SqlBaseParser.RenameTablePartitionContext ctx) { return visitChildren(ctx); } 147 | /** 148 | * {@inheritDoc} 149 | * 150 | *

The default implementation returns the result of calling 151 | * {@link #visitChildren} on {@code ctx}.

152 | */ 153 | @Override public T visitDropTablePartitions(SqlBaseParser.DropTablePartitionsContext ctx) { return visitChildren(ctx); } 154 | /** 155 | * {@inheritDoc} 156 | * 157 | *

The default implementation returns the result of calling 158 | * {@link #visitChildren} on {@code ctx}.

159 | */ 160 | @Override public T visitSetTableLocation(SqlBaseParser.SetTableLocationContext ctx) { return visitChildren(ctx); } 161 | /** 162 | * {@inheritDoc} 163 | * 164 | *

The default implementation returns the result of calling 165 | * {@link #visitChildren} on {@code ctx}.

166 | */ 167 | @Override public T visitRecoverPartitions(SqlBaseParser.RecoverPartitionsContext ctx) { return visitChildren(ctx); } 168 | /** 169 | * {@inheritDoc} 170 | * 171 | *

The default implementation returns the result of calling 172 | * {@link #visitChildren} on {@code ctx}.

173 | */ 174 | @Override public T visitDropTable(SqlBaseParser.DropTableContext ctx) { return visitChildren(ctx); } 175 | /** 176 | * {@inheritDoc} 177 | * 178 | *

The default implementation returns the result of calling 179 | * {@link #visitChildren} on {@code ctx}.

180 | */ 181 | @Override public T visitCreateView(SqlBaseParser.CreateViewContext ctx) { return visitChildren(ctx); } 182 | /** 183 | * {@inheritDoc} 184 | * 185 | *

The default implementation returns the result of calling 186 | * {@link #visitChildren} on {@code ctx}.

187 | */ 188 | @Override public T visitCreateTempViewUsing(SqlBaseParser.CreateTempViewUsingContext ctx) { return visitChildren(ctx); } 189 | /** 190 | * {@inheritDoc} 191 | * 192 | *

The default implementation returns the result of calling 193 | * {@link #visitChildren} on {@code ctx}.

194 | */ 195 | @Override public T visitAlterViewQuery(SqlBaseParser.AlterViewQueryContext ctx) { return visitChildren(ctx); } 196 | /** 197 | * {@inheritDoc} 198 | * 199 | *

The default implementation returns the result of calling 200 | * {@link #visitChildren} on {@code ctx}.

201 | */ 202 | @Override public T visitCreateFunction(SqlBaseParser.CreateFunctionContext ctx) { return visitChildren(ctx); } 203 | /** 204 | * {@inheritDoc} 205 | * 206 | *

The default implementation returns the result of calling 207 | * {@link #visitChildren} on {@code ctx}.

208 | */ 209 | @Override public T visitDropFunction(SqlBaseParser.DropFunctionContext ctx) { return visitChildren(ctx); } 210 | /** 211 | * {@inheritDoc} 212 | * 213 | *

The default implementation returns the result of calling 214 | * {@link #visitChildren} on {@code ctx}.

215 | */ 216 | @Override public T visitExplain(SqlBaseParser.ExplainContext ctx) { return visitChildren(ctx); } 217 | /** 218 | * {@inheritDoc} 219 | * 220 | *

The default implementation returns the result of calling 221 | * {@link #visitChildren} on {@code ctx}.

222 | */ 223 | @Override public T visitShowTables(SqlBaseParser.ShowTablesContext ctx) { return visitChildren(ctx); } 224 | /** 225 | * {@inheritDoc} 226 | * 227 | *

The default implementation returns the result of calling 228 | * {@link #visitChildren} on {@code ctx}.

229 | */ 230 | @Override public T visitShowDatabases(SqlBaseParser.ShowDatabasesContext ctx) { return visitChildren(ctx); } 231 | /** 232 | * {@inheritDoc} 233 | * 234 | *

The default implementation returns the result of calling 235 | * {@link #visitChildren} on {@code ctx}.

236 | */ 237 | @Override public T visitShowTblProperties(SqlBaseParser.ShowTblPropertiesContext ctx) { return visitChildren(ctx); } 238 | /** 239 | * {@inheritDoc} 240 | * 241 | *

The default implementation returns the result of calling 242 | * {@link #visitChildren} on {@code ctx}.

243 | */ 244 | @Override public T visitShowColumns(SqlBaseParser.ShowColumnsContext ctx) { return visitChildren(ctx); } 245 | /** 246 | * {@inheritDoc} 247 | * 248 | *

The default implementation returns the result of calling 249 | * {@link #visitChildren} on {@code ctx}.

250 | */ 251 | @Override public T visitShowPartitions(SqlBaseParser.ShowPartitionsContext ctx) { return visitChildren(ctx); } 252 | /** 253 | * {@inheritDoc} 254 | * 255 | *

The default implementation returns the result of calling 256 | * {@link #visitChildren} on {@code ctx}.

257 | */ 258 | @Override public T visitShowFunctions(SqlBaseParser.ShowFunctionsContext ctx) { return visitChildren(ctx); } 259 | /** 260 | * {@inheritDoc} 261 | * 262 | *

The default implementation returns the result of calling 263 | * {@link #visitChildren} on {@code ctx}.

264 | */ 265 | @Override public T visitShowCreateTable(SqlBaseParser.ShowCreateTableContext ctx) { return visitChildren(ctx); } 266 | /** 267 | * {@inheritDoc} 268 | * 269 | *

The default implementation returns the result of calling 270 | * {@link #visitChildren} on {@code ctx}.

271 | */ 272 | @Override public T visitDescribeFunction(SqlBaseParser.DescribeFunctionContext ctx) { return visitChildren(ctx); } 273 | /** 274 | * {@inheritDoc} 275 | * 276 | *

The default implementation returns the result of calling 277 | * {@link #visitChildren} on {@code ctx}.

278 | */ 279 | @Override public T visitDescribeDatabase(SqlBaseParser.DescribeDatabaseContext ctx) { return visitChildren(ctx); } 280 | /** 281 | * {@inheritDoc} 282 | * 283 | *

The default implementation returns the result of calling 284 | * {@link #visitChildren} on {@code ctx}.

285 | */ 286 | @Override public T visitDescribeTable(SqlBaseParser.DescribeTableContext ctx) { return visitChildren(ctx); } 287 | /** 288 | * {@inheritDoc} 289 | * 290 | *

The default implementation returns the result of calling 291 | * {@link #visitChildren} on {@code ctx}.

292 | */ 293 | @Override public T visitRefreshTable(SqlBaseParser.RefreshTableContext ctx) { return visitChildren(ctx); } 294 | /** 295 | * {@inheritDoc} 296 | * 297 | *

The default implementation returns the result of calling 298 | * {@link #visitChildren} on {@code ctx}.

299 | */ 300 | @Override public T visitRefreshResource(SqlBaseParser.RefreshResourceContext ctx) { return visitChildren(ctx); } 301 | /** 302 | * {@inheritDoc} 303 | * 304 | *

The default implementation returns the result of calling 305 | * {@link #visitChildren} on {@code ctx}.

306 | */ 307 | @Override public T visitCacheTable(SqlBaseParser.CacheTableContext ctx) { return visitChildren(ctx); } 308 | /** 309 | * {@inheritDoc} 310 | * 311 | *

The default implementation returns the result of calling 312 | * {@link #visitChildren} on {@code ctx}.

313 | */ 314 | @Override public T visitUncacheTable(SqlBaseParser.UncacheTableContext ctx) { return visitChildren(ctx); } 315 | /** 316 | * {@inheritDoc} 317 | * 318 | *

The default implementation returns the result of calling 319 | * {@link #visitChildren} on {@code ctx}.

320 | */ 321 | @Override public T visitClearCache(SqlBaseParser.ClearCacheContext ctx) { return visitChildren(ctx); } 322 | /** 323 | * {@inheritDoc} 324 | * 325 | *

The default implementation returns the result of calling 326 | * {@link #visitChildren} on {@code ctx}.

327 | */ 328 | @Override public T visitLoadData(SqlBaseParser.LoadDataContext ctx) { return visitChildren(ctx); } 329 | /** 330 | * {@inheritDoc} 331 | * 332 | *

The default implementation returns the result of calling 333 | * {@link #visitChildren} on {@code ctx}.

334 | */ 335 | @Override public T visitTruncateTable(SqlBaseParser.TruncateTableContext ctx) { return visitChildren(ctx); } 336 | /** 337 | * {@inheritDoc} 338 | * 339 | *

The default implementation returns the result of calling 340 | * {@link #visitChildren} on {@code ctx}.

341 | */ 342 | @Override public T visitRepairTable(SqlBaseParser.RepairTableContext ctx) { return visitChildren(ctx); } 343 | /** 344 | * {@inheritDoc} 345 | * 346 | *

The default implementation returns the result of calling 347 | * {@link #visitChildren} on {@code ctx}.

348 | */ 349 | @Override public T visitManageResource(SqlBaseParser.ManageResourceContext ctx) { return visitChildren(ctx); } 350 | /** 351 | * {@inheritDoc} 352 | * 353 | *

The default implementation returns the result of calling 354 | * {@link #visitChildren} on {@code ctx}.

355 | */ 356 | @Override public T visitFailNativeCommand(SqlBaseParser.FailNativeCommandContext ctx) { return visitChildren(ctx); } 357 | /** 358 | * {@inheritDoc} 359 | * 360 | *

The default implementation returns the result of calling 361 | * {@link #visitChildren} on {@code ctx}.

362 | */ 363 | @Override public T visitSetConfiguration(SqlBaseParser.SetConfigurationContext ctx) { return visitChildren(ctx); } 364 | /** 365 | * {@inheritDoc} 366 | * 367 | *

The default implementation returns the result of calling 368 | * {@link #visitChildren} on {@code ctx}.

369 | */ 370 | @Override public T visitResetConfiguration(SqlBaseParser.ResetConfigurationContext ctx) { return visitChildren(ctx); } 371 | /** 372 | * {@inheritDoc} 373 | * 374 | *

The default implementation returns the result of calling 375 | * {@link #visitChildren} on {@code ctx}.

376 | */ 377 | @Override public T visitUnsupportedHiveNativeCommands(SqlBaseParser.UnsupportedHiveNativeCommandsContext ctx) { return visitChildren(ctx); } 378 | /** 379 | * {@inheritDoc} 380 | * 381 | *

The default implementation returns the result of calling 382 | * {@link #visitChildren} on {@code ctx}.

383 | */ 384 | @Override public T visitCreateTableHeader(SqlBaseParser.CreateTableHeaderContext ctx) { return visitChildren(ctx); } 385 | /** 386 | * {@inheritDoc} 387 | * 388 | *

The default implementation returns the result of calling 389 | * {@link #visitChildren} on {@code ctx}.

390 | */ 391 | @Override public T visitBucketSpec(SqlBaseParser.BucketSpecContext ctx) { return visitChildren(ctx); } 392 | /** 393 | * {@inheritDoc} 394 | * 395 | *

The default implementation returns the result of calling 396 | * {@link #visitChildren} on {@code ctx}.

397 | */ 398 | @Override public T visitSkewSpec(SqlBaseParser.SkewSpecContext ctx) { return visitChildren(ctx); } 399 | /** 400 | * {@inheritDoc} 401 | * 402 | *

The default implementation returns the result of calling 403 | * {@link #visitChildren} on {@code ctx}.

404 | */ 405 | @Override public T visitLocationSpec(SqlBaseParser.LocationSpecContext ctx) { return visitChildren(ctx); } 406 | /** 407 | * {@inheritDoc} 408 | * 409 | *

The default implementation returns the result of calling 410 | * {@link #visitChildren} on {@code ctx}.

411 | */ 412 | @Override public T visitQuery(SqlBaseParser.QueryContext ctx) { return visitChildren(ctx); } 413 | /** 414 | * {@inheritDoc} 415 | * 416 | *

The default implementation returns the result of calling 417 | * {@link #visitChildren} on {@code ctx}.

418 | */ 419 | @Override public T visitInsertInto(SqlBaseParser.InsertIntoContext ctx) { return visitChildren(ctx); } 420 | /** 421 | * {@inheritDoc} 422 | * 423 | *

The default implementation returns the result of calling 424 | * {@link #visitChildren} on {@code ctx}.

425 | */ 426 | @Override public T visitPartitionSpecLocation(SqlBaseParser.PartitionSpecLocationContext ctx) { return visitChildren(ctx); } 427 | /** 428 | * {@inheritDoc} 429 | * 430 | *

The default implementation returns the result of calling 431 | * {@link #visitChildren} on {@code ctx}.

432 | */ 433 | @Override public T visitPartitionSpec(SqlBaseParser.PartitionSpecContext ctx) { return visitChildren(ctx); } 434 | /** 435 | * {@inheritDoc} 436 | * 437 | *

The default implementation returns the result of calling 438 | * {@link #visitChildren} on {@code ctx}.

439 | */ 440 | @Override public T visitPartitionVal(SqlBaseParser.PartitionValContext ctx) { return visitChildren(ctx); } 441 | /** 442 | * {@inheritDoc} 443 | * 444 | *

The default implementation returns the result of calling 445 | * {@link #visitChildren} on {@code ctx}.

446 | */ 447 | @Override public T visitDescribeFuncName(SqlBaseParser.DescribeFuncNameContext ctx) { return visitChildren(ctx); } 448 | /** 449 | * {@inheritDoc} 450 | * 451 | *

The default implementation returns the result of calling 452 | * {@link #visitChildren} on {@code ctx}.

453 | */ 454 | @Override public T visitDescribeColName(SqlBaseParser.DescribeColNameContext ctx) { return visitChildren(ctx); } 455 | /** 456 | * {@inheritDoc} 457 | * 458 | *

The default implementation returns the result of calling 459 | * {@link #visitChildren} on {@code ctx}.

460 | */ 461 | @Override public T visitCtes(SqlBaseParser.CtesContext ctx) { return visitChildren(ctx); } 462 | /** 463 | * {@inheritDoc} 464 | * 465 | *

The default implementation returns the result of calling 466 | * {@link #visitChildren} on {@code ctx}.

467 | */ 468 | @Override public T visitNamedQuery(SqlBaseParser.NamedQueryContext ctx) { return visitChildren(ctx); } 469 | /** 470 | * {@inheritDoc} 471 | * 472 | *

The default implementation returns the result of calling 473 | * {@link #visitChildren} on {@code ctx}.

474 | */ 475 | @Override public T visitTableProvider(SqlBaseParser.TableProviderContext ctx) { return visitChildren(ctx); } 476 | /** 477 | * {@inheritDoc} 478 | * 479 | *

The default implementation returns the result of calling 480 | * {@link #visitChildren} on {@code ctx}.

481 | */ 482 | @Override public T visitTablePropertyList(SqlBaseParser.TablePropertyListContext ctx) { return visitChildren(ctx); } 483 | /** 484 | * {@inheritDoc} 485 | * 486 | *

The default implementation returns the result of calling 487 | * {@link #visitChildren} on {@code ctx}.

488 | */ 489 | @Override public T visitTableProperty(SqlBaseParser.TablePropertyContext ctx) { return visitChildren(ctx); } 490 | /** 491 | * {@inheritDoc} 492 | * 493 | *

The default implementation returns the result of calling 494 | * {@link #visitChildren} on {@code ctx}.

495 | */ 496 | @Override public T visitTablePropertyKey(SqlBaseParser.TablePropertyKeyContext ctx) { return visitChildren(ctx); } 497 | /** 498 | * {@inheritDoc} 499 | * 500 | *

The default implementation returns the result of calling 501 | * {@link #visitChildren} on {@code ctx}.

502 | */ 503 | @Override public T visitTablePropertyValue(SqlBaseParser.TablePropertyValueContext ctx) { return visitChildren(ctx); } 504 | /** 505 | * {@inheritDoc} 506 | * 507 | *

The default implementation returns the result of calling 508 | * {@link #visitChildren} on {@code ctx}.

509 | */ 510 | @Override public T visitConstantList(SqlBaseParser.ConstantListContext ctx) { return visitChildren(ctx); } 511 | /** 512 | * {@inheritDoc} 513 | * 514 | *

The default implementation returns the result of calling 515 | * {@link #visitChildren} on {@code ctx}.

516 | */ 517 | @Override public T visitNestedConstantList(SqlBaseParser.NestedConstantListContext ctx) { return visitChildren(ctx); } 518 | /** 519 | * {@inheritDoc} 520 | * 521 | *

The default implementation returns the result of calling 522 | * {@link #visitChildren} on {@code ctx}.

523 | */ 524 | @Override public T visitCreateFileFormat(SqlBaseParser.CreateFileFormatContext ctx) { return visitChildren(ctx); } 525 | /** 526 | * {@inheritDoc} 527 | * 528 | *

The default implementation returns the result of calling 529 | * {@link #visitChildren} on {@code ctx}.

530 | */ 531 | @Override public T visitTableFileFormat(SqlBaseParser.TableFileFormatContext ctx) { return visitChildren(ctx); } 532 | /** 533 | * {@inheritDoc} 534 | * 535 | *

The default implementation returns the result of calling 536 | * {@link #visitChildren} on {@code ctx}.

537 | */ 538 | @Override public T visitGenericFileFormat(SqlBaseParser.GenericFileFormatContext ctx) { return visitChildren(ctx); } 539 | /** 540 | * {@inheritDoc} 541 | * 542 | *

The default implementation returns the result of calling 543 | * {@link #visitChildren} on {@code ctx}.

544 | */ 545 | @Override public T visitStorageHandler(SqlBaseParser.StorageHandlerContext ctx) { return visitChildren(ctx); } 546 | /** 547 | * {@inheritDoc} 548 | * 549 | *

The default implementation returns the result of calling 550 | * {@link #visitChildren} on {@code ctx}.

551 | */ 552 | @Override public T visitResource(SqlBaseParser.ResourceContext ctx) { return visitChildren(ctx); } 553 | /** 554 | * {@inheritDoc} 555 | * 556 | *

The default implementation returns the result of calling 557 | * {@link #visitChildren} on {@code ctx}.

558 | */ 559 | @Override public T visitSingleInsertQuery(SqlBaseParser.SingleInsertQueryContext ctx) { return visitChildren(ctx); } 560 | /** 561 | * {@inheritDoc} 562 | * 563 | *

The default implementation returns the result of calling 564 | * {@link #visitChildren} on {@code ctx}.

565 | */ 566 | @Override public T visitMultiInsertQuery(SqlBaseParser.MultiInsertQueryContext ctx) { return visitChildren(ctx); } 567 | /** 568 | * {@inheritDoc} 569 | * 570 | *

The default implementation returns the result of calling 571 | * {@link #visitChildren} on {@code ctx}.

572 | */ 573 | @Override public T visitQueryOrganization(SqlBaseParser.QueryOrganizationContext ctx) { return visitChildren(ctx); } 574 | /** 575 | * {@inheritDoc} 576 | * 577 | *

The default implementation returns the result of calling 578 | * {@link #visitChildren} on {@code ctx}.

579 | */ 580 | @Override public T visitMultiInsertQueryBody(SqlBaseParser.MultiInsertQueryBodyContext ctx) { return visitChildren(ctx); } 581 | /** 582 | * {@inheritDoc} 583 | * 584 | *

The default implementation returns the result of calling 585 | * {@link #visitChildren} on {@code ctx}.

586 | */ 587 | @Override public T visitQueryTermDefault(SqlBaseParser.QueryTermDefaultContext ctx) { return visitChildren(ctx); } 588 | /** 589 | * {@inheritDoc} 590 | * 591 | *

The default implementation returns the result of calling 592 | * {@link #visitChildren} on {@code ctx}.

593 | */ 594 | @Override public T visitSetOperation(SqlBaseParser.SetOperationContext ctx) { return visitChildren(ctx); } 595 | /** 596 | * {@inheritDoc} 597 | * 598 | *

The default implementation returns the result of calling 599 | * {@link #visitChildren} on {@code ctx}.

600 | */ 601 | @Override public T visitQueryPrimaryDefault(SqlBaseParser.QueryPrimaryDefaultContext ctx) { return visitChildren(ctx); } 602 | /** 603 | * {@inheritDoc} 604 | * 605 | *

The default implementation returns the result of calling 606 | * {@link #visitChildren} on {@code ctx}.

607 | */ 608 | @Override public T visitTable(SqlBaseParser.TableContext ctx) { return visitChildren(ctx); } 609 | /** 610 | * {@inheritDoc} 611 | * 612 | *

The default implementation returns the result of calling 613 | * {@link #visitChildren} on {@code ctx}.

614 | */ 615 | @Override public T visitInlineTableDefault1(SqlBaseParser.InlineTableDefault1Context ctx) { return visitChildren(ctx); } 616 | /** 617 | * {@inheritDoc} 618 | * 619 | *

The default implementation returns the result of calling 620 | * {@link #visitChildren} on {@code ctx}.

621 | */ 622 | @Override public T visitSubquery(SqlBaseParser.SubqueryContext ctx) { return visitChildren(ctx); } 623 | /** 624 | * {@inheritDoc} 625 | * 626 | *

The default implementation returns the result of calling 627 | * {@link #visitChildren} on {@code ctx}.

628 | */ 629 | @Override public T visitSortItem(SqlBaseParser.SortItemContext ctx) { return visitChildren(ctx); } 630 | /** 631 | * {@inheritDoc} 632 | * 633 | *

The default implementation returns the result of calling 634 | * {@link #visitChildren} on {@code ctx}.

635 | */ 636 | @Override public T visitQuerySpecification(SqlBaseParser.QuerySpecificationContext ctx) { return visitChildren(ctx); } 637 | /** 638 | * {@inheritDoc} 639 | * 640 | *

The default implementation returns the result of calling 641 | * {@link #visitChildren} on {@code ctx}.

642 | */ 643 | @Override public T visitFromClause(SqlBaseParser.FromClauseContext ctx) { return visitChildren(ctx); } 644 | /** 645 | * {@inheritDoc} 646 | * 647 | *

The default implementation returns the result of calling 648 | * {@link #visitChildren} on {@code ctx}.

649 | */ 650 | @Override public T visitAggregation(SqlBaseParser.AggregationContext ctx) { return visitChildren(ctx); } 651 | /** 652 | * {@inheritDoc} 653 | * 654 | *

The default implementation returns the result of calling 655 | * {@link #visitChildren} on {@code ctx}.

656 | */ 657 | @Override public T visitGroupingSet(SqlBaseParser.GroupingSetContext ctx) { return visitChildren(ctx); } 658 | /** 659 | * {@inheritDoc} 660 | * 661 | *

The default implementation returns the result of calling 662 | * {@link #visitChildren} on {@code ctx}.

663 | */ 664 | @Override public T visitLateralView(SqlBaseParser.LateralViewContext ctx) { return visitChildren(ctx); } 665 | /** 666 | * {@inheritDoc} 667 | * 668 | *

The default implementation returns the result of calling 669 | * {@link #visitChildren} on {@code ctx}.

670 | */ 671 | @Override public T visitSetQuantifier(SqlBaseParser.SetQuantifierContext ctx) { return visitChildren(ctx); } 672 | /** 673 | * {@inheritDoc} 674 | * 675 | *

The default implementation returns the result of calling 676 | * {@link #visitChildren} on {@code ctx}.

677 | */ 678 | @Override public T visitRelation(SqlBaseParser.RelationContext ctx) { return visitChildren(ctx); } 679 | /** 680 | * {@inheritDoc} 681 | * 682 | *

The default implementation returns the result of calling 683 | * {@link #visitChildren} on {@code ctx}.

684 | */ 685 | @Override public T visitJoinRelation(SqlBaseParser.JoinRelationContext ctx) { return visitChildren(ctx); } 686 | /** 687 | * {@inheritDoc} 688 | * 689 | *

The default implementation returns the result of calling 690 | * {@link #visitChildren} on {@code ctx}.

691 | */ 692 | @Override public T visitJoinType(SqlBaseParser.JoinTypeContext ctx) { return visitChildren(ctx); } 693 | /** 694 | * {@inheritDoc} 695 | * 696 | *

The default implementation returns the result of calling 697 | * {@link #visitChildren} on {@code ctx}.

698 | */ 699 | @Override public T visitJoinCriteria(SqlBaseParser.JoinCriteriaContext ctx) { return visitChildren(ctx); } 700 | /** 701 | * {@inheritDoc} 702 | * 703 | *

The default implementation returns the result of calling 704 | * {@link #visitChildren} on {@code ctx}.

705 | */ 706 | @Override public T visitSample(SqlBaseParser.SampleContext ctx) { return visitChildren(ctx); } 707 | /** 708 | * {@inheritDoc} 709 | * 710 | *

The default implementation returns the result of calling 711 | * {@link #visitChildren} on {@code ctx}.

712 | */ 713 | @Override public T visitIdentifierList(SqlBaseParser.IdentifierListContext ctx) { return visitChildren(ctx); } 714 | /** 715 | * {@inheritDoc} 716 | * 717 | *

The default implementation returns the result of calling 718 | * {@link #visitChildren} on {@code ctx}.

719 | */ 720 | @Override public T visitIdentifierSeq(SqlBaseParser.IdentifierSeqContext ctx) { return visitChildren(ctx); } 721 | /** 722 | * {@inheritDoc} 723 | * 724 | *

The default implementation returns the result of calling 725 | * {@link #visitChildren} on {@code ctx}.

726 | */ 727 | @Override public T visitOrderedIdentifierList(SqlBaseParser.OrderedIdentifierListContext ctx) { return visitChildren(ctx); } 728 | /** 729 | * {@inheritDoc} 730 | * 731 | *

The default implementation returns the result of calling 732 | * {@link #visitChildren} on {@code ctx}.

733 | */ 734 | @Override public T visitOrderedIdentifier(SqlBaseParser.OrderedIdentifierContext ctx) { return visitChildren(ctx); } 735 | /** 736 | * {@inheritDoc} 737 | * 738 | *

The default implementation returns the result of calling 739 | * {@link #visitChildren} on {@code ctx}.

740 | */ 741 | @Override public T visitIdentifierCommentList(SqlBaseParser.IdentifierCommentListContext ctx) { return visitChildren(ctx); } 742 | /** 743 | * {@inheritDoc} 744 | * 745 | *

The default implementation returns the result of calling 746 | * {@link #visitChildren} on {@code ctx}.

747 | */ 748 | @Override public T visitIdentifierComment(SqlBaseParser.IdentifierCommentContext ctx) { return visitChildren(ctx); } 749 | /** 750 | * {@inheritDoc} 751 | * 752 | *

The default implementation returns the result of calling 753 | * {@link #visitChildren} on {@code ctx}.

754 | */ 755 | @Override public T visitTableName(SqlBaseParser.TableNameContext ctx) { return visitChildren(ctx); } 756 | /** 757 | * {@inheritDoc} 758 | * 759 | *

The default implementation returns the result of calling 760 | * {@link #visitChildren} on {@code ctx}.

761 | */ 762 | @Override public T visitAliasedQuery(SqlBaseParser.AliasedQueryContext ctx) { return visitChildren(ctx); } 763 | /** 764 | * {@inheritDoc} 765 | * 766 | *

The default implementation returns the result of calling 767 | * {@link #visitChildren} on {@code ctx}.

768 | */ 769 | @Override public T visitAliasedRelation(SqlBaseParser.AliasedRelationContext ctx) { return visitChildren(ctx); } 770 | /** 771 | * {@inheritDoc} 772 | * 773 | *

The default implementation returns the result of calling 774 | * {@link #visitChildren} on {@code ctx}.

775 | */ 776 | @Override public T visitInlineTableDefault2(SqlBaseParser.InlineTableDefault2Context ctx) { return visitChildren(ctx); } 777 | /** 778 | * {@inheritDoc} 779 | * 780 | *

The default implementation returns the result of calling 781 | * {@link #visitChildren} on {@code ctx}.

782 | */ 783 | @Override public T visitTableValuedFunction(SqlBaseParser.TableValuedFunctionContext ctx) { return visitChildren(ctx); } 784 | /** 785 | * {@inheritDoc} 786 | * 787 | *

The default implementation returns the result of calling 788 | * {@link #visitChildren} on {@code ctx}.

789 | */ 790 | @Override public T visitInlineTable(SqlBaseParser.InlineTableContext ctx) { return visitChildren(ctx); } 791 | /** 792 | * {@inheritDoc} 793 | * 794 | *

The default implementation returns the result of calling 795 | * {@link #visitChildren} on {@code ctx}.

796 | */ 797 | @Override public T visitRowFormatSerde(SqlBaseParser.RowFormatSerdeContext ctx) { return visitChildren(ctx); } 798 | /** 799 | * {@inheritDoc} 800 | * 801 | *

The default implementation returns the result of calling 802 | * {@link #visitChildren} on {@code ctx}.

803 | */ 804 | @Override public T visitRowFormatDelimited(SqlBaseParser.RowFormatDelimitedContext ctx) { return visitChildren(ctx); } 805 | /** 806 | * {@inheritDoc} 807 | * 808 | *

The default implementation returns the result of calling 809 | * {@link #visitChildren} on {@code ctx}.

810 | */ 811 | @Override public T visitTableIdentifier(SqlBaseParser.TableIdentifierContext ctx) { return visitChildren(ctx); } 812 | /** 813 | * {@inheritDoc} 814 | * 815 | *

The default implementation returns the result of calling 816 | * {@link #visitChildren} on {@code ctx}.

817 | */ 818 | @Override public T visitNamedExpression(SqlBaseParser.NamedExpressionContext ctx) { return visitChildren(ctx); } 819 | /** 820 | * {@inheritDoc} 821 | * 822 | *

The default implementation returns the result of calling 823 | * {@link #visitChildren} on {@code ctx}.

824 | */ 825 | @Override public T visitNamedExpressionSeq(SqlBaseParser.NamedExpressionSeqContext ctx) { return visitChildren(ctx); } 826 | /** 827 | * {@inheritDoc} 828 | * 829 | *

The default implementation returns the result of calling 830 | * {@link #visitChildren} on {@code ctx}.

831 | */ 832 | @Override public T visitExpression(SqlBaseParser.ExpressionContext ctx) { return visitChildren(ctx); } 833 | /** 834 | * {@inheritDoc} 835 | * 836 | *

The default implementation returns the result of calling 837 | * {@link #visitChildren} on {@code ctx}.

838 | */ 839 | @Override public T visitLogicalNot(SqlBaseParser.LogicalNotContext ctx) { return visitChildren(ctx); } 840 | /** 841 | * {@inheritDoc} 842 | * 843 | *

The default implementation returns the result of calling 844 | * {@link #visitChildren} on {@code ctx}.

845 | */ 846 | @Override public T visitBooleanDefault(SqlBaseParser.BooleanDefaultContext ctx) { return visitChildren(ctx); } 847 | /** 848 | * {@inheritDoc} 849 | * 850 | *

The default implementation returns the result of calling 851 | * {@link #visitChildren} on {@code ctx}.

852 | */ 853 | @Override public T visitExists(SqlBaseParser.ExistsContext ctx) { return visitChildren(ctx); } 854 | /** 855 | * {@inheritDoc} 856 | * 857 | *

The default implementation returns the result of calling 858 | * {@link #visitChildren} on {@code ctx}.

859 | */ 860 | @Override public T visitLogicalBinary(SqlBaseParser.LogicalBinaryContext ctx) { return visitChildren(ctx); } 861 | /** 862 | * {@inheritDoc} 863 | * 864 | *

The default implementation returns the result of calling 865 | * {@link #visitChildren} on {@code ctx}.

866 | */ 867 | @Override public T visitPredicated(SqlBaseParser.PredicatedContext ctx) { return visitChildren(ctx); } 868 | /** 869 | * {@inheritDoc} 870 | * 871 | *

The default implementation returns the result of calling 872 | * {@link #visitChildren} on {@code ctx}.

873 | */ 874 | @Override public T visitPredicate(SqlBaseParser.PredicateContext ctx) { return visitChildren(ctx); } 875 | /** 876 | * {@inheritDoc} 877 | * 878 | *

The default implementation returns the result of calling 879 | * {@link #visitChildren} on {@code ctx}.

880 | */ 881 | @Override public T visitValueExpressionDefault(SqlBaseParser.ValueExpressionDefaultContext ctx) { return visitChildren(ctx); } 882 | /** 883 | * {@inheritDoc} 884 | * 885 | *

The default implementation returns the result of calling 886 | * {@link #visitChildren} on {@code ctx}.

887 | */ 888 | @Override public T visitComparison(SqlBaseParser.ComparisonContext ctx) { return visitChildren(ctx); } 889 | /** 890 | * {@inheritDoc} 891 | * 892 | *

The default implementation returns the result of calling 893 | * {@link #visitChildren} on {@code ctx}.

894 | */ 895 | @Override public T visitArithmeticBinary(SqlBaseParser.ArithmeticBinaryContext ctx) { return visitChildren(ctx); } 896 | /** 897 | * {@inheritDoc} 898 | * 899 | *

The default implementation returns the result of calling 900 | * {@link #visitChildren} on {@code ctx}.

901 | */ 902 | @Override public T visitArithmeticUnary(SqlBaseParser.ArithmeticUnaryContext ctx) { return visitChildren(ctx); } 903 | /** 904 | * {@inheritDoc} 905 | * 906 | *

The default implementation returns the result of calling 907 | * {@link #visitChildren} on {@code ctx}.

908 | */ 909 | @Override public T visitDereference(SqlBaseParser.DereferenceContext ctx) { return visitChildren(ctx); } 910 | /** 911 | * {@inheritDoc} 912 | * 913 | *

The default implementation returns the result of calling 914 | * {@link #visitChildren} on {@code ctx}.

915 | */ 916 | @Override public T visitSimpleCase(SqlBaseParser.SimpleCaseContext ctx) { return visitChildren(ctx); } 917 | /** 918 | * {@inheritDoc} 919 | * 920 | *

The default implementation returns the result of calling 921 | * {@link #visitChildren} on {@code ctx}.

922 | */ 923 | @Override public T visitColumnReference(SqlBaseParser.ColumnReferenceContext ctx) { return visitChildren(ctx); } 924 | /** 925 | * {@inheritDoc} 926 | * 927 | *

The default implementation returns the result of calling 928 | * {@link #visitChildren} on {@code ctx}.

929 | */ 930 | @Override public T visitRowConstructor(SqlBaseParser.RowConstructorContext ctx) { return visitChildren(ctx); } 931 | /** 932 | * {@inheritDoc} 933 | * 934 | *

The default implementation returns the result of calling 935 | * {@link #visitChildren} on {@code ctx}.

936 | */ 937 | @Override public T visitStar(SqlBaseParser.StarContext ctx) { return visitChildren(ctx); } 938 | /** 939 | * {@inheritDoc} 940 | * 941 | *

The default implementation returns the result of calling 942 | * {@link #visitChildren} on {@code ctx}.

943 | */ 944 | @Override public T visitSubscript(SqlBaseParser.SubscriptContext ctx) { return visitChildren(ctx); } 945 | /** 946 | * {@inheritDoc} 947 | * 948 | *

The default implementation returns the result of calling 949 | * {@link #visitChildren} on {@code ctx}.

950 | */ 951 | @Override public T visitTimeFunctionCall(SqlBaseParser.TimeFunctionCallContext ctx) { return visitChildren(ctx); } 952 | /** 953 | * {@inheritDoc} 954 | * 955 | *

The default implementation returns the result of calling 956 | * {@link #visitChildren} on {@code ctx}.

957 | */ 958 | @Override public T visitSubqueryExpression(SqlBaseParser.SubqueryExpressionContext ctx) { return visitChildren(ctx); } 959 | /** 960 | * {@inheritDoc} 961 | * 962 | *

The default implementation returns the result of calling 963 | * {@link #visitChildren} on {@code ctx}.

964 | */ 965 | @Override public T visitCast(SqlBaseParser.CastContext ctx) { return visitChildren(ctx); } 966 | /** 967 | * {@inheritDoc} 968 | * 969 | *

The default implementation returns the result of calling 970 | * {@link #visitChildren} on {@code ctx}.

971 | */ 972 | @Override public T visitConstantDefault(SqlBaseParser.ConstantDefaultContext ctx) { return visitChildren(ctx); } 973 | /** 974 | * {@inheritDoc} 975 | * 976 | *

The default implementation returns the result of calling 977 | * {@link #visitChildren} on {@code ctx}.

978 | */ 979 | @Override public T visitParenthesizedExpression(SqlBaseParser.ParenthesizedExpressionContext ctx) { return visitChildren(ctx); } 980 | /** 981 | * {@inheritDoc} 982 | * 983 | *

The default implementation returns the result of calling 984 | * {@link #visitChildren} on {@code ctx}.

985 | */ 986 | @Override public T visitFunctionCall(SqlBaseParser.FunctionCallContext ctx) { return visitChildren(ctx); } 987 | /** 988 | * {@inheritDoc} 989 | * 990 | *

The default implementation returns the result of calling 991 | * {@link #visitChildren} on {@code ctx}.

992 | */ 993 | @Override public T visitSearchedCase(SqlBaseParser.SearchedCaseContext ctx) { return visitChildren(ctx); } 994 | /** 995 | * {@inheritDoc} 996 | * 997 | *

The default implementation returns the result of calling 998 | * {@link #visitChildren} on {@code ctx}.

999 | */ 1000 | @Override public T visitNullLiteral(SqlBaseParser.NullLiteralContext ctx) { return visitChildren(ctx); } 1001 | /** 1002 | * {@inheritDoc} 1003 | * 1004 | *

The default implementation returns the result of calling 1005 | * {@link #visitChildren} on {@code ctx}.

1006 | */ 1007 | @Override public T visitIntervalLiteral(SqlBaseParser.IntervalLiteralContext ctx) { return visitChildren(ctx); } 1008 | /** 1009 | * {@inheritDoc} 1010 | * 1011 | *

The default implementation returns the result of calling 1012 | * {@link #visitChildren} on {@code ctx}.

1013 | */ 1014 | @Override public T visitTypeConstructor(SqlBaseParser.TypeConstructorContext ctx) { return visitChildren(ctx); } 1015 | /** 1016 | * {@inheritDoc} 1017 | * 1018 | *

The default implementation returns the result of calling 1019 | * {@link #visitChildren} on {@code ctx}.

1020 | */ 1021 | @Override public T visitNumericLiteral(SqlBaseParser.NumericLiteralContext ctx) { return visitChildren(ctx); } 1022 | /** 1023 | * {@inheritDoc} 1024 | * 1025 | *

The default implementation returns the result of calling 1026 | * {@link #visitChildren} on {@code ctx}.

1027 | */ 1028 | @Override public T visitBooleanLiteral(SqlBaseParser.BooleanLiteralContext ctx) { return visitChildren(ctx); } 1029 | /** 1030 | * {@inheritDoc} 1031 | * 1032 | *

The default implementation returns the result of calling 1033 | * {@link #visitChildren} on {@code ctx}.

1034 | */ 1035 | @Override public T visitStringLiteral(SqlBaseParser.StringLiteralContext ctx) { return visitChildren(ctx); } 1036 | /** 1037 | * {@inheritDoc} 1038 | * 1039 | *

The default implementation returns the result of calling 1040 | * {@link #visitChildren} on {@code ctx}.

1041 | */ 1042 | @Override public T visitComparisonOperator(SqlBaseParser.ComparisonOperatorContext ctx) { return visitChildren(ctx); } 1043 | /** 1044 | * {@inheritDoc} 1045 | * 1046 | *

The default implementation returns the result of calling 1047 | * {@link #visitChildren} on {@code ctx}.

1048 | */ 1049 | @Override public T visitArithmeticOperator(SqlBaseParser.ArithmeticOperatorContext ctx) { return visitChildren(ctx); } 1050 | /** 1051 | * {@inheritDoc} 1052 | * 1053 | *

The default implementation returns the result of calling 1054 | * {@link #visitChildren} on {@code ctx}.

1055 | */ 1056 | @Override public T visitPredicateOperator(SqlBaseParser.PredicateOperatorContext ctx) { return visitChildren(ctx); } 1057 | /** 1058 | * {@inheritDoc} 1059 | * 1060 | *

The default implementation returns the result of calling 1061 | * {@link #visitChildren} on {@code ctx}.

1062 | */ 1063 | @Override public T visitBooleanValue(SqlBaseParser.BooleanValueContext ctx) { return visitChildren(ctx); } 1064 | /** 1065 | * {@inheritDoc} 1066 | * 1067 | *

The default implementation returns the result of calling 1068 | * {@link #visitChildren} on {@code ctx}.

1069 | */ 1070 | @Override public T visitInterval(SqlBaseParser.IntervalContext ctx) { return visitChildren(ctx); } 1071 | /** 1072 | * {@inheritDoc} 1073 | * 1074 | *

The default implementation returns the result of calling 1075 | * {@link #visitChildren} on {@code ctx}.

1076 | */ 1077 | @Override public T visitIntervalField(SqlBaseParser.IntervalFieldContext ctx) { return visitChildren(ctx); } 1078 | /** 1079 | * {@inheritDoc} 1080 | * 1081 | *

The default implementation returns the result of calling 1082 | * {@link #visitChildren} on {@code ctx}.

1083 | */ 1084 | @Override public T visitIntervalValue(SqlBaseParser.IntervalValueContext ctx) { return visitChildren(ctx); } 1085 | /** 1086 | * {@inheritDoc} 1087 | * 1088 | *

The default implementation returns the result of calling 1089 | * {@link #visitChildren} on {@code ctx}.

1090 | */ 1091 | @Override public T visitComplexDataType(SqlBaseParser.ComplexDataTypeContext ctx) { return visitChildren(ctx); } 1092 | /** 1093 | * {@inheritDoc} 1094 | * 1095 | *

The default implementation returns the result of calling 1096 | * {@link #visitChildren} on {@code ctx}.

1097 | */ 1098 | @Override public T visitPrimitiveDataType(SqlBaseParser.PrimitiveDataTypeContext ctx) { return visitChildren(ctx); } 1099 | /** 1100 | * {@inheritDoc} 1101 | * 1102 | *

The default implementation returns the result of calling 1103 | * {@link #visitChildren} on {@code ctx}.

1104 | */ 1105 | @Override public T visitColTypeList(SqlBaseParser.ColTypeListContext ctx) { return visitChildren(ctx); } 1106 | /** 1107 | * {@inheritDoc} 1108 | * 1109 | *

The default implementation returns the result of calling 1110 | * {@link #visitChildren} on {@code ctx}.

1111 | */ 1112 | @Override public T visitColType(SqlBaseParser.ColTypeContext ctx) { return visitChildren(ctx); } 1113 | /** 1114 | * {@inheritDoc} 1115 | * 1116 | *

The default implementation returns the result of calling 1117 | * {@link #visitChildren} on {@code ctx}.

1118 | */ 1119 | @Override public T visitComplexColTypeList(SqlBaseParser.ComplexColTypeListContext ctx) { return visitChildren(ctx); } 1120 | /** 1121 | * {@inheritDoc} 1122 | * 1123 | *

The default implementation returns the result of calling 1124 | * {@link #visitChildren} on {@code ctx}.

1125 | */ 1126 | @Override public T visitComplexColType(SqlBaseParser.ComplexColTypeContext ctx) { return visitChildren(ctx); } 1127 | /** 1128 | * {@inheritDoc} 1129 | * 1130 | *

The default implementation returns the result of calling 1131 | * {@link #visitChildren} on {@code ctx}.

1132 | */ 1133 | @Override public T visitWhenClause(SqlBaseParser.WhenClauseContext ctx) { return visitChildren(ctx); } 1134 | /** 1135 | * {@inheritDoc} 1136 | * 1137 | *

The default implementation returns the result of calling 1138 | * {@link #visitChildren} on {@code ctx}.

1139 | */ 1140 | @Override public T visitWindows(SqlBaseParser.WindowsContext ctx) { return visitChildren(ctx); } 1141 | /** 1142 | * {@inheritDoc} 1143 | * 1144 | *

The default implementation returns the result of calling 1145 | * {@link #visitChildren} on {@code ctx}.

1146 | */ 1147 | @Override public T visitNamedWindow(SqlBaseParser.NamedWindowContext ctx) { return visitChildren(ctx); } 1148 | /** 1149 | * {@inheritDoc} 1150 | * 1151 | *

The default implementation returns the result of calling 1152 | * {@link #visitChildren} on {@code ctx}.

1153 | */ 1154 | @Override public T visitWindowRef(SqlBaseParser.WindowRefContext ctx) { return visitChildren(ctx); } 1155 | /** 1156 | * {@inheritDoc} 1157 | * 1158 | *

The default implementation returns the result of calling 1159 | * {@link #visitChildren} on {@code ctx}.

1160 | */ 1161 | @Override public T visitWindowDef(SqlBaseParser.WindowDefContext ctx) { return visitChildren(ctx); } 1162 | /** 1163 | * {@inheritDoc} 1164 | * 1165 | *

The default implementation returns the result of calling 1166 | * {@link #visitChildren} on {@code ctx}.

1167 | */ 1168 | @Override public T visitWindowFrame(SqlBaseParser.WindowFrameContext ctx) { return visitChildren(ctx); } 1169 | /** 1170 | * {@inheritDoc} 1171 | * 1172 | *

The default implementation returns the result of calling 1173 | * {@link #visitChildren} on {@code ctx}.

1174 | */ 1175 | @Override public T visitFrameBound(SqlBaseParser.FrameBoundContext ctx) { return visitChildren(ctx); } 1176 | /** 1177 | * {@inheritDoc} 1178 | * 1179 | *

The default implementation returns the result of calling 1180 | * {@link #visitChildren} on {@code ctx}.

1181 | */ 1182 | @Override public T visitQualifiedName(SqlBaseParser.QualifiedNameContext ctx) { return visitChildren(ctx); } 1183 | /** 1184 | * {@inheritDoc} 1185 | * 1186 | *

The default implementation returns the result of calling 1187 | * {@link #visitChildren} on {@code ctx}.

1188 | */ 1189 | @Override public T visitIdentifier(SqlBaseParser.IdentifierContext ctx) { return visitChildren(ctx); } 1190 | /** 1191 | * {@inheritDoc} 1192 | * 1193 | *

The default implementation returns the result of calling 1194 | * {@link #visitChildren} on {@code ctx}.

1195 | */ 1196 | @Override public T visitUnquotedIdentifier(SqlBaseParser.UnquotedIdentifierContext ctx) { return visitChildren(ctx); } 1197 | /** 1198 | * {@inheritDoc} 1199 | * 1200 | *

The default implementation returns the result of calling 1201 | * {@link #visitChildren} on {@code ctx}.

1202 | */ 1203 | @Override public T visitQuotedIdentifierAlternative(SqlBaseParser.QuotedIdentifierAlternativeContext ctx) { return visitChildren(ctx); } 1204 | /** 1205 | * {@inheritDoc} 1206 | * 1207 | *

The default implementation returns the result of calling 1208 | * {@link #visitChildren} on {@code ctx}.

1209 | */ 1210 | @Override public T visitQuotedIdentifier(SqlBaseParser.QuotedIdentifierContext ctx) { return visitChildren(ctx); } 1211 | /** 1212 | * {@inheritDoc} 1213 | * 1214 | *

The default implementation returns the result of calling 1215 | * {@link #visitChildren} on {@code ctx}.

1216 | */ 1217 | @Override public T visitDecimalLiteral(SqlBaseParser.DecimalLiteralContext ctx) { return visitChildren(ctx); } 1218 | /** 1219 | * {@inheritDoc} 1220 | * 1221 | *

The default implementation returns the result of calling 1222 | * {@link #visitChildren} on {@code ctx}.

1223 | */ 1224 | @Override public T visitIntegerLiteral(SqlBaseParser.IntegerLiteralContext ctx) { return visitChildren(ctx); } 1225 | /** 1226 | * {@inheritDoc} 1227 | * 1228 | *

The default implementation returns the result of calling 1229 | * {@link #visitChildren} on {@code ctx}.

1230 | */ 1231 | @Override public T visitBigIntLiteral(SqlBaseParser.BigIntLiteralContext ctx) { return visitChildren(ctx); } 1232 | /** 1233 | * {@inheritDoc} 1234 | * 1235 | *

The default implementation returns the result of calling 1236 | * {@link #visitChildren} on {@code ctx}.

1237 | */ 1238 | @Override public T visitSmallIntLiteral(SqlBaseParser.SmallIntLiteralContext ctx) { return visitChildren(ctx); } 1239 | /** 1240 | * {@inheritDoc} 1241 | * 1242 | *

The default implementation returns the result of calling 1243 | * {@link #visitChildren} on {@code ctx}.

1244 | */ 1245 | @Override public T visitTinyIntLiteral(SqlBaseParser.TinyIntLiteralContext ctx) { return visitChildren(ctx); } 1246 | /** 1247 | * {@inheritDoc} 1248 | * 1249 | *

The default implementation returns the result of calling 1250 | * {@link #visitChildren} on {@code ctx}.

1251 | */ 1252 | @Override public T visitDoubleLiteral(SqlBaseParser.DoubleLiteralContext ctx) { return visitChildren(ctx); } 1253 | /** 1254 | * {@inheritDoc} 1255 | * 1256 | *

The default implementation returns the result of calling 1257 | * {@link #visitChildren} on {@code ctx}.

1258 | */ 1259 | @Override public T visitBigDecimalLiteral(SqlBaseParser.BigDecimalLiteralContext ctx) { return visitChildren(ctx); } 1260 | /** 1261 | * {@inheritDoc} 1262 | * 1263 | *

The default implementation returns the result of calling 1264 | * {@link #visitChildren} on {@code ctx}.

1265 | */ 1266 | @Override public T visitNonReserved(SqlBaseParser.NonReservedContext ctx) { return visitChildren(ctx); } 1267 | } -------------------------------------------------------------------------------- /gen/com/tencent/SqlBaseLexer.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | SELECT=8 9 | FROM=9 10 | ADD=10 11 | AS=11 12 | ALL=12 13 | DISTINCT=13 14 | WHERE=14 15 | GROUP=15 16 | BY=16 17 | GROUPING=17 18 | SETS=18 19 | CUBE=19 20 | ROLLUP=20 21 | ORDER=21 22 | HAVING=22 23 | LIMIT=23 24 | AT=24 25 | OR=25 26 | AND=26 27 | IN=27 28 | NOT=28 29 | NO=29 30 | EXISTS=30 31 | BETWEEN=31 32 | LIKE=32 33 | RLIKE=33 34 | IS=34 35 | NULL=35 36 | TRUE=36 37 | FALSE=37 38 | NULLS=38 39 | ASC=39 40 | DESC=40 41 | FOR=41 42 | INTERVAL=42 43 | CASE=43 44 | WHEN=44 45 | THEN=45 46 | ELSE=46 47 | END=47 48 | JOIN=48 49 | CROSS=49 50 | OUTER=50 51 | INNER=51 52 | LEFT=52 53 | SEMI=53 54 | RIGHT=54 55 | FULL=55 56 | NATURAL=56 57 | ON=57 58 | LATERAL=58 59 | WINDOW=59 60 | OVER=60 61 | PARTITION=61 62 | RANGE=62 63 | ROWS=63 64 | UNBOUNDED=64 65 | PRECEDING=65 66 | FOLLOWING=66 67 | CURRENT=67 68 | FIRST=68 69 | LAST=69 70 | ROW=70 71 | WITH=71 72 | VALUES=72 73 | CREATE=73 74 | TABLE=74 75 | VIEW=75 76 | REPLACE=76 77 | INSERT=77 78 | DELETE=78 79 | INTO=79 80 | DESCRIBE=80 81 | EXPLAIN=81 82 | FORMAT=82 83 | LOGICAL=83 84 | CODEGEN=84 85 | CAST=85 86 | SHOW=86 87 | TABLES=87 88 | COLUMNS=88 89 | COLUMN=89 90 | USE=90 91 | PARTITIONS=91 92 | FUNCTIONS=92 93 | DROP=93 94 | UNION=94 95 | EXCEPT=95 96 | SETMINUS=96 97 | INTERSECT=97 98 | TO=98 99 | TABLESAMPLE=99 100 | STRATIFY=100 101 | ALTER=101 102 | RENAME=102 103 | ARRAY=103 104 | MAP=104 105 | STRUCT=105 106 | COMMENT=106 107 | SET=107 108 | RESET=108 109 | DATA=109 110 | START=110 111 | TRANSACTION=111 112 | COMMIT=112 113 | ROLLBACK=113 114 | MACRO=114 115 | IF=115 116 | EQ=116 117 | NSEQ=117 118 | NEQ=118 119 | NEQJ=119 120 | LT=120 121 | LTE=121 122 | GT=122 123 | GTE=123 124 | PLUS=124 125 | MINUS=125 126 | ASTERISK=126 127 | SLASH=127 128 | PERCENT=128 129 | DIV=129 130 | TILDE=130 131 | AMPERSAND=131 132 | PIPE=132 133 | HAT=133 134 | RSHIFT=134 135 | PERCENTLIT=135 136 | BUCKET=136 137 | OUT=137 138 | OF=138 139 | SORT=139 140 | CLUSTER=140 141 | DISTRIBUTE=141 142 | OVERWRITE=142 143 | TRANSFORM=143 144 | REDUCE=144 145 | USING=145 146 | SERDE=146 147 | SERDEPROPERTIES=147 148 | RECORDREADER=148 149 | RECORDWRITER=149 150 | DELIMITED=150 151 | FIELDS=151 152 | TERMINATED=152 153 | COLLECTION=153 154 | ITEMS=154 155 | KEYS=155 156 | ESCAPED=156 157 | LINES=157 158 | SEPARATED=158 159 | FUNCTION=159 160 | EXTENDED=160 161 | REFRESH=161 162 | CLEAR=162 163 | CACHE=163 164 | UNCACHE=164 165 | LAZY=165 166 | FORMATTED=166 167 | GLOBAL=167 168 | TEMPORARY=168 169 | OPTIONS=169 170 | UNSET=170 171 | TBLPROPERTIES=171 172 | DBPROPERTIES=172 173 | BUCKETS=173 174 | SKEWED=174 175 | STORED=175 176 | DIRECTORIES=176 177 | LOCATION=177 178 | EXCHANGE=178 179 | ARCHIVE=179 180 | UNARCHIVE=180 181 | FILEFORMAT=181 182 | TOUCH=182 183 | COMPACT=183 184 | CONCATENATE=184 185 | CHANGE=185 186 | CASCADE=186 187 | RESTRICT=187 188 | CLUSTERED=188 189 | SORTED=189 190 | PURGE=190 191 | INPUTFORMAT=191 192 | OUTPUTFORMAT=192 193 | DATABASE=193 194 | DATABASES=194 195 | DFS=195 196 | TRUNCATE=196 197 | ANALYZE=197 198 | COMPUTE=198 199 | LIST=199 200 | STATISTICS=200 201 | PARTITIONED=201 202 | EXTERNAL=202 203 | DEFINED=203 204 | REVOKE=204 205 | GRANT=205 206 | LOCK=206 207 | UNLOCK=207 208 | MSCK=208 209 | REPAIR=209 210 | RECOVER=210 211 | EXPORT=211 212 | IMPORT=212 213 | LOAD=213 214 | ROLE=214 215 | ROLES=215 216 | COMPACTIONS=216 217 | PRINCIPALS=217 218 | TRANSACTIONS=218 219 | INDEX=219 220 | INDEXES=220 221 | LOCKS=221 222 | OPTION=222 223 | ANTI=223 224 | LOCAL=224 225 | INPATH=225 226 | CURRENT_DATE=226 227 | CURRENT_TIMESTAMP=227 228 | STRING=228 229 | BIGINT_LITERAL=229 230 | SMALLINT_LITERAL=230 231 | TINYINT_LITERAL=231 232 | BYTELENGTH_LITERAL=232 233 | INTEGER_VALUE=233 234 | DECIMAL_VALUE=234 235 | DOUBLE_LITERAL=235 236 | BIGDECIMAL_LITERAL=236 237 | IDENTIFIER=237 238 | BACKQUOTED_IDENTIFIER=238 239 | SIMPLE_COMMENT=239 240 | BRACKETED_COMMENT=240 241 | WS=241 242 | UNRECOGNIZED=242 243 | '('=1 244 | ')'=2 245 | ','=3 246 | '.'=4 247 | '['=5 248 | ']'=6 249 | ':'=7 250 | 'SELECT'=8 251 | 'FROM'=9 252 | 'ADD'=10 253 | 'AS'=11 254 | 'ALL'=12 255 | 'DISTINCT'=13 256 | 'WHERE'=14 257 | 'GROUP'=15 258 | 'BY'=16 259 | 'GROUPING'=17 260 | 'SETS'=18 261 | 'CUBE'=19 262 | 'ROLLUP'=20 263 | 'ORDER'=21 264 | 'HAVING'=22 265 | 'LIMIT'=23 266 | 'AT'=24 267 | 'OR'=25 268 | 'AND'=26 269 | 'IN'=27 270 | 'NO'=29 271 | 'EXISTS'=30 272 | 'BETWEEN'=31 273 | 'LIKE'=32 274 | 'IS'=34 275 | 'NULL'=35 276 | 'TRUE'=36 277 | 'FALSE'=37 278 | 'NULLS'=38 279 | 'ASC'=39 280 | 'DESC'=40 281 | 'FOR'=41 282 | 'INTERVAL'=42 283 | 'CASE'=43 284 | 'WHEN'=44 285 | 'THEN'=45 286 | 'ELSE'=46 287 | 'END'=47 288 | 'JOIN'=48 289 | 'CROSS'=49 290 | 'OUTER'=50 291 | 'INNER'=51 292 | 'LEFT'=52 293 | 'SEMI'=53 294 | 'RIGHT'=54 295 | 'FULL'=55 296 | 'NATURAL'=56 297 | 'ON'=57 298 | 'LATERAL'=58 299 | 'WINDOW'=59 300 | 'OVER'=60 301 | 'PARTITION'=61 302 | 'RANGE'=62 303 | 'ROWS'=63 304 | 'UNBOUNDED'=64 305 | 'PRECEDING'=65 306 | 'FOLLOWING'=66 307 | 'CURRENT'=67 308 | 'FIRST'=68 309 | 'LAST'=69 310 | 'ROW'=70 311 | 'WITH'=71 312 | 'VALUES'=72 313 | 'CREATE'=73 314 | 'TABLE'=74 315 | 'VIEW'=75 316 | 'REPLACE'=76 317 | 'INSERT'=77 318 | 'DELETE'=78 319 | 'INTO'=79 320 | 'DESCRIBE'=80 321 | 'EXPLAIN'=81 322 | 'FORMAT'=82 323 | 'LOGICAL'=83 324 | 'CODEGEN'=84 325 | 'CAST'=85 326 | 'SHOW'=86 327 | 'TABLES'=87 328 | 'COLUMNS'=88 329 | 'COLUMN'=89 330 | 'USE'=90 331 | 'PARTITIONS'=91 332 | 'FUNCTIONS'=92 333 | 'DROP'=93 334 | 'UNION'=94 335 | 'EXCEPT'=95 336 | 'MINUS'=96 337 | 'INTERSECT'=97 338 | 'TO'=98 339 | 'TABLESAMPLE'=99 340 | 'STRATIFY'=100 341 | 'ALTER'=101 342 | 'RENAME'=102 343 | 'ARRAY'=103 344 | 'MAP'=104 345 | 'STRUCT'=105 346 | 'COMMENT'=106 347 | 'SET'=107 348 | 'RESET'=108 349 | 'DATA'=109 350 | 'START'=110 351 | 'TRANSACTION'=111 352 | 'COMMIT'=112 353 | 'ROLLBACK'=113 354 | 'MACRO'=114 355 | 'IF'=115 356 | '<=>'=117 357 | '<>'=118 358 | '!='=119 359 | '<'=120 360 | '>'=122 361 | '+'=124 362 | '-'=125 363 | '*'=126 364 | '%'=128 365 | 'DIV'=129 366 | '~'=130 367 | '&'=131 368 | '|'=132 369 | '^'=133 370 | '>>'=134 371 | 'PERCENT'=135 372 | 'BUCKET'=136 373 | 'OUT'=137 374 | 'OF'=138 375 | 'SORT'=139 376 | 'CLUSTER'=140 377 | 'DISTRIBUTE'=141 378 | 'OVERWRITE'=142 379 | 'TRANSFORM'=143 380 | 'REDUCE'=144 381 | 'USING'=145 382 | 'SERDE'=146 383 | 'SERDEPROPERTIES'=147 384 | 'RECORDREADER'=148 385 | 'RECORDWRITER'=149 386 | 'DELIMITED'=150 387 | 'FIELDS'=151 388 | 'TERMINATED'=152 389 | 'COLLECTION'=153 390 | 'ITEMS'=154 391 | 'KEYS'=155 392 | 'ESCAPED'=156 393 | 'LINES'=157 394 | 'SEPARATED'=158 395 | 'FUNCTION'=159 396 | 'EXTENDED'=160 397 | 'REFRESH'=161 398 | 'CLEAR'=162 399 | 'CACHE'=163 400 | 'UNCACHE'=164 401 | 'LAZY'=165 402 | 'FORMATTED'=166 403 | 'GLOBAL'=167 404 | 'OPTIONS'=169 405 | 'UNSET'=170 406 | 'TBLPROPERTIES'=171 407 | 'DBPROPERTIES'=172 408 | 'BUCKETS'=173 409 | 'SKEWED'=174 410 | 'STORED'=175 411 | 'DIRECTORIES'=176 412 | 'LOCATION'=177 413 | 'EXCHANGE'=178 414 | 'ARCHIVE'=179 415 | 'UNARCHIVE'=180 416 | 'FILEFORMAT'=181 417 | 'TOUCH'=182 418 | 'COMPACT'=183 419 | 'CONCATENATE'=184 420 | 'CHANGE'=185 421 | 'CASCADE'=186 422 | 'RESTRICT'=187 423 | 'CLUSTERED'=188 424 | 'SORTED'=189 425 | 'PURGE'=190 426 | 'INPUTFORMAT'=191 427 | 'OUTPUTFORMAT'=192 428 | 'DFS'=195 429 | 'TRUNCATE'=196 430 | 'ANALYZE'=197 431 | 'COMPUTE'=198 432 | 'LIST'=199 433 | 'STATISTICS'=200 434 | 'PARTITIONED'=201 435 | 'EXTERNAL'=202 436 | 'DEFINED'=203 437 | 'REVOKE'=204 438 | 'GRANT'=205 439 | 'LOCK'=206 440 | 'UNLOCK'=207 441 | 'MSCK'=208 442 | 'REPAIR'=209 443 | 'RECOVER'=210 444 | 'EXPORT'=211 445 | 'IMPORT'=212 446 | 'LOAD'=213 447 | 'ROLE'=214 448 | 'ROLES'=215 449 | 'COMPACTIONS'=216 450 | 'PRINCIPALS'=217 451 | 'TRANSACTIONS'=218 452 | 'INDEX'=219 453 | 'INDEXES'=220 454 | 'LOCKS'=221 455 | 'OPTION'=222 456 | 'ANTI'=223 457 | 'LOCAL'=224 458 | 'INPATH'=225 459 | 'CURRENT_DATE'=226 460 | 'CURRENT_TIMESTAMP'=227 461 | -------------------------------------------------------------------------------- /gen/com/tencent/SqlBaseVisitor.java: -------------------------------------------------------------------------------- 1 | // Generated from D:/Development/AntlrTest/src\SqlBase.g4 by ANTLR 4.5.3 2 | package com.tencent; 3 | import org.antlr.v4.runtime.tree.ParseTreeVisitor; 4 | 5 | /** 6 | * This interface defines a complete generic visitor for a parse tree produced 7 | * by {@link SqlBaseParser}. 8 | * 9 | * @param The return type of the visit operation. Use {@link Void} for 10 | * operations with no return type. 11 | */ 12 | public interface SqlBaseVisitor extends ParseTreeVisitor { 13 | /** 14 | * Visit a parse tree produced by {@link SqlBaseParser#singleStatement}. 15 | * @param ctx the parse tree 16 | * @return the visitor result 17 | */ 18 | T visitSingleStatement(SqlBaseParser.SingleStatementContext ctx); 19 | /** 20 | * Visit a parse tree produced by {@link SqlBaseParser#singleExpression}. 21 | * @param ctx the parse tree 22 | * @return the visitor result 23 | */ 24 | T visitSingleExpression(SqlBaseParser.SingleExpressionContext ctx); 25 | /** 26 | * Visit a parse tree produced by {@link SqlBaseParser#singleTableIdentifier}. 27 | * @param ctx the parse tree 28 | * @return the visitor result 29 | */ 30 | T visitSingleTableIdentifier(SqlBaseParser.SingleTableIdentifierContext ctx); 31 | /** 32 | * Visit a parse tree produced by {@link SqlBaseParser#singleDataType}. 33 | * @param ctx the parse tree 34 | * @return the visitor result 35 | */ 36 | T visitSingleDataType(SqlBaseParser.SingleDataTypeContext ctx); 37 | /** 38 | * Visit a parse tree produced by the {@code statementDefault} 39 | * labeled alternative in {@link SqlBaseParser#statement}. 40 | * @param ctx the parse tree 41 | * @return the visitor result 42 | */ 43 | T visitStatementDefault(SqlBaseParser.StatementDefaultContext ctx); 44 | /** 45 | * Visit a parse tree produced by the {@code use} 46 | * labeled alternative in {@link SqlBaseParser#statement}. 47 | * @param ctx the parse tree 48 | * @return the visitor result 49 | */ 50 | T visitUse(SqlBaseParser.UseContext ctx); 51 | /** 52 | * Visit a parse tree produced by the {@code createDatabase} 53 | * labeled alternative in {@link SqlBaseParser#statement}. 54 | * @param ctx the parse tree 55 | * @return the visitor result 56 | */ 57 | T visitCreateDatabase(SqlBaseParser.CreateDatabaseContext ctx); 58 | /** 59 | * Visit a parse tree produced by the {@code setDatabaseProperties} 60 | * labeled alternative in {@link SqlBaseParser#statement}. 61 | * @param ctx the parse tree 62 | * @return the visitor result 63 | */ 64 | T visitSetDatabaseProperties(SqlBaseParser.SetDatabasePropertiesContext ctx); 65 | /** 66 | * Visit a parse tree produced by the {@code dropDatabase} 67 | * labeled alternative in {@link SqlBaseParser#statement}. 68 | * @param ctx the parse tree 69 | * @return the visitor result 70 | */ 71 | T visitDropDatabase(SqlBaseParser.DropDatabaseContext ctx); 72 | /** 73 | * Visit a parse tree produced by the {@code createTableUsing} 74 | * labeled alternative in {@link SqlBaseParser#statement}. 75 | * @param ctx the parse tree 76 | * @return the visitor result 77 | */ 78 | T visitCreateTableUsing(SqlBaseParser.CreateTableUsingContext ctx); 79 | /** 80 | * Visit a parse tree produced by the {@code createTable} 81 | * labeled alternative in {@link SqlBaseParser#statement}. 82 | * @param ctx the parse tree 83 | * @return the visitor result 84 | */ 85 | T visitCreateTable(SqlBaseParser.CreateTableContext ctx); 86 | /** 87 | * Visit a parse tree produced by the {@code createTableLike} 88 | * labeled alternative in {@link SqlBaseParser#statement}. 89 | * @param ctx the parse tree 90 | * @return the visitor result 91 | */ 92 | T visitCreateTableLike(SqlBaseParser.CreateTableLikeContext ctx); 93 | /** 94 | * Visit a parse tree produced by the {@code analyze} 95 | * labeled alternative in {@link SqlBaseParser#statement}. 96 | * @param ctx the parse tree 97 | * @return the visitor result 98 | */ 99 | T visitAnalyze(SqlBaseParser.AnalyzeContext ctx); 100 | /** 101 | * Visit a parse tree produced by the {@code renameTable} 102 | * labeled alternative in {@link SqlBaseParser#statement}. 103 | * @param ctx the parse tree 104 | * @return the visitor result 105 | */ 106 | T visitRenameTable(SqlBaseParser.RenameTableContext ctx); 107 | /** 108 | * Visit a parse tree produced by the {@code setTableProperties} 109 | * labeled alternative in {@link SqlBaseParser#statement}. 110 | * @param ctx the parse tree 111 | * @return the visitor result 112 | */ 113 | T visitSetTableProperties(SqlBaseParser.SetTablePropertiesContext ctx); 114 | /** 115 | * Visit a parse tree produced by the {@code unsetTableProperties} 116 | * labeled alternative in {@link SqlBaseParser#statement}. 117 | * @param ctx the parse tree 118 | * @return the visitor result 119 | */ 120 | T visitUnsetTableProperties(SqlBaseParser.UnsetTablePropertiesContext ctx); 121 | /** 122 | * Visit a parse tree produced by the {@code setTableSerDe} 123 | * labeled alternative in {@link SqlBaseParser#statement}. 124 | * @param ctx the parse tree 125 | * @return the visitor result 126 | */ 127 | T visitSetTableSerDe(SqlBaseParser.SetTableSerDeContext ctx); 128 | /** 129 | * Visit a parse tree produced by the {@code addTablePartition} 130 | * labeled alternative in {@link SqlBaseParser#statement}. 131 | * @param ctx the parse tree 132 | * @return the visitor result 133 | */ 134 | T visitAddTablePartition(SqlBaseParser.AddTablePartitionContext ctx); 135 | /** 136 | * Visit a parse tree produced by the {@code renameTablePartition} 137 | * labeled alternative in {@link SqlBaseParser#statement}. 138 | * @param ctx the parse tree 139 | * @return the visitor result 140 | */ 141 | T visitRenameTablePartition(SqlBaseParser.RenameTablePartitionContext ctx); 142 | /** 143 | * Visit a parse tree produced by the {@code dropTablePartitions} 144 | * labeled alternative in {@link SqlBaseParser#statement}. 145 | * @param ctx the parse tree 146 | * @return the visitor result 147 | */ 148 | T visitDropTablePartitions(SqlBaseParser.DropTablePartitionsContext ctx); 149 | /** 150 | * Visit a parse tree produced by the {@code setTableLocation} 151 | * labeled alternative in {@link SqlBaseParser#statement}. 152 | * @param ctx the parse tree 153 | * @return the visitor result 154 | */ 155 | T visitSetTableLocation(SqlBaseParser.SetTableLocationContext ctx); 156 | /** 157 | * Visit a parse tree produced by the {@code recoverPartitions} 158 | * labeled alternative in {@link SqlBaseParser#statement}. 159 | * @param ctx the parse tree 160 | * @return the visitor result 161 | */ 162 | T visitRecoverPartitions(SqlBaseParser.RecoverPartitionsContext ctx); 163 | /** 164 | * Visit a parse tree produced by the {@code dropTable} 165 | * labeled alternative in {@link SqlBaseParser#statement}. 166 | * @param ctx the parse tree 167 | * @return the visitor result 168 | */ 169 | T visitDropTable(SqlBaseParser.DropTableContext ctx); 170 | /** 171 | * Visit a parse tree produced by the {@code createView} 172 | * labeled alternative in {@link SqlBaseParser#statement}. 173 | * @param ctx the parse tree 174 | * @return the visitor result 175 | */ 176 | T visitCreateView(SqlBaseParser.CreateViewContext ctx); 177 | /** 178 | * Visit a parse tree produced by the {@code createTempViewUsing} 179 | * labeled alternative in {@link SqlBaseParser#statement}. 180 | * @param ctx the parse tree 181 | * @return the visitor result 182 | */ 183 | T visitCreateTempViewUsing(SqlBaseParser.CreateTempViewUsingContext ctx); 184 | /** 185 | * Visit a parse tree produced by the {@code alterViewQuery} 186 | * labeled alternative in {@link SqlBaseParser#statement}. 187 | * @param ctx the parse tree 188 | * @return the visitor result 189 | */ 190 | T visitAlterViewQuery(SqlBaseParser.AlterViewQueryContext ctx); 191 | /** 192 | * Visit a parse tree produced by the {@code createFunction} 193 | * labeled alternative in {@link SqlBaseParser#statement}. 194 | * @param ctx the parse tree 195 | * @return the visitor result 196 | */ 197 | T visitCreateFunction(SqlBaseParser.CreateFunctionContext ctx); 198 | /** 199 | * Visit a parse tree produced by the {@code dropFunction} 200 | * labeled alternative in {@link SqlBaseParser#statement}. 201 | * @param ctx the parse tree 202 | * @return the visitor result 203 | */ 204 | T visitDropFunction(SqlBaseParser.DropFunctionContext ctx); 205 | /** 206 | * Visit a parse tree produced by the {@code explain} 207 | * labeled alternative in {@link SqlBaseParser#statement}. 208 | * @param ctx the parse tree 209 | * @return the visitor result 210 | */ 211 | T visitExplain(SqlBaseParser.ExplainContext ctx); 212 | /** 213 | * Visit a parse tree produced by the {@code showTables} 214 | * labeled alternative in {@link SqlBaseParser#statement}. 215 | * @param ctx the parse tree 216 | * @return the visitor result 217 | */ 218 | T visitShowTables(SqlBaseParser.ShowTablesContext ctx); 219 | /** 220 | * Visit a parse tree produced by the {@code showDatabases} 221 | * labeled alternative in {@link SqlBaseParser#statement}. 222 | * @param ctx the parse tree 223 | * @return the visitor result 224 | */ 225 | T visitShowDatabases(SqlBaseParser.ShowDatabasesContext ctx); 226 | /** 227 | * Visit a parse tree produced by the {@code showTblProperties} 228 | * labeled alternative in {@link SqlBaseParser#statement}. 229 | * @param ctx the parse tree 230 | * @return the visitor result 231 | */ 232 | T visitShowTblProperties(SqlBaseParser.ShowTblPropertiesContext ctx); 233 | /** 234 | * Visit a parse tree produced by the {@code showColumns} 235 | * labeled alternative in {@link SqlBaseParser#statement}. 236 | * @param ctx the parse tree 237 | * @return the visitor result 238 | */ 239 | T visitShowColumns(SqlBaseParser.ShowColumnsContext ctx); 240 | /** 241 | * Visit a parse tree produced by the {@code showPartitions} 242 | * labeled alternative in {@link SqlBaseParser#statement}. 243 | * @param ctx the parse tree 244 | * @return the visitor result 245 | */ 246 | T visitShowPartitions(SqlBaseParser.ShowPartitionsContext ctx); 247 | /** 248 | * Visit a parse tree produced by the {@code showFunctions} 249 | * labeled alternative in {@link SqlBaseParser#statement}. 250 | * @param ctx the parse tree 251 | * @return the visitor result 252 | */ 253 | T visitShowFunctions(SqlBaseParser.ShowFunctionsContext ctx); 254 | /** 255 | * Visit a parse tree produced by the {@code showCreateTable} 256 | * labeled alternative in {@link SqlBaseParser#statement}. 257 | * @param ctx the parse tree 258 | * @return the visitor result 259 | */ 260 | T visitShowCreateTable(SqlBaseParser.ShowCreateTableContext ctx); 261 | /** 262 | * Visit a parse tree produced by the {@code describeFunction} 263 | * labeled alternative in {@link SqlBaseParser#statement}. 264 | * @param ctx the parse tree 265 | * @return the visitor result 266 | */ 267 | T visitDescribeFunction(SqlBaseParser.DescribeFunctionContext ctx); 268 | /** 269 | * Visit a parse tree produced by the {@code describeDatabase} 270 | * labeled alternative in {@link SqlBaseParser#statement}. 271 | * @param ctx the parse tree 272 | * @return the visitor result 273 | */ 274 | T visitDescribeDatabase(SqlBaseParser.DescribeDatabaseContext ctx); 275 | /** 276 | * Visit a parse tree produced by the {@code describeTable} 277 | * labeled alternative in {@link SqlBaseParser#statement}. 278 | * @param ctx the parse tree 279 | * @return the visitor result 280 | */ 281 | T visitDescribeTable(SqlBaseParser.DescribeTableContext ctx); 282 | /** 283 | * Visit a parse tree produced by the {@code refreshTable} 284 | * labeled alternative in {@link SqlBaseParser#statement}. 285 | * @param ctx the parse tree 286 | * @return the visitor result 287 | */ 288 | T visitRefreshTable(SqlBaseParser.RefreshTableContext ctx); 289 | /** 290 | * Visit a parse tree produced by the {@code refreshResource} 291 | * labeled alternative in {@link SqlBaseParser#statement}. 292 | * @param ctx the parse tree 293 | * @return the visitor result 294 | */ 295 | T visitRefreshResource(SqlBaseParser.RefreshResourceContext ctx); 296 | /** 297 | * Visit a parse tree produced by the {@code cacheTable} 298 | * labeled alternative in {@link SqlBaseParser#statement}. 299 | * @param ctx the parse tree 300 | * @return the visitor result 301 | */ 302 | T visitCacheTable(SqlBaseParser.CacheTableContext ctx); 303 | /** 304 | * Visit a parse tree produced by the {@code uncacheTable} 305 | * labeled alternative in {@link SqlBaseParser#statement}. 306 | * @param ctx the parse tree 307 | * @return the visitor result 308 | */ 309 | T visitUncacheTable(SqlBaseParser.UncacheTableContext ctx); 310 | /** 311 | * Visit a parse tree produced by the {@code clearCache} 312 | * labeled alternative in {@link SqlBaseParser#statement}. 313 | * @param ctx the parse tree 314 | * @return the visitor result 315 | */ 316 | T visitClearCache(SqlBaseParser.ClearCacheContext ctx); 317 | /** 318 | * Visit a parse tree produced by the {@code loadData} 319 | * labeled alternative in {@link SqlBaseParser#statement}. 320 | * @param ctx the parse tree 321 | * @return the visitor result 322 | */ 323 | T visitLoadData(SqlBaseParser.LoadDataContext ctx); 324 | /** 325 | * Visit a parse tree produced by the {@code truncateTable} 326 | * labeled alternative in {@link SqlBaseParser#statement}. 327 | * @param ctx the parse tree 328 | * @return the visitor result 329 | */ 330 | T visitTruncateTable(SqlBaseParser.TruncateTableContext ctx); 331 | /** 332 | * Visit a parse tree produced by the {@code repairTable} 333 | * labeled alternative in {@link SqlBaseParser#statement}. 334 | * @param ctx the parse tree 335 | * @return the visitor result 336 | */ 337 | T visitRepairTable(SqlBaseParser.RepairTableContext ctx); 338 | /** 339 | * Visit a parse tree produced by the {@code manageResource} 340 | * labeled alternative in {@link SqlBaseParser#statement}. 341 | * @param ctx the parse tree 342 | * @return the visitor result 343 | */ 344 | T visitManageResource(SqlBaseParser.ManageResourceContext ctx); 345 | /** 346 | * Visit a parse tree produced by the {@code failNativeCommand} 347 | * labeled alternative in {@link SqlBaseParser#statement}. 348 | * @param ctx the parse tree 349 | * @return the visitor result 350 | */ 351 | T visitFailNativeCommand(SqlBaseParser.FailNativeCommandContext ctx); 352 | /** 353 | * Visit a parse tree produced by the {@code setConfiguration} 354 | * labeled alternative in {@link SqlBaseParser#statement}. 355 | * @param ctx the parse tree 356 | * @return the visitor result 357 | */ 358 | T visitSetConfiguration(SqlBaseParser.SetConfigurationContext ctx); 359 | /** 360 | * Visit a parse tree produced by the {@code resetConfiguration} 361 | * labeled alternative in {@link SqlBaseParser#statement}. 362 | * @param ctx the parse tree 363 | * @return the visitor result 364 | */ 365 | T visitResetConfiguration(SqlBaseParser.ResetConfigurationContext ctx); 366 | /** 367 | * Visit a parse tree produced by {@link SqlBaseParser#unsupportedHiveNativeCommands}. 368 | * @param ctx the parse tree 369 | * @return the visitor result 370 | */ 371 | T visitUnsupportedHiveNativeCommands(SqlBaseParser.UnsupportedHiveNativeCommandsContext ctx); 372 | /** 373 | * Visit a parse tree produced by {@link SqlBaseParser#createTableHeader}. 374 | * @param ctx the parse tree 375 | * @return the visitor result 376 | */ 377 | T visitCreateTableHeader(SqlBaseParser.CreateTableHeaderContext ctx); 378 | /** 379 | * Visit a parse tree produced by {@link SqlBaseParser#bucketSpec}. 380 | * @param ctx the parse tree 381 | * @return the visitor result 382 | */ 383 | T visitBucketSpec(SqlBaseParser.BucketSpecContext ctx); 384 | /** 385 | * Visit a parse tree produced by {@link SqlBaseParser#skewSpec}. 386 | * @param ctx the parse tree 387 | * @return the visitor result 388 | */ 389 | T visitSkewSpec(SqlBaseParser.SkewSpecContext ctx); 390 | /** 391 | * Visit a parse tree produced by {@link SqlBaseParser#locationSpec}. 392 | * @param ctx the parse tree 393 | * @return the visitor result 394 | */ 395 | T visitLocationSpec(SqlBaseParser.LocationSpecContext ctx); 396 | /** 397 | * Visit a parse tree produced by {@link SqlBaseParser#query}. 398 | * @param ctx the parse tree 399 | * @return the visitor result 400 | */ 401 | T visitQuery(SqlBaseParser.QueryContext ctx); 402 | /** 403 | * Visit a parse tree produced by {@link SqlBaseParser#insertInto}. 404 | * @param ctx the parse tree 405 | * @return the visitor result 406 | */ 407 | T visitInsertInto(SqlBaseParser.InsertIntoContext ctx); 408 | /** 409 | * Visit a parse tree produced by {@link SqlBaseParser#partitionSpecLocation}. 410 | * @param ctx the parse tree 411 | * @return the visitor result 412 | */ 413 | T visitPartitionSpecLocation(SqlBaseParser.PartitionSpecLocationContext ctx); 414 | /** 415 | * Visit a parse tree produced by {@link SqlBaseParser#partitionSpec}. 416 | * @param ctx the parse tree 417 | * @return the visitor result 418 | */ 419 | T visitPartitionSpec(SqlBaseParser.PartitionSpecContext ctx); 420 | /** 421 | * Visit a parse tree produced by {@link SqlBaseParser#partitionVal}. 422 | * @param ctx the parse tree 423 | * @return the visitor result 424 | */ 425 | T visitPartitionVal(SqlBaseParser.PartitionValContext ctx); 426 | /** 427 | * Visit a parse tree produced by {@link SqlBaseParser#describeFuncName}. 428 | * @param ctx the parse tree 429 | * @return the visitor result 430 | */ 431 | T visitDescribeFuncName(SqlBaseParser.DescribeFuncNameContext ctx); 432 | /** 433 | * Visit a parse tree produced by {@link SqlBaseParser#describeColName}. 434 | * @param ctx the parse tree 435 | * @return the visitor result 436 | */ 437 | T visitDescribeColName(SqlBaseParser.DescribeColNameContext ctx); 438 | /** 439 | * Visit a parse tree produced by {@link SqlBaseParser#ctes}. 440 | * @param ctx the parse tree 441 | * @return the visitor result 442 | */ 443 | T visitCtes(SqlBaseParser.CtesContext ctx); 444 | /** 445 | * Visit a parse tree produced by {@link SqlBaseParser#namedQuery}. 446 | * @param ctx the parse tree 447 | * @return the visitor result 448 | */ 449 | T visitNamedQuery(SqlBaseParser.NamedQueryContext ctx); 450 | /** 451 | * Visit a parse tree produced by {@link SqlBaseParser#tableProvider}. 452 | * @param ctx the parse tree 453 | * @return the visitor result 454 | */ 455 | T visitTableProvider(SqlBaseParser.TableProviderContext ctx); 456 | /** 457 | * Visit a parse tree produced by {@link SqlBaseParser#tablePropertyList}. 458 | * @param ctx the parse tree 459 | * @return the visitor result 460 | */ 461 | T visitTablePropertyList(SqlBaseParser.TablePropertyListContext ctx); 462 | /** 463 | * Visit a parse tree produced by {@link SqlBaseParser#tableProperty}. 464 | * @param ctx the parse tree 465 | * @return the visitor result 466 | */ 467 | T visitTableProperty(SqlBaseParser.TablePropertyContext ctx); 468 | /** 469 | * Visit a parse tree produced by {@link SqlBaseParser#tablePropertyKey}. 470 | * @param ctx the parse tree 471 | * @return the visitor result 472 | */ 473 | T visitTablePropertyKey(SqlBaseParser.TablePropertyKeyContext ctx); 474 | /** 475 | * Visit a parse tree produced by {@link SqlBaseParser#tablePropertyValue}. 476 | * @param ctx the parse tree 477 | * @return the visitor result 478 | */ 479 | T visitTablePropertyValue(SqlBaseParser.TablePropertyValueContext ctx); 480 | /** 481 | * Visit a parse tree produced by {@link SqlBaseParser#constantList}. 482 | * @param ctx the parse tree 483 | * @return the visitor result 484 | */ 485 | T visitConstantList(SqlBaseParser.ConstantListContext ctx); 486 | /** 487 | * Visit a parse tree produced by {@link SqlBaseParser#nestedConstantList}. 488 | * @param ctx the parse tree 489 | * @return the visitor result 490 | */ 491 | T visitNestedConstantList(SqlBaseParser.NestedConstantListContext ctx); 492 | /** 493 | * Visit a parse tree produced by {@link SqlBaseParser#createFileFormat}. 494 | * @param ctx the parse tree 495 | * @return the visitor result 496 | */ 497 | T visitCreateFileFormat(SqlBaseParser.CreateFileFormatContext ctx); 498 | /** 499 | * Visit a parse tree produced by the {@code tableFileFormat} 500 | * labeled alternative in {@link SqlBaseParser#fileFormat}. 501 | * @param ctx the parse tree 502 | * @return the visitor result 503 | */ 504 | T visitTableFileFormat(SqlBaseParser.TableFileFormatContext ctx); 505 | /** 506 | * Visit a parse tree produced by the {@code genericFileFormat} 507 | * labeled alternative in {@link SqlBaseParser#fileFormat}. 508 | * @param ctx the parse tree 509 | * @return the visitor result 510 | */ 511 | T visitGenericFileFormat(SqlBaseParser.GenericFileFormatContext ctx); 512 | /** 513 | * Visit a parse tree produced by {@link SqlBaseParser#storageHandler}. 514 | * @param ctx the parse tree 515 | * @return the visitor result 516 | */ 517 | T visitStorageHandler(SqlBaseParser.StorageHandlerContext ctx); 518 | /** 519 | * Visit a parse tree produced by {@link SqlBaseParser#resource}. 520 | * @param ctx the parse tree 521 | * @return the visitor result 522 | */ 523 | T visitResource(SqlBaseParser.ResourceContext ctx); 524 | /** 525 | * Visit a parse tree produced by the {@code singleInsertQuery} 526 | * labeled alternative in {@link SqlBaseParser#queryNoWith}. 527 | * @param ctx the parse tree 528 | * @return the visitor result 529 | */ 530 | T visitSingleInsertQuery(SqlBaseParser.SingleInsertQueryContext ctx); 531 | /** 532 | * Visit a parse tree produced by the {@code multiInsertQuery} 533 | * labeled alternative in {@link SqlBaseParser#queryNoWith}. 534 | * @param ctx the parse tree 535 | * @return the visitor result 536 | */ 537 | T visitMultiInsertQuery(SqlBaseParser.MultiInsertQueryContext ctx); 538 | /** 539 | * Visit a parse tree produced by {@link SqlBaseParser#queryOrganization}. 540 | * @param ctx the parse tree 541 | * @return the visitor result 542 | */ 543 | T visitQueryOrganization(SqlBaseParser.QueryOrganizationContext ctx); 544 | /** 545 | * Visit a parse tree produced by {@link SqlBaseParser#multiInsertQueryBody}. 546 | * @param ctx the parse tree 547 | * @return the visitor result 548 | */ 549 | T visitMultiInsertQueryBody(SqlBaseParser.MultiInsertQueryBodyContext ctx); 550 | /** 551 | * Visit a parse tree produced by the {@code queryTermDefault} 552 | * labeled alternative in {@link SqlBaseParser#queryTerm}. 553 | * @param ctx the parse tree 554 | * @return the visitor result 555 | */ 556 | T visitQueryTermDefault(SqlBaseParser.QueryTermDefaultContext ctx); 557 | /** 558 | * Visit a parse tree produced by the {@code setOperation} 559 | * labeled alternative in {@link SqlBaseParser#queryTerm}. 560 | * @param ctx the parse tree 561 | * @return the visitor result 562 | */ 563 | T visitSetOperation(SqlBaseParser.SetOperationContext ctx); 564 | /** 565 | * Visit a parse tree produced by the {@code queryPrimaryDefault} 566 | * labeled alternative in {@link SqlBaseParser#queryPrimary}. 567 | * @param ctx the parse tree 568 | * @return the visitor result 569 | */ 570 | T visitQueryPrimaryDefault(SqlBaseParser.QueryPrimaryDefaultContext ctx); 571 | /** 572 | * Visit a parse tree produced by the {@code table} 573 | * labeled alternative in {@link SqlBaseParser#queryPrimary}. 574 | * @param ctx the parse tree 575 | * @return the visitor result 576 | */ 577 | T visitTable(SqlBaseParser.TableContext ctx); 578 | /** 579 | * Visit a parse tree produced by the {@code inlineTableDefault1} 580 | * labeled alternative in {@link SqlBaseParser#queryPrimary}. 581 | * @param ctx the parse tree 582 | * @return the visitor result 583 | */ 584 | T visitInlineTableDefault1(SqlBaseParser.InlineTableDefault1Context ctx); 585 | /** 586 | * Visit a parse tree produced by the {@code subquery} 587 | * labeled alternative in {@link SqlBaseParser#queryPrimary}. 588 | * @param ctx the parse tree 589 | * @return the visitor result 590 | */ 591 | T visitSubquery(SqlBaseParser.SubqueryContext ctx); 592 | /** 593 | * Visit a parse tree produced by {@link SqlBaseParser#sortItem}. 594 | * @param ctx the parse tree 595 | * @return the visitor result 596 | */ 597 | T visitSortItem(SqlBaseParser.SortItemContext ctx); 598 | /** 599 | * Visit a parse tree produced by {@link SqlBaseParser#querySpecification}. 600 | * @param ctx the parse tree 601 | * @return the visitor result 602 | */ 603 | T visitQuerySpecification(SqlBaseParser.QuerySpecificationContext ctx); 604 | /** 605 | * Visit a parse tree produced by {@link SqlBaseParser#fromClause}. 606 | * @param ctx the parse tree 607 | * @return the visitor result 608 | */ 609 | T visitFromClause(SqlBaseParser.FromClauseContext ctx); 610 | /** 611 | * Visit a parse tree produced by {@link SqlBaseParser#aggregation}. 612 | * @param ctx the parse tree 613 | * @return the visitor result 614 | */ 615 | T visitAggregation(SqlBaseParser.AggregationContext ctx); 616 | /** 617 | * Visit a parse tree produced by {@link SqlBaseParser#groupingSet}. 618 | * @param ctx the parse tree 619 | * @return the visitor result 620 | */ 621 | T visitGroupingSet(SqlBaseParser.GroupingSetContext ctx); 622 | /** 623 | * Visit a parse tree produced by {@link SqlBaseParser#lateralView}. 624 | * @param ctx the parse tree 625 | * @return the visitor result 626 | */ 627 | T visitLateralView(SqlBaseParser.LateralViewContext ctx); 628 | /** 629 | * Visit a parse tree produced by {@link SqlBaseParser#setQuantifier}. 630 | * @param ctx the parse tree 631 | * @return the visitor result 632 | */ 633 | T visitSetQuantifier(SqlBaseParser.SetQuantifierContext ctx); 634 | /** 635 | * Visit a parse tree produced by {@link SqlBaseParser#relation}. 636 | * @param ctx the parse tree 637 | * @return the visitor result 638 | */ 639 | T visitRelation(SqlBaseParser.RelationContext ctx); 640 | /** 641 | * Visit a parse tree produced by {@link SqlBaseParser#joinRelation}. 642 | * @param ctx the parse tree 643 | * @return the visitor result 644 | */ 645 | T visitJoinRelation(SqlBaseParser.JoinRelationContext ctx); 646 | /** 647 | * Visit a parse tree produced by {@link SqlBaseParser#joinType}. 648 | * @param ctx the parse tree 649 | * @return the visitor result 650 | */ 651 | T visitJoinType(SqlBaseParser.JoinTypeContext ctx); 652 | /** 653 | * Visit a parse tree produced by {@link SqlBaseParser#joinCriteria}. 654 | * @param ctx the parse tree 655 | * @return the visitor result 656 | */ 657 | T visitJoinCriteria(SqlBaseParser.JoinCriteriaContext ctx); 658 | /** 659 | * Visit a parse tree produced by {@link SqlBaseParser#sample}. 660 | * @param ctx the parse tree 661 | * @return the visitor result 662 | */ 663 | T visitSample(SqlBaseParser.SampleContext ctx); 664 | /** 665 | * Visit a parse tree produced by {@link SqlBaseParser#identifierList}. 666 | * @param ctx the parse tree 667 | * @return the visitor result 668 | */ 669 | T visitIdentifierList(SqlBaseParser.IdentifierListContext ctx); 670 | /** 671 | * Visit a parse tree produced by {@link SqlBaseParser#identifierSeq}. 672 | * @param ctx the parse tree 673 | * @return the visitor result 674 | */ 675 | T visitIdentifierSeq(SqlBaseParser.IdentifierSeqContext ctx); 676 | /** 677 | * Visit a parse tree produced by {@link SqlBaseParser#orderedIdentifierList}. 678 | * @param ctx the parse tree 679 | * @return the visitor result 680 | */ 681 | T visitOrderedIdentifierList(SqlBaseParser.OrderedIdentifierListContext ctx); 682 | /** 683 | * Visit a parse tree produced by {@link SqlBaseParser#orderedIdentifier}. 684 | * @param ctx the parse tree 685 | * @return the visitor result 686 | */ 687 | T visitOrderedIdentifier(SqlBaseParser.OrderedIdentifierContext ctx); 688 | /** 689 | * Visit a parse tree produced by {@link SqlBaseParser#identifierCommentList}. 690 | * @param ctx the parse tree 691 | * @return the visitor result 692 | */ 693 | T visitIdentifierCommentList(SqlBaseParser.IdentifierCommentListContext ctx); 694 | /** 695 | * Visit a parse tree produced by {@link SqlBaseParser#identifierComment}. 696 | * @param ctx the parse tree 697 | * @return the visitor result 698 | */ 699 | T visitIdentifierComment(SqlBaseParser.IdentifierCommentContext ctx); 700 | /** 701 | * Visit a parse tree produced by the {@code tableName} 702 | * labeled alternative in {@link SqlBaseParser#relationPrimary}. 703 | * @param ctx the parse tree 704 | * @return the visitor result 705 | */ 706 | T visitTableName(SqlBaseParser.TableNameContext ctx); 707 | /** 708 | * Visit a parse tree produced by the {@code aliasedQuery} 709 | * labeled alternative in {@link SqlBaseParser#relationPrimary}. 710 | * @param ctx the parse tree 711 | * @return the visitor result 712 | */ 713 | T visitAliasedQuery(SqlBaseParser.AliasedQueryContext ctx); 714 | /** 715 | * Visit a parse tree produced by the {@code aliasedRelation} 716 | * labeled alternative in {@link SqlBaseParser#relationPrimary}. 717 | * @param ctx the parse tree 718 | * @return the visitor result 719 | */ 720 | T visitAliasedRelation(SqlBaseParser.AliasedRelationContext ctx); 721 | /** 722 | * Visit a parse tree produced by the {@code inlineTableDefault2} 723 | * labeled alternative in {@link SqlBaseParser#relationPrimary}. 724 | * @param ctx the parse tree 725 | * @return the visitor result 726 | */ 727 | T visitInlineTableDefault2(SqlBaseParser.InlineTableDefault2Context ctx); 728 | /** 729 | * Visit a parse tree produced by the {@code tableValuedFunction} 730 | * labeled alternative in {@link SqlBaseParser#relationPrimary}. 731 | * @param ctx the parse tree 732 | * @return the visitor result 733 | */ 734 | T visitTableValuedFunction(SqlBaseParser.TableValuedFunctionContext ctx); 735 | /** 736 | * Visit a parse tree produced by {@link SqlBaseParser#inlineTable}. 737 | * @param ctx the parse tree 738 | * @return the visitor result 739 | */ 740 | T visitInlineTable(SqlBaseParser.InlineTableContext ctx); 741 | /** 742 | * Visit a parse tree produced by the {@code rowFormatSerde} 743 | * labeled alternative in {@link SqlBaseParser#rowFormat}. 744 | * @param ctx the parse tree 745 | * @return the visitor result 746 | */ 747 | T visitRowFormatSerde(SqlBaseParser.RowFormatSerdeContext ctx); 748 | /** 749 | * Visit a parse tree produced by the {@code rowFormatDelimited} 750 | * labeled alternative in {@link SqlBaseParser#rowFormat}. 751 | * @param ctx the parse tree 752 | * @return the visitor result 753 | */ 754 | T visitRowFormatDelimited(SqlBaseParser.RowFormatDelimitedContext ctx); 755 | /** 756 | * Visit a parse tree produced by {@link SqlBaseParser#tableIdentifier}. 757 | * @param ctx the parse tree 758 | * @return the visitor result 759 | */ 760 | T visitTableIdentifier(SqlBaseParser.TableIdentifierContext ctx); 761 | /** 762 | * Visit a parse tree produced by {@link SqlBaseParser#namedExpression}. 763 | * @param ctx the parse tree 764 | * @return the visitor result 765 | */ 766 | T visitNamedExpression(SqlBaseParser.NamedExpressionContext ctx); 767 | /** 768 | * Visit a parse tree produced by {@link SqlBaseParser#namedExpressionSeq}. 769 | * @param ctx the parse tree 770 | * @return the visitor result 771 | */ 772 | T visitNamedExpressionSeq(SqlBaseParser.NamedExpressionSeqContext ctx); 773 | /** 774 | * Visit a parse tree produced by {@link SqlBaseParser#expression}. 775 | * @param ctx the parse tree 776 | * @return the visitor result 777 | */ 778 | T visitExpression(SqlBaseParser.ExpressionContext ctx); 779 | /** 780 | * Visit a parse tree produced by the {@code logicalNot} 781 | * labeled alternative in {@link SqlBaseParser#booleanExpression}. 782 | * @param ctx the parse tree 783 | * @return the visitor result 784 | */ 785 | T visitLogicalNot(SqlBaseParser.LogicalNotContext ctx); 786 | /** 787 | * Visit a parse tree produced by the {@code booleanDefault} 788 | * labeled alternative in {@link SqlBaseParser#booleanExpression}. 789 | * @param ctx the parse tree 790 | * @return the visitor result 791 | */ 792 | T visitBooleanDefault(SqlBaseParser.BooleanDefaultContext ctx); 793 | /** 794 | * Visit a parse tree produced by the {@code exists} 795 | * labeled alternative in {@link SqlBaseParser#booleanExpression}. 796 | * @param ctx the parse tree 797 | * @return the visitor result 798 | */ 799 | T visitExists(SqlBaseParser.ExistsContext ctx); 800 | /** 801 | * Visit a parse tree produced by the {@code logicalBinary} 802 | * labeled alternative in {@link SqlBaseParser#booleanExpression}. 803 | * @param ctx the parse tree 804 | * @return the visitor result 805 | */ 806 | T visitLogicalBinary(SqlBaseParser.LogicalBinaryContext ctx); 807 | /** 808 | * Visit a parse tree produced by {@link SqlBaseParser#predicated}. 809 | * @param ctx the parse tree 810 | * @return the visitor result 811 | */ 812 | T visitPredicated(SqlBaseParser.PredicatedContext ctx); 813 | /** 814 | * Visit a parse tree produced by {@link SqlBaseParser#predicate}. 815 | * @param ctx the parse tree 816 | * @return the visitor result 817 | */ 818 | T visitPredicate(SqlBaseParser.PredicateContext ctx); 819 | /** 820 | * Visit a parse tree produced by the {@code valueExpressionDefault} 821 | * labeled alternative in {@link SqlBaseParser#valueExpression}. 822 | * @param ctx the parse tree 823 | * @return the visitor result 824 | */ 825 | T visitValueExpressionDefault(SqlBaseParser.ValueExpressionDefaultContext ctx); 826 | /** 827 | * Visit a parse tree produced by the {@code comparison} 828 | * labeled alternative in {@link SqlBaseParser#valueExpression}. 829 | * @param ctx the parse tree 830 | * @return the visitor result 831 | */ 832 | T visitComparison(SqlBaseParser.ComparisonContext ctx); 833 | /** 834 | * Visit a parse tree produced by the {@code arithmeticBinary} 835 | * labeled alternative in {@link SqlBaseParser#valueExpression}. 836 | * @param ctx the parse tree 837 | * @return the visitor result 838 | */ 839 | T visitArithmeticBinary(SqlBaseParser.ArithmeticBinaryContext ctx); 840 | /** 841 | * Visit a parse tree produced by the {@code arithmeticUnary} 842 | * labeled alternative in {@link SqlBaseParser#valueExpression}. 843 | * @param ctx the parse tree 844 | * @return the visitor result 845 | */ 846 | T visitArithmeticUnary(SqlBaseParser.ArithmeticUnaryContext ctx); 847 | /** 848 | * Visit a parse tree produced by the {@code dereference} 849 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 850 | * @param ctx the parse tree 851 | * @return the visitor result 852 | */ 853 | T visitDereference(SqlBaseParser.DereferenceContext ctx); 854 | /** 855 | * Visit a parse tree produced by the {@code simpleCase} 856 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 857 | * @param ctx the parse tree 858 | * @return the visitor result 859 | */ 860 | T visitSimpleCase(SqlBaseParser.SimpleCaseContext ctx); 861 | /** 862 | * Visit a parse tree produced by the {@code columnReference} 863 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 864 | * @param ctx the parse tree 865 | * @return the visitor result 866 | */ 867 | T visitColumnReference(SqlBaseParser.ColumnReferenceContext ctx); 868 | /** 869 | * Visit a parse tree produced by the {@code rowConstructor} 870 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 871 | * @param ctx the parse tree 872 | * @return the visitor result 873 | */ 874 | T visitRowConstructor(SqlBaseParser.RowConstructorContext ctx); 875 | /** 876 | * Visit a parse tree produced by the {@code star} 877 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 878 | * @param ctx the parse tree 879 | * @return the visitor result 880 | */ 881 | T visitStar(SqlBaseParser.StarContext ctx); 882 | /** 883 | * Visit a parse tree produced by the {@code subscript} 884 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 885 | * @param ctx the parse tree 886 | * @return the visitor result 887 | */ 888 | T visitSubscript(SqlBaseParser.SubscriptContext ctx); 889 | /** 890 | * Visit a parse tree produced by the {@code timeFunctionCall} 891 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 892 | * @param ctx the parse tree 893 | * @return the visitor result 894 | */ 895 | T visitTimeFunctionCall(SqlBaseParser.TimeFunctionCallContext ctx); 896 | /** 897 | * Visit a parse tree produced by the {@code subqueryExpression} 898 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 899 | * @param ctx the parse tree 900 | * @return the visitor result 901 | */ 902 | T visitSubqueryExpression(SqlBaseParser.SubqueryExpressionContext ctx); 903 | /** 904 | * Visit a parse tree produced by the {@code cast} 905 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 906 | * @param ctx the parse tree 907 | * @return the visitor result 908 | */ 909 | T visitCast(SqlBaseParser.CastContext ctx); 910 | /** 911 | * Visit a parse tree produced by the {@code constantDefault} 912 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 913 | * @param ctx the parse tree 914 | * @return the visitor result 915 | */ 916 | T visitConstantDefault(SqlBaseParser.ConstantDefaultContext ctx); 917 | /** 918 | * Visit a parse tree produced by the {@code parenthesizedExpression} 919 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 920 | * @param ctx the parse tree 921 | * @return the visitor result 922 | */ 923 | T visitParenthesizedExpression(SqlBaseParser.ParenthesizedExpressionContext ctx); 924 | /** 925 | * Visit a parse tree produced by the {@code functionCall} 926 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 927 | * @param ctx the parse tree 928 | * @return the visitor result 929 | */ 930 | T visitFunctionCall(SqlBaseParser.FunctionCallContext ctx); 931 | /** 932 | * Visit a parse tree produced by the {@code searchedCase} 933 | * labeled alternative in {@link SqlBaseParser#primaryExpression}. 934 | * @param ctx the parse tree 935 | * @return the visitor result 936 | */ 937 | T visitSearchedCase(SqlBaseParser.SearchedCaseContext ctx); 938 | /** 939 | * Visit a parse tree produced by the {@code nullLiteral} 940 | * labeled alternative in {@link SqlBaseParser#constant}. 941 | * @param ctx the parse tree 942 | * @return the visitor result 943 | */ 944 | T visitNullLiteral(SqlBaseParser.NullLiteralContext ctx); 945 | /** 946 | * Visit a parse tree produced by the {@code intervalLiteral} 947 | * labeled alternative in {@link SqlBaseParser#constant}. 948 | * @param ctx the parse tree 949 | * @return the visitor result 950 | */ 951 | T visitIntervalLiteral(SqlBaseParser.IntervalLiteralContext ctx); 952 | /** 953 | * Visit a parse tree produced by the {@code typeConstructor} 954 | * labeled alternative in {@link SqlBaseParser#constant}. 955 | * @param ctx the parse tree 956 | * @return the visitor result 957 | */ 958 | T visitTypeConstructor(SqlBaseParser.TypeConstructorContext ctx); 959 | /** 960 | * Visit a parse tree produced by the {@code numericLiteral} 961 | * labeled alternative in {@link SqlBaseParser#constant}. 962 | * @param ctx the parse tree 963 | * @return the visitor result 964 | */ 965 | T visitNumericLiteral(SqlBaseParser.NumericLiteralContext ctx); 966 | /** 967 | * Visit a parse tree produced by the {@code booleanLiteral} 968 | * labeled alternative in {@link SqlBaseParser#constant}. 969 | * @param ctx the parse tree 970 | * @return the visitor result 971 | */ 972 | T visitBooleanLiteral(SqlBaseParser.BooleanLiteralContext ctx); 973 | /** 974 | * Visit a parse tree produced by the {@code stringLiteral} 975 | * labeled alternative in {@link SqlBaseParser#constant}. 976 | * @param ctx the parse tree 977 | * @return the visitor result 978 | */ 979 | T visitStringLiteral(SqlBaseParser.StringLiteralContext ctx); 980 | /** 981 | * Visit a parse tree produced by {@link SqlBaseParser#comparisonOperator}. 982 | * @param ctx the parse tree 983 | * @return the visitor result 984 | */ 985 | T visitComparisonOperator(SqlBaseParser.ComparisonOperatorContext ctx); 986 | /** 987 | * Visit a parse tree produced by {@link SqlBaseParser#arithmeticOperator}. 988 | * @param ctx the parse tree 989 | * @return the visitor result 990 | */ 991 | T visitArithmeticOperator(SqlBaseParser.ArithmeticOperatorContext ctx); 992 | /** 993 | * Visit a parse tree produced by {@link SqlBaseParser#predicateOperator}. 994 | * @param ctx the parse tree 995 | * @return the visitor result 996 | */ 997 | T visitPredicateOperator(SqlBaseParser.PredicateOperatorContext ctx); 998 | /** 999 | * Visit a parse tree produced by {@link SqlBaseParser#booleanValue}. 1000 | * @param ctx the parse tree 1001 | * @return the visitor result 1002 | */ 1003 | T visitBooleanValue(SqlBaseParser.BooleanValueContext ctx); 1004 | /** 1005 | * Visit a parse tree produced by {@link SqlBaseParser#interval}. 1006 | * @param ctx the parse tree 1007 | * @return the visitor result 1008 | */ 1009 | T visitInterval(SqlBaseParser.IntervalContext ctx); 1010 | /** 1011 | * Visit a parse tree produced by {@link SqlBaseParser#intervalField}. 1012 | * @param ctx the parse tree 1013 | * @return the visitor result 1014 | */ 1015 | T visitIntervalField(SqlBaseParser.IntervalFieldContext ctx); 1016 | /** 1017 | * Visit a parse tree produced by {@link SqlBaseParser#intervalValue}. 1018 | * @param ctx the parse tree 1019 | * @return the visitor result 1020 | */ 1021 | T visitIntervalValue(SqlBaseParser.IntervalValueContext ctx); 1022 | /** 1023 | * Visit a parse tree produced by the {@code complexDataType} 1024 | * labeled alternative in {@link SqlBaseParser#dataType}. 1025 | * @param ctx the parse tree 1026 | * @return the visitor result 1027 | */ 1028 | T visitComplexDataType(SqlBaseParser.ComplexDataTypeContext ctx); 1029 | /** 1030 | * Visit a parse tree produced by the {@code primitiveDataType} 1031 | * labeled alternative in {@link SqlBaseParser#dataType}. 1032 | * @param ctx the parse tree 1033 | * @return the visitor result 1034 | */ 1035 | T visitPrimitiveDataType(SqlBaseParser.PrimitiveDataTypeContext ctx); 1036 | /** 1037 | * Visit a parse tree produced by {@link SqlBaseParser#colTypeList}. 1038 | * @param ctx the parse tree 1039 | * @return the visitor result 1040 | */ 1041 | T visitColTypeList(SqlBaseParser.ColTypeListContext ctx); 1042 | /** 1043 | * Visit a parse tree produced by {@link SqlBaseParser#colType}. 1044 | * @param ctx the parse tree 1045 | * @return the visitor result 1046 | */ 1047 | T visitColType(SqlBaseParser.ColTypeContext ctx); 1048 | /** 1049 | * Visit a parse tree produced by {@link SqlBaseParser#complexColTypeList}. 1050 | * @param ctx the parse tree 1051 | * @return the visitor result 1052 | */ 1053 | T visitComplexColTypeList(SqlBaseParser.ComplexColTypeListContext ctx); 1054 | /** 1055 | * Visit a parse tree produced by {@link SqlBaseParser#complexColType}. 1056 | * @param ctx the parse tree 1057 | * @return the visitor result 1058 | */ 1059 | T visitComplexColType(SqlBaseParser.ComplexColTypeContext ctx); 1060 | /** 1061 | * Visit a parse tree produced by {@link SqlBaseParser#whenClause}. 1062 | * @param ctx the parse tree 1063 | * @return the visitor result 1064 | */ 1065 | T visitWhenClause(SqlBaseParser.WhenClauseContext ctx); 1066 | /** 1067 | * Visit a parse tree produced by {@link SqlBaseParser#windows}. 1068 | * @param ctx the parse tree 1069 | * @return the visitor result 1070 | */ 1071 | T visitWindows(SqlBaseParser.WindowsContext ctx); 1072 | /** 1073 | * Visit a parse tree produced by {@link SqlBaseParser#namedWindow}. 1074 | * @param ctx the parse tree 1075 | * @return the visitor result 1076 | */ 1077 | T visitNamedWindow(SqlBaseParser.NamedWindowContext ctx); 1078 | /** 1079 | * Visit a parse tree produced by the {@code windowRef} 1080 | * labeled alternative in {@link SqlBaseParser#windowSpec}. 1081 | * @param ctx the parse tree 1082 | * @return the visitor result 1083 | */ 1084 | T visitWindowRef(SqlBaseParser.WindowRefContext ctx); 1085 | /** 1086 | * Visit a parse tree produced by the {@code windowDef} 1087 | * labeled alternative in {@link SqlBaseParser#windowSpec}. 1088 | * @param ctx the parse tree 1089 | * @return the visitor result 1090 | */ 1091 | T visitWindowDef(SqlBaseParser.WindowDefContext ctx); 1092 | /** 1093 | * Visit a parse tree produced by {@link SqlBaseParser#windowFrame}. 1094 | * @param ctx the parse tree 1095 | * @return the visitor result 1096 | */ 1097 | T visitWindowFrame(SqlBaseParser.WindowFrameContext ctx); 1098 | /** 1099 | * Visit a parse tree produced by {@link SqlBaseParser#frameBound}. 1100 | * @param ctx the parse tree 1101 | * @return the visitor result 1102 | */ 1103 | T visitFrameBound(SqlBaseParser.FrameBoundContext ctx); 1104 | /** 1105 | * Visit a parse tree produced by {@link SqlBaseParser#qualifiedName}. 1106 | * @param ctx the parse tree 1107 | * @return the visitor result 1108 | */ 1109 | T visitQualifiedName(SqlBaseParser.QualifiedNameContext ctx); 1110 | /** 1111 | * Visit a parse tree produced by {@link SqlBaseParser#identifier}. 1112 | * @param ctx the parse tree 1113 | * @return the visitor result 1114 | */ 1115 | T visitIdentifier(SqlBaseParser.IdentifierContext ctx); 1116 | /** 1117 | * Visit a parse tree produced by the {@code unquotedIdentifier} 1118 | * labeled alternative in {@link SqlBaseParser#strictIdentifier}. 1119 | * @param ctx the parse tree 1120 | * @return the visitor result 1121 | */ 1122 | T visitUnquotedIdentifier(SqlBaseParser.UnquotedIdentifierContext ctx); 1123 | /** 1124 | * Visit a parse tree produced by the {@code quotedIdentifierAlternative} 1125 | * labeled alternative in {@link SqlBaseParser#strictIdentifier}. 1126 | * @param ctx the parse tree 1127 | * @return the visitor result 1128 | */ 1129 | T visitQuotedIdentifierAlternative(SqlBaseParser.QuotedIdentifierAlternativeContext ctx); 1130 | /** 1131 | * Visit a parse tree produced by {@link SqlBaseParser#quotedIdentifier}. 1132 | * @param ctx the parse tree 1133 | * @return the visitor result 1134 | */ 1135 | T visitQuotedIdentifier(SqlBaseParser.QuotedIdentifierContext ctx); 1136 | /** 1137 | * Visit a parse tree produced by the {@code decimalLiteral} 1138 | * labeled alternative in {@link SqlBaseParser#number}. 1139 | * @param ctx the parse tree 1140 | * @return the visitor result 1141 | */ 1142 | T visitDecimalLiteral(SqlBaseParser.DecimalLiteralContext ctx); 1143 | /** 1144 | * Visit a parse tree produced by the {@code integerLiteral} 1145 | * labeled alternative in {@link SqlBaseParser#number}. 1146 | * @param ctx the parse tree 1147 | * @return the visitor result 1148 | */ 1149 | T visitIntegerLiteral(SqlBaseParser.IntegerLiteralContext ctx); 1150 | /** 1151 | * Visit a parse tree produced by the {@code bigIntLiteral} 1152 | * labeled alternative in {@link SqlBaseParser#number}. 1153 | * @param ctx the parse tree 1154 | * @return the visitor result 1155 | */ 1156 | T visitBigIntLiteral(SqlBaseParser.BigIntLiteralContext ctx); 1157 | /** 1158 | * Visit a parse tree produced by the {@code smallIntLiteral} 1159 | * labeled alternative in {@link SqlBaseParser#number}. 1160 | * @param ctx the parse tree 1161 | * @return the visitor result 1162 | */ 1163 | T visitSmallIntLiteral(SqlBaseParser.SmallIntLiteralContext ctx); 1164 | /** 1165 | * Visit a parse tree produced by the {@code tinyIntLiteral} 1166 | * labeled alternative in {@link SqlBaseParser#number}. 1167 | * @param ctx the parse tree 1168 | * @return the visitor result 1169 | */ 1170 | T visitTinyIntLiteral(SqlBaseParser.TinyIntLiteralContext ctx); 1171 | /** 1172 | * Visit a parse tree produced by the {@code doubleLiteral} 1173 | * labeled alternative in {@link SqlBaseParser#number}. 1174 | * @param ctx the parse tree 1175 | * @return the visitor result 1176 | */ 1177 | T visitDoubleLiteral(SqlBaseParser.DoubleLiteralContext ctx); 1178 | /** 1179 | * Visit a parse tree produced by the {@code bigDecimalLiteral} 1180 | * labeled alternative in {@link SqlBaseParser#number}. 1181 | * @param ctx the parse tree 1182 | * @return the visitor result 1183 | */ 1184 | T visitBigDecimalLiteral(SqlBaseParser.BigDecimalLiteralContext ctx); 1185 | /** 1186 | * Visit a parse tree produced by {@link SqlBaseParser#nonReserved}. 1187 | * @param ctx the parse tree 1188 | * @return the visitor result 1189 | */ 1190 | T visitNonReserved(SqlBaseParser.NonReservedContext ctx); 1191 | } -------------------------------------------------------------------------------- /src/SqlBase.g4: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | * 14 | * This file is an adaptation of Presto's presto-parser/src/main/antlr4/com/facebook/presto/sql/parser/SqlBase.g4 grammar. 15 | */ 16 | 17 | grammar SqlBase; 18 | 19 | @members { 20 | /** 21 | * Verify whether current token is a valid decimal token (which contains dot). 22 | * Returns true if the character that follows the token is not a digit or letter or underscore. 23 | * 24 | * For example: 25 | * For char stream "2.3", "2." is not a valid decimal token, because it is followed by digit '3'. 26 | * For char stream "2.3_", "2.3" is not a valid decimal token, because it is followed by '_'. 27 | * For char stream "2.3W", "2.3" is not a valid decimal token, because it is followed by 'W'. 28 | * For char stream "12.0D 34.E2+0.12 " 12.0D is a valid decimal token because it is folllowed 29 | * by a space. 34.E2 is a valid decimal token because it is followed by symbol '+' 30 | * which is not a digit or letter or underscore. 31 | */ 32 | public boolean isValidDecimal() { 33 | int nextChar = _input.LA(1); 34 | if (nextChar >= 'A' && nextChar <= 'Z' || nextChar >= '0' && nextChar <= '9' || 35 | nextChar == '_') { 36 | return false; 37 | } else { 38 | return true; 39 | } 40 | } 41 | } 42 | 43 | tokens { 44 | DELIMITER 45 | } 46 | 47 | singleStatement 48 | : statement EOF 49 | ; 50 | 51 | singleExpression 52 | : namedExpression EOF 53 | ; 54 | 55 | singleTableIdentifier 56 | : tableIdentifier EOF 57 | ; 58 | 59 | singleDataType 60 | : dataType EOF 61 | ; 62 | 63 | statement 64 | : query #statementDefault 65 | | USE db=identifier #use 66 | | CREATE DATABASE (IF NOT EXISTS)? identifier 67 | (COMMENT comment=STRING)? locationSpec? 68 | (WITH DBPROPERTIES tablePropertyList)? #createDatabase 69 | | ALTER DATABASE identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties 70 | | DROP DATABASE (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase 71 | | createTableHeader ('(' colTypeList ')')? tableProvider 72 | (OPTIONS tablePropertyList)? 73 | (PARTITIONED BY partitionColumnNames=identifierList)? 74 | bucketSpec? (AS? query)? #createTableUsing 75 | | createTableHeader ('(' columns=colTypeList ')')? 76 | (COMMENT STRING)? 77 | (PARTITIONED BY '(' partitionColumns=colTypeList ')')? 78 | bucketSpec? skewSpec? 79 | rowFormat? createFileFormat? locationSpec? 80 | (TBLPROPERTIES tablePropertyList)? 81 | (AS? query)? #createTable 82 | | CREATE TABLE (IF NOT EXISTS)? target=tableIdentifier 83 | LIKE source=tableIdentifier #createTableLike 84 | | ANALYZE TABLE tableIdentifier partitionSpec? COMPUTE STATISTICS 85 | (identifier | FOR COLUMNS identifierSeq)? #analyze 86 | | ALTER (TABLE | VIEW) from=tableIdentifier 87 | RENAME TO to=tableIdentifier #renameTable 88 | | ALTER (TABLE | VIEW) tableIdentifier 89 | SET TBLPROPERTIES tablePropertyList #setTableProperties 90 | | ALTER (TABLE | VIEW) tableIdentifier 91 | UNSET TBLPROPERTIES (IF EXISTS)? tablePropertyList #unsetTableProperties 92 | | ALTER TABLE tableIdentifier (partitionSpec)? 93 | SET SERDE STRING (WITH SERDEPROPERTIES tablePropertyList)? #setTableSerDe 94 | | ALTER TABLE tableIdentifier (partitionSpec)? 95 | SET SERDEPROPERTIES tablePropertyList #setTableSerDe 96 | | ALTER TABLE tableIdentifier ADD (IF NOT EXISTS)? 97 | partitionSpecLocation+ #addTablePartition 98 | | ALTER VIEW tableIdentifier ADD (IF NOT EXISTS)? 99 | partitionSpec+ #addTablePartition 100 | | ALTER TABLE tableIdentifier 101 | from=partitionSpec RENAME TO to=partitionSpec #renameTablePartition 102 | | ALTER TABLE tableIdentifier 103 | DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* PURGE? #dropTablePartitions 104 | | ALTER VIEW tableIdentifier 105 | DROP (IF EXISTS)? partitionSpec (',' partitionSpec)* #dropTablePartitions 106 | | ALTER TABLE tableIdentifier partitionSpec? SET locationSpec #setTableLocation 107 | | ALTER TABLE tableIdentifier RECOVER PARTITIONS #recoverPartitions 108 | | DROP TABLE (IF EXISTS)? tableIdentifier PURGE? #dropTable 109 | | DROP VIEW (IF EXISTS)? tableIdentifier #dropTable 110 | | CREATE (OR REPLACE)? (GLOBAL? TEMPORARY)? 111 | VIEW (IF NOT EXISTS)? tableIdentifier 112 | identifierCommentList? (COMMENT STRING)? 113 | (PARTITIONED ON identifierList)? 114 | (TBLPROPERTIES tablePropertyList)? AS query #createView 115 | | CREATE (OR REPLACE)? GLOBAL? TEMPORARY VIEW 116 | tableIdentifier ('(' colTypeList ')')? tableProvider 117 | (OPTIONS tablePropertyList)? #createTempViewUsing 118 | | ALTER VIEW tableIdentifier AS? query #alterViewQuery 119 | | CREATE TEMPORARY? FUNCTION qualifiedName AS className=STRING 120 | (USING resource (',' resource)*)? #createFunction 121 | | DROP TEMPORARY? FUNCTION (IF EXISTS)? qualifiedName #dropFunction 122 | | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN)? statement #explain 123 | | SHOW TABLES ((FROM | IN) db=identifier)? 124 | (LIKE? pattern=STRING)? #showTables 125 | | SHOW DATABASES (LIKE pattern=STRING)? #showDatabases 126 | | SHOW TBLPROPERTIES table=tableIdentifier 127 | ('(' key=tablePropertyKey ')')? #showTblProperties 128 | | SHOW COLUMNS (FROM | IN) tableIdentifier 129 | ((FROM | IN) db=identifier)? #showColumns 130 | | SHOW PARTITIONS tableIdentifier partitionSpec? #showPartitions 131 | | SHOW identifier? FUNCTIONS 132 | (LIKE? (qualifiedName | pattern=STRING))? #showFunctions 133 | | SHOW CREATE TABLE tableIdentifier #showCreateTable 134 | | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction 135 | | (DESC | DESCRIBE) DATABASE EXTENDED? identifier #describeDatabase 136 | | (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)? 137 | tableIdentifier partitionSpec? describeColName? #describeTable 138 | | REFRESH TABLE tableIdentifier #refreshTable 139 | | REFRESH .*? #refreshResource 140 | | CACHE LAZY? TABLE tableIdentifier (AS? query)? #cacheTable 141 | | UNCACHE TABLE (IF EXISTS)? tableIdentifier #uncacheTable 142 | | CLEAR CACHE #clearCache 143 | | LOAD DATA LOCAL? INPATH path=STRING OVERWRITE? INTO TABLE 144 | tableIdentifier partitionSpec? #loadData 145 | | TRUNCATE TABLE tableIdentifier partitionSpec? #truncateTable 146 | | MSCK REPAIR TABLE tableIdentifier #repairTable 147 | | op=(ADD | LIST) identifier .*? #manageResource 148 | | SET ROLE .*? #failNativeCommand 149 | | SET .*? #setConfiguration 150 | | RESET #resetConfiguration 151 | | unsupportedHiveNativeCommands .*? #failNativeCommand 152 | ; 153 | 154 | unsupportedHiveNativeCommands 155 | : kw1=CREATE kw2=ROLE 156 | | kw1=DROP kw2=ROLE 157 | | kw1=GRANT kw2=ROLE? 158 | | kw1=REVOKE kw2=ROLE? 159 | | kw1=SHOW kw2=GRANT 160 | | kw1=SHOW kw2=ROLE kw3=GRANT? 161 | | kw1=SHOW kw2=PRINCIPALS 162 | | kw1=SHOW kw2=ROLES 163 | | kw1=SHOW kw2=CURRENT kw3=ROLES 164 | | kw1=EXPORT kw2=TABLE 165 | | kw1=IMPORT kw2=TABLE 166 | | kw1=SHOW kw2=COMPACTIONS 167 | | kw1=SHOW kw2=CREATE kw3=TABLE 168 | | kw1=SHOW kw2=TRANSACTIONS 169 | | kw1=SHOW kw2=INDEXES 170 | | kw1=SHOW kw2=LOCKS 171 | | kw1=CREATE kw2=INDEX 172 | | kw1=DROP kw2=INDEX 173 | | kw1=ALTER kw2=INDEX 174 | | kw1=LOCK kw2=TABLE 175 | | kw1=LOCK kw2=DATABASE 176 | | kw1=UNLOCK kw2=TABLE 177 | | kw1=UNLOCK kw2=DATABASE 178 | | kw1=CREATE kw2=TEMPORARY kw3=MACRO 179 | | kw1=DROP kw2=TEMPORARY kw3=MACRO 180 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=CLUSTERED 181 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=CLUSTERED kw4=BY 182 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SORTED 183 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=SKEWED kw4=BY 184 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=SKEWED 185 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=NOT kw4=STORED kw5=AS kw6=DIRECTORIES 186 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=SET kw4=SKEWED kw5=LOCATION 187 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=EXCHANGE kw4=PARTITION 188 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=ARCHIVE kw4=PARTITION 189 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=UNARCHIVE kw4=PARTITION 190 | | kw1=ALTER kw2=TABLE tableIdentifier kw3=TOUCH 191 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=COMPACT 192 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CONCATENATE 193 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=SET kw4=FILEFORMAT 194 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=ADD kw4=COLUMNS 195 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=CHANGE kw4=COLUMN? 196 | | kw1=ALTER kw2=TABLE tableIdentifier partitionSpec? kw3=REPLACE kw4=COLUMNS 197 | | kw1=START kw2=TRANSACTION 198 | | kw1=COMMIT 199 | | kw1=ROLLBACK 200 | | kw1=DFS 201 | | kw1=DELETE kw2=FROM 202 | ; 203 | 204 | createTableHeader 205 | : CREATE TEMPORARY? EXTERNAL? TABLE (IF NOT EXISTS)? tableIdentifier 206 | ; 207 | 208 | bucketSpec 209 | : CLUSTERED BY identifierList 210 | (SORTED BY orderedIdentifierList)? 211 | INTO INTEGER_VALUE BUCKETS 212 | ; 213 | 214 | skewSpec 215 | : SKEWED BY identifierList 216 | ON (constantList | nestedConstantList) 217 | (STORED AS DIRECTORIES)? 218 | ; 219 | 220 | locationSpec 221 | : LOCATION STRING 222 | ; 223 | 224 | query 225 | : ctes? queryNoWith 226 | ; 227 | 228 | insertInto 229 | : INSERT OVERWRITE TABLE tableIdentifier (partitionSpec (IF NOT EXISTS)?)? 230 | | INSERT INTO TABLE? tableIdentifier partitionSpec? 231 | ; 232 | 233 | partitionSpecLocation 234 | : partitionSpec locationSpec? 235 | ; 236 | 237 | partitionSpec 238 | : PARTITION '(' partitionVal (',' partitionVal)* ')' 239 | ; 240 | 241 | partitionVal 242 | : identifier (EQ constant)? 243 | ; 244 | 245 | describeFuncName 246 | : qualifiedName 247 | | STRING 248 | | comparisonOperator 249 | | arithmeticOperator 250 | | predicateOperator 251 | ; 252 | 253 | describeColName 254 | : identifier ('.' (identifier | STRING))* 255 | ; 256 | 257 | ctes 258 | : WITH namedQuery (',' namedQuery)* 259 | ; 260 | 261 | namedQuery 262 | : name=identifier AS? '(' query ')' 263 | ; 264 | 265 | tableProvider 266 | : USING qualifiedName 267 | ; 268 | 269 | tablePropertyList 270 | : '(' tableProperty (',' tableProperty)* ')' 271 | ; 272 | 273 | tableProperty 274 | : key=tablePropertyKey (EQ? value=tablePropertyValue)? 275 | ; 276 | 277 | tablePropertyKey 278 | : identifier ('.' identifier)* 279 | | STRING 280 | ; 281 | 282 | tablePropertyValue 283 | : INTEGER_VALUE 284 | | DECIMAL_VALUE 285 | | booleanValue 286 | | STRING 287 | ; 288 | 289 | constantList 290 | : '(' constant (',' constant)* ')' 291 | ; 292 | 293 | nestedConstantList 294 | : '(' constantList (',' constantList)* ')' 295 | ; 296 | 297 | createFileFormat 298 | : STORED AS fileFormat 299 | | STORED BY storageHandler 300 | ; 301 | 302 | fileFormat 303 | : INPUTFORMAT inFmt=STRING OUTPUTFORMAT outFmt=STRING #tableFileFormat 304 | | identifier #genericFileFormat 305 | ; 306 | 307 | storageHandler 308 | : STRING (WITH SERDEPROPERTIES tablePropertyList)? 309 | ; 310 | 311 | resource 312 | : identifier STRING 313 | ; 314 | 315 | queryNoWith 316 | : insertInto? queryTerm queryOrganization #singleInsertQuery 317 | | fromClause multiInsertQueryBody+ #multiInsertQuery 318 | ; 319 | 320 | queryOrganization 321 | : (ORDER BY order+=sortItem (',' order+=sortItem)*)? 322 | (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)? 323 | (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)? 324 | (SORT BY sort+=sortItem (',' sort+=sortItem)*)? 325 | windows? 326 | (LIMIT limit=expression)? 327 | ; 328 | 329 | multiInsertQueryBody 330 | : insertInto? 331 | querySpecification 332 | queryOrganization 333 | ; 334 | 335 | queryTerm 336 | : queryPrimary #queryTermDefault 337 | | left=queryTerm operator=(INTERSECT | UNION | EXCEPT | SETMINUS) setQuantifier? right=queryTerm #setOperation 338 | ; 339 | 340 | queryPrimary 341 | : querySpecification #queryPrimaryDefault 342 | | TABLE tableIdentifier #table 343 | | inlineTable #inlineTableDefault1 344 | | '(' queryNoWith ')' #subquery 345 | ; 346 | 347 | sortItem 348 | : expression ordering=(ASC | DESC)? (NULLS nullOrder=(LAST | FIRST))? 349 | ; 350 | 351 | querySpecification 352 | : (((SELECT kind=TRANSFORM '(' namedExpressionSeq ')' 353 | | kind=MAP namedExpressionSeq 354 | | kind=REDUCE namedExpressionSeq)) 355 | inRowFormat=rowFormat? 356 | (RECORDWRITER recordWriter=STRING)? 357 | USING script=STRING 358 | (AS (identifierSeq | colTypeList | ('(' (identifierSeq | colTypeList) ')')))? 359 | outRowFormat=rowFormat? 360 | (RECORDREADER recordReader=STRING)? 361 | fromClause? 362 | (WHERE where=booleanExpression)?) 363 | | ((kind=SELECT setQuantifier? namedExpressionSeq fromClause? 364 | | fromClause (kind=SELECT setQuantifier? namedExpressionSeq)?) 365 | lateralView* 366 | (WHERE where=booleanExpression)? 367 | aggregation? 368 | (HAVING having=booleanExpression)? 369 | windows?) 370 | ; 371 | 372 | fromClause 373 | : FROM relation (',' relation)* lateralView* 374 | ; 375 | 376 | aggregation 377 | : GROUP BY groupingExpressions+=expression (',' groupingExpressions+=expression)* ( 378 | WITH kind=ROLLUP 379 | | WITH kind=CUBE 380 | | kind=GROUPING SETS '(' groupingSet (',' groupingSet)* ')')? 381 | ; 382 | 383 | groupingSet 384 | : '(' (expression (',' expression)*)? ')' 385 | | expression 386 | ; 387 | 388 | lateralView 389 | : LATERAL VIEW (OUTER)? qualifiedName '(' (expression (',' expression)*)? ')' tblName=identifier (AS? colName+=identifier (',' colName+=identifier)*)? 390 | ; 391 | 392 | setQuantifier 393 | : DISTINCT 394 | | ALL 395 | ; 396 | 397 | relation 398 | : relationPrimary joinRelation* 399 | ; 400 | 401 | joinRelation 402 | : (joinType) JOIN right=relationPrimary joinCriteria? 403 | | NATURAL joinType JOIN right=relationPrimary 404 | ; 405 | 406 | joinType 407 | : INNER? 408 | | CROSS 409 | | LEFT OUTER? 410 | | LEFT SEMI 411 | | RIGHT OUTER? 412 | | FULL OUTER? 413 | | LEFT? ANTI 414 | ; 415 | 416 | joinCriteria 417 | : ON booleanExpression 418 | | USING '(' identifier (',' identifier)* ')' 419 | ; 420 | 421 | sample 422 | : TABLESAMPLE '(' 423 | ( (percentage=(INTEGER_VALUE | DECIMAL_VALUE) sampleType=PERCENTLIT) 424 | | (expression sampleType=ROWS) 425 | | sampleType=BYTELENGTH_LITERAL 426 | | (sampleType=BUCKET numerator=INTEGER_VALUE OUT OF denominator=INTEGER_VALUE (ON (identifier | qualifiedName '(' ')'))?)) 427 | ')' 428 | ; 429 | 430 | identifierList 431 | : '(' identifierSeq ')' 432 | ; 433 | 434 | identifierSeq 435 | : identifier (',' identifier)* 436 | ; 437 | 438 | orderedIdentifierList 439 | : '(' orderedIdentifier (',' orderedIdentifier)* ')' 440 | ; 441 | 442 | orderedIdentifier 443 | : identifier ordering=(ASC | DESC)? 444 | ; 445 | 446 | identifierCommentList 447 | : '(' identifierComment (',' identifierComment)* ')' 448 | ; 449 | 450 | identifierComment 451 | : identifier (COMMENT STRING)? 452 | ; 453 | 454 | relationPrimary 455 | : tableIdentifier sample? (AS? strictIdentifier)? #tableName 456 | | '(' queryNoWith ')' sample? (AS? strictIdentifier)? #aliasedQuery 457 | | '(' relation ')' sample? (AS? strictIdentifier)? #aliasedRelation 458 | | inlineTable #inlineTableDefault2 459 | | identifier '(' (expression (',' expression)*)? ')' #tableValuedFunction 460 | ; 461 | 462 | inlineTable 463 | : VALUES expression (',' expression)* (AS? identifier identifierList?)? 464 | ; 465 | 466 | rowFormat 467 | : ROW FORMAT SERDE name=STRING (WITH SERDEPROPERTIES props=tablePropertyList)? #rowFormatSerde 468 | | ROW FORMAT DELIMITED 469 | (FIELDS TERMINATED BY fieldsTerminatedBy=STRING (ESCAPED BY escapedBy=STRING)?)? 470 | (COLLECTION ITEMS TERMINATED BY collectionItemsTerminatedBy=STRING)? 471 | (MAP KEYS TERMINATED BY keysTerminatedBy=STRING)? 472 | (LINES TERMINATED BY linesSeparatedBy=STRING)? 473 | (NULL DEFINED AS nullDefinedAs=STRING)? #rowFormatDelimited 474 | ; 475 | 476 | tableIdentifier 477 | : (db=identifier '.')? table=identifier 478 | ; 479 | 480 | namedExpression 481 | : expression (AS? (identifier | identifierList))? 482 | ; 483 | 484 | namedExpressionSeq 485 | : namedExpression (',' namedExpression)* 486 | ; 487 | 488 | expression 489 | : booleanExpression 490 | ; 491 | 492 | booleanExpression 493 | : NOT booleanExpression #logicalNot 494 | | predicated #booleanDefault 495 | | left=booleanExpression operator=AND right=booleanExpression #logicalBinary 496 | | left=booleanExpression operator=OR right=booleanExpression #logicalBinary 497 | | EXISTS '(' query ')' #exists 498 | ; 499 | 500 | // workaround for: 501 | // https://github.com/antlr/antlr4/issues/780 502 | // https://github.com/antlr/antlr4/issues/781 503 | predicated 504 | : valueExpression predicate? 505 | ; 506 | 507 | predicate 508 | : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression 509 | | NOT? kind=IN '(' expression (',' expression)* ')' 510 | | NOT? kind=IN '(' query ')' 511 | | NOT? kind=(RLIKE | LIKE) pattern=valueExpression 512 | | IS NOT? kind=NULL 513 | ; 514 | 515 | valueExpression 516 | : primaryExpression #valueExpressionDefault 517 | | operator=(MINUS | PLUS | TILDE) valueExpression #arithmeticUnary 518 | | left=valueExpression operator=(ASTERISK | SLASH | PERCENT | DIV) right=valueExpression #arithmeticBinary 519 | | left=valueExpression operator=(PLUS | MINUS) right=valueExpression #arithmeticBinary 520 | | left=valueExpression operator=AMPERSAND right=valueExpression #arithmeticBinary 521 | | left=valueExpression operator=HAT right=valueExpression #arithmeticBinary 522 | | left=valueExpression operator=PIPE right=valueExpression #arithmeticBinary 523 | | left=valueExpression operator=RSHIFT right=valueExpression #arithmeticBinary 524 | | left=valueExpression comparisonOperator right=valueExpression #comparison 525 | ; 526 | 527 | primaryExpression 528 | : name=(CURRENT_DATE | CURRENT_TIMESTAMP) #timeFunctionCall 529 | | CASE value=expression whenClause+ (ELSE elseExpression=expression)? END #simpleCase 530 | | CASE whenClause+ (ELSE elseExpression=expression)? END #searchedCase 531 | | CAST '(' expression AS dataType ')' #cast 532 | | constant #constantDefault 533 | | ASTERISK #star 534 | | qualifiedName '.' ASTERISK #star 535 | | '(' expression (',' expression)+ ')' #rowConstructor 536 | | '(' query ')' #subqueryExpression 537 | | qualifiedName '(' (setQuantifier? expression (',' expression)*)? ')' (OVER windowSpec)? #functionCall 538 | | value=primaryExpression '[' index=valueExpression ']' #subscript 539 | | identifier #columnReference 540 | | base=primaryExpression '.' fieldName=identifier #dereference 541 | | '(' expression ')' #parenthesizedExpression 542 | ; 543 | 544 | constant 545 | : NULL #nullLiteral 546 | | interval #intervalLiteral 547 | | identifier STRING #typeConstructor 548 | | number #numericLiteral 549 | | booleanValue #booleanLiteral 550 | | STRING+ #stringLiteral 551 | ; 552 | 553 | comparisonOperator 554 | : EQ | NEQ | NEQJ | LT | LTE | GT | GTE | NSEQ 555 | ; 556 | 557 | arithmeticOperator 558 | : PLUS | MINUS | ASTERISK | SLASH | PERCENT | DIV | TILDE | AMPERSAND | PIPE | HAT | RSHIFT 559 | ; 560 | 561 | predicateOperator 562 | : OR | AND | IN | NOT 563 | ; 564 | 565 | booleanValue 566 | : TRUE | FALSE 567 | ; 568 | 569 | interval 570 | : INTERVAL intervalField* 571 | ; 572 | 573 | intervalField 574 | : value=intervalValue unit=identifier (TO to=identifier)? 575 | ; 576 | 577 | intervalValue 578 | : (PLUS | MINUS)? (INTEGER_VALUE | DECIMAL_VALUE) 579 | | STRING 580 | ; 581 | 582 | dataType 583 | : complex=ARRAY '<' dataType '>' #complexDataType 584 | | complex=MAP '<' dataType ',' dataType '>' #complexDataType 585 | | complex=STRUCT ('<' complexColTypeList? '>' | NEQ) #complexDataType 586 | | identifier ('(' INTEGER_VALUE (',' INTEGER_VALUE)* ')')? #primitiveDataType 587 | ; 588 | 589 | colTypeList 590 | : colType (',' colType)* 591 | ; 592 | 593 | colType 594 | : identifier dataType (COMMENT STRING)? 595 | ; 596 | 597 | complexColTypeList 598 | : complexColType (',' complexColType)* 599 | ; 600 | 601 | complexColType 602 | : identifier ':' dataType (COMMENT STRING)? 603 | ; 604 | 605 | whenClause 606 | : WHEN condition=expression THEN result=expression 607 | ; 608 | 609 | windows 610 | : WINDOW namedWindow (',' namedWindow)* 611 | ; 612 | 613 | namedWindow 614 | : identifier AS windowSpec 615 | ; 616 | 617 | windowSpec 618 | : name=identifier #windowRef 619 | | '(' 620 | ( CLUSTER BY partition+=expression (',' partition+=expression)* 621 | | ((PARTITION | DISTRIBUTE) BY partition+=expression (',' partition+=expression)*)? 622 | ((ORDER | SORT) BY sortItem (',' sortItem)*)?) 623 | windowFrame? 624 | ')' #windowDef 625 | ; 626 | 627 | windowFrame 628 | : frameType=RANGE start=frameBound 629 | | frameType=ROWS start=frameBound 630 | | frameType=RANGE BETWEEN start=frameBound AND end=frameBound 631 | | frameType=ROWS BETWEEN start=frameBound AND end=frameBound 632 | ; 633 | 634 | frameBound 635 | : UNBOUNDED boundType=(PRECEDING | FOLLOWING) 636 | | boundType=CURRENT ROW 637 | | expression boundType=(PRECEDING | FOLLOWING) 638 | ; 639 | 640 | qualifiedName 641 | : identifier ('.' identifier)* 642 | ; 643 | 644 | identifier 645 | : strictIdentifier 646 | | ANTI | FULL | INNER | LEFT | SEMI | RIGHT | NATURAL | JOIN | CROSS | ON 647 | | UNION | INTERSECT | EXCEPT | SETMINUS 648 | ; 649 | 650 | strictIdentifier 651 | : IDENTIFIER #unquotedIdentifier 652 | | quotedIdentifier #quotedIdentifierAlternative 653 | | nonReserved #unquotedIdentifier 654 | ; 655 | 656 | quotedIdentifier 657 | : BACKQUOTED_IDENTIFIER 658 | ; 659 | 660 | number 661 | : MINUS? DECIMAL_VALUE #decimalLiteral 662 | | MINUS? INTEGER_VALUE #integerLiteral 663 | | MINUS? BIGINT_LITERAL #bigIntLiteral 664 | | MINUS? SMALLINT_LITERAL #smallIntLiteral 665 | | MINUS? TINYINT_LITERAL #tinyIntLiteral 666 | | MINUS? DOUBLE_LITERAL #doubleLiteral 667 | | MINUS? BIGDECIMAL_LITERAL #bigDecimalLiteral 668 | ; 669 | 670 | nonReserved 671 | : SHOW | TABLES | COLUMNS | COLUMN | PARTITIONS | FUNCTIONS | DATABASES 672 | | ADD 673 | | OVER | PARTITION | RANGE | ROWS | PRECEDING | FOLLOWING | CURRENT | ROW | LAST | FIRST 674 | | MAP | ARRAY | STRUCT 675 | | LATERAL | WINDOW | REDUCE | TRANSFORM | USING | SERDE | SERDEPROPERTIES | RECORDREADER 676 | | DELIMITED | FIELDS | TERMINATED | COLLECTION | ITEMS | KEYS | ESCAPED | LINES | SEPARATED 677 | | EXTENDED | REFRESH | CLEAR | CACHE | UNCACHE | LAZY | GLOBAL | TEMPORARY | OPTIONS 678 | | GROUPING | CUBE | ROLLUP 679 | | EXPLAIN | FORMAT | LOGICAL | FORMATTED | CODEGEN 680 | | TABLESAMPLE | USE | TO | BUCKET | PERCENTLIT | OUT | OF 681 | | SET | RESET 682 | | VIEW | REPLACE 683 | | IF 684 | | NO | DATA 685 | | START | TRANSACTION | COMMIT | ROLLBACK 686 | | SORT | CLUSTER | DISTRIBUTE | UNSET | TBLPROPERTIES | SKEWED | STORED | DIRECTORIES | LOCATION 687 | | EXCHANGE | ARCHIVE | UNARCHIVE | FILEFORMAT | TOUCH | COMPACT | CONCATENATE | CHANGE 688 | | CASCADE | RESTRICT | BUCKETS | CLUSTERED | SORTED | PURGE | INPUTFORMAT | OUTPUTFORMAT 689 | | DBPROPERTIES | DFS | TRUNCATE | COMPUTE | LIST 690 | | STATISTICS | ANALYZE | PARTITIONED | EXTERNAL | DEFINED | RECORDWRITER 691 | | REVOKE | GRANT | LOCK | UNLOCK | MSCK | REPAIR | RECOVER | EXPORT | IMPORT | LOAD | VALUES | COMMENT | ROLE 692 | | ROLES | COMPACTIONS | PRINCIPALS | TRANSACTIONS | INDEX | INDEXES | LOCKS | OPTION | LOCAL | INPATH 693 | | ASC | DESC | LIMIT | RENAME | SETS 694 | | AT | NULLS | OVERWRITE | ALL | ALTER | AS | BETWEEN | BY | CREATE | DELETE 695 | | DESCRIBE | DROP | EXISTS | FALSE | FOR | GROUP | IN | INSERT | INTO | IS |LIKE 696 | | NULL | ORDER | OUTER | TABLE | TRUE | WITH | RLIKE 697 | | AND | CASE | CAST | DISTINCT | DIV | ELSE | END | FUNCTION | INTERVAL | MACRO | OR | STRATIFY | THEN 698 | | UNBOUNDED | WHEN 699 | | DATABASE | SELECT | FROM | WHERE | HAVING | TO | TABLE | WITH | NOT | CURRENT_DATE | CURRENT_TIMESTAMP 700 | ; 701 | 702 | SELECT: 'SELECT'; 703 | FROM: 'FROM'; 704 | ADD: 'ADD'; 705 | AS: 'AS'; 706 | ALL: 'ALL'; 707 | DISTINCT: 'DISTINCT'; 708 | WHERE: 'WHERE'; 709 | GROUP: 'GROUP'; 710 | BY: 'BY'; 711 | GROUPING: 'GROUPING'; 712 | SETS: 'SETS'; 713 | CUBE: 'CUBE'; 714 | ROLLUP: 'ROLLUP'; 715 | ORDER: 'ORDER'; 716 | HAVING: 'HAVING'; 717 | LIMIT: 'LIMIT'; 718 | AT: 'AT'; 719 | OR: 'OR'; 720 | AND: 'AND'; 721 | IN: 'IN'; 722 | NOT: 'NOT' | '!'; 723 | NO: 'NO'; 724 | EXISTS: 'EXISTS'; 725 | BETWEEN: 'BETWEEN'; 726 | LIKE: 'LIKE'; 727 | RLIKE: 'RLIKE' | 'REGEXP'; 728 | IS: 'IS'; 729 | NULL: 'NULL'; 730 | TRUE: 'TRUE'; 731 | FALSE: 'FALSE'; 732 | NULLS: 'NULLS'; 733 | ASC: 'ASC'; 734 | DESC: 'DESC'; 735 | FOR: 'FOR'; 736 | INTERVAL: 'INTERVAL'; 737 | CASE: 'CASE'; 738 | WHEN: 'WHEN'; 739 | THEN: 'THEN'; 740 | ELSE: 'ELSE'; 741 | END: 'END'; 742 | JOIN: 'JOIN'; 743 | CROSS: 'CROSS'; 744 | OUTER: 'OUTER'; 745 | INNER: 'INNER'; 746 | LEFT: 'LEFT'; 747 | SEMI: 'SEMI'; 748 | RIGHT: 'RIGHT'; 749 | FULL: 'FULL'; 750 | NATURAL: 'NATURAL'; 751 | ON: 'ON'; 752 | LATERAL: 'LATERAL'; 753 | WINDOW: 'WINDOW'; 754 | OVER: 'OVER'; 755 | PARTITION: 'PARTITION'; 756 | RANGE: 'RANGE'; 757 | ROWS: 'ROWS'; 758 | UNBOUNDED: 'UNBOUNDED'; 759 | PRECEDING: 'PRECEDING'; 760 | FOLLOWING: 'FOLLOWING'; 761 | CURRENT: 'CURRENT'; 762 | FIRST: 'FIRST'; 763 | LAST: 'LAST'; 764 | ROW: 'ROW'; 765 | WITH: 'WITH'; 766 | VALUES: 'VALUES'; 767 | CREATE: 'CREATE'; 768 | TABLE: 'TABLE'; 769 | VIEW: 'VIEW'; 770 | REPLACE: 'REPLACE'; 771 | INSERT: 'INSERT'; 772 | DELETE: 'DELETE'; 773 | INTO: 'INTO'; 774 | DESCRIBE: 'DESCRIBE'; 775 | EXPLAIN: 'EXPLAIN'; 776 | FORMAT: 'FORMAT'; 777 | LOGICAL: 'LOGICAL'; 778 | CODEGEN: 'CODEGEN'; 779 | CAST: 'CAST'; 780 | SHOW: 'SHOW'; 781 | TABLES: 'TABLES'; 782 | COLUMNS: 'COLUMNS'; 783 | COLUMN: 'COLUMN'; 784 | USE: 'USE'; 785 | PARTITIONS: 'PARTITIONS'; 786 | FUNCTIONS: 'FUNCTIONS'; 787 | DROP: 'DROP'; 788 | UNION: 'UNION'; 789 | EXCEPT: 'EXCEPT'; 790 | SETMINUS: 'MINUS'; 791 | INTERSECT: 'INTERSECT'; 792 | TO: 'TO'; 793 | TABLESAMPLE: 'TABLESAMPLE'; 794 | STRATIFY: 'STRATIFY'; 795 | ALTER: 'ALTER'; 796 | RENAME: 'RENAME'; 797 | ARRAY: 'ARRAY'; 798 | MAP: 'MAP'; 799 | STRUCT: 'STRUCT'; 800 | COMMENT: 'COMMENT'; 801 | SET: 'SET'; 802 | RESET: 'RESET'; 803 | DATA: 'DATA'; 804 | START: 'START'; 805 | TRANSACTION: 'TRANSACTION'; 806 | COMMIT: 'COMMIT'; 807 | ROLLBACK: 'ROLLBACK'; 808 | MACRO: 'MACRO'; 809 | 810 | IF: 'IF'; 811 | 812 | EQ : '=' | '=='; 813 | NSEQ: '<=>'; 814 | NEQ : '<>'; 815 | NEQJ: '!='; 816 | LT : '<'; 817 | LTE : '<=' | '!>'; 818 | GT : '>'; 819 | GTE : '>=' | '!<'; 820 | 821 | PLUS: '+'; 822 | MINUS: '-'; 823 | ASTERISK: '*'; 824 | SLASH: '/' | '//'; 825 | PERCENT: '%'; 826 | DIV: 'DIV'; 827 | TILDE: '~'; 828 | AMPERSAND: '&'; 829 | PIPE: '|'; 830 | HAT: '^'; 831 | RSHIFT: '>>'; 832 | 833 | PERCENTLIT: 'PERCENT'; 834 | BUCKET: 'BUCKET'; 835 | OUT: 'OUT'; 836 | OF: 'OF'; 837 | 838 | SORT: 'SORT'; 839 | CLUSTER: 'CLUSTER'; 840 | DISTRIBUTE: 'DISTRIBUTE'; 841 | OVERWRITE: 'OVERWRITE'; 842 | TRANSFORM: 'TRANSFORM'; 843 | REDUCE: 'REDUCE'; 844 | USING: 'USING'; 845 | SERDE: 'SERDE'; 846 | SERDEPROPERTIES: 'SERDEPROPERTIES'; 847 | RECORDREADER: 'RECORDREADER'; 848 | RECORDWRITER: 'RECORDWRITER'; 849 | DELIMITED: 'DELIMITED'; 850 | FIELDS: 'FIELDS'; 851 | TERMINATED: 'TERMINATED'; 852 | COLLECTION: 'COLLECTION'; 853 | ITEMS: 'ITEMS'; 854 | KEYS: 'KEYS'; 855 | ESCAPED: 'ESCAPED'; 856 | LINES: 'LINES'; 857 | SEPARATED: 'SEPARATED'; 858 | FUNCTION: 'FUNCTION'; 859 | EXTENDED: 'EXTENDED'; 860 | REFRESH: 'REFRESH'; 861 | CLEAR: 'CLEAR'; 862 | CACHE: 'CACHE'; 863 | UNCACHE: 'UNCACHE'; 864 | LAZY: 'LAZY'; 865 | FORMATTED: 'FORMATTED'; 866 | GLOBAL: 'GLOBAL'; 867 | TEMPORARY: 'TEMPORARY' | 'TEMP'; 868 | OPTIONS: 'OPTIONS'; 869 | UNSET: 'UNSET'; 870 | TBLPROPERTIES: 'TBLPROPERTIES'; 871 | DBPROPERTIES: 'DBPROPERTIES'; 872 | BUCKETS: 'BUCKETS'; 873 | SKEWED: 'SKEWED'; 874 | STORED: 'STORED'; 875 | DIRECTORIES: 'DIRECTORIES'; 876 | LOCATION: 'LOCATION'; 877 | EXCHANGE: 'EXCHANGE'; 878 | ARCHIVE: 'ARCHIVE'; 879 | UNARCHIVE: 'UNARCHIVE'; 880 | FILEFORMAT: 'FILEFORMAT'; 881 | TOUCH: 'TOUCH'; 882 | COMPACT: 'COMPACT'; 883 | CONCATENATE: 'CONCATENATE'; 884 | CHANGE: 'CHANGE'; 885 | CASCADE: 'CASCADE'; 886 | RESTRICT: 'RESTRICT'; 887 | CLUSTERED: 'CLUSTERED'; 888 | SORTED: 'SORTED'; 889 | PURGE: 'PURGE'; 890 | INPUTFORMAT: 'INPUTFORMAT'; 891 | OUTPUTFORMAT: 'OUTPUTFORMAT'; 892 | DATABASE: 'DATABASE' | 'SCHEMA'; 893 | DATABASES: 'DATABASES' | 'SCHEMAS'; 894 | DFS: 'DFS'; 895 | TRUNCATE: 'TRUNCATE'; 896 | ANALYZE: 'ANALYZE'; 897 | COMPUTE: 'COMPUTE'; 898 | LIST: 'LIST'; 899 | STATISTICS: 'STATISTICS'; 900 | PARTITIONED: 'PARTITIONED'; 901 | EXTERNAL: 'EXTERNAL'; 902 | DEFINED: 'DEFINED'; 903 | REVOKE: 'REVOKE'; 904 | GRANT: 'GRANT'; 905 | LOCK: 'LOCK'; 906 | UNLOCK: 'UNLOCK'; 907 | MSCK: 'MSCK'; 908 | REPAIR: 'REPAIR'; 909 | RECOVER: 'RECOVER'; 910 | EXPORT: 'EXPORT'; 911 | IMPORT: 'IMPORT'; 912 | LOAD: 'LOAD'; 913 | ROLE: 'ROLE'; 914 | ROLES: 'ROLES'; 915 | COMPACTIONS: 'COMPACTIONS'; 916 | PRINCIPALS: 'PRINCIPALS'; 917 | TRANSACTIONS: 'TRANSACTIONS'; 918 | INDEX: 'INDEX'; 919 | INDEXES: 'INDEXES'; 920 | LOCKS: 'LOCKS'; 921 | OPTION: 'OPTION'; 922 | ANTI: 'ANTI'; 923 | LOCAL: 'LOCAL'; 924 | INPATH: 'INPATH'; 925 | CURRENT_DATE: 'CURRENT_DATE'; 926 | CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'; 927 | 928 | STRING 929 | : '\'' ( ~('\''|'\\') | ('\\' .) )* '\'' 930 | | '\"' ( ~('\"'|'\\') | ('\\' .) )* '\"' 931 | ; 932 | 933 | BIGINT_LITERAL 934 | : DIGIT+ 'L' 935 | ; 936 | 937 | SMALLINT_LITERAL 938 | : DIGIT+ 'S' 939 | ; 940 | 941 | TINYINT_LITERAL 942 | : DIGIT+ 'Y' 943 | ; 944 | 945 | BYTELENGTH_LITERAL 946 | : DIGIT+ ('B' | 'K' | 'M' | 'G') 947 | ; 948 | 949 | INTEGER_VALUE 950 | : DIGIT+ 951 | ; 952 | 953 | DECIMAL_VALUE 954 | : DIGIT+ EXPONENT 955 | | DECIMAL_DIGITS EXPONENT? {isValidDecimal()}? 956 | ; 957 | 958 | DOUBLE_LITERAL 959 | : DIGIT+ EXPONENT? 'D' 960 | | DECIMAL_DIGITS EXPONENT? 'D' {isValidDecimal()}? 961 | ; 962 | 963 | BIGDECIMAL_LITERAL 964 | : DIGIT+ EXPONENT? 'BD' 965 | | DECIMAL_DIGITS EXPONENT? 'BD' {isValidDecimal()}? 966 | ; 967 | 968 | IDENTIFIER 969 | : (LETTER | DIGIT | '_')+ 970 | ; 971 | 972 | BACKQUOTED_IDENTIFIER 973 | : '`' ( ~'`' | '``' )* '`' 974 | ; 975 | 976 | fragment DECIMAL_DIGITS 977 | : DIGIT+ '.' DIGIT* 978 | | '.' DIGIT+ 979 | ; 980 | 981 | fragment EXPONENT 982 | : 'E' [+-]? DIGIT+ 983 | ; 984 | 985 | fragment DIGIT 986 | : [0-9] 987 | ; 988 | 989 | fragment LETTER 990 | : [A-Z] 991 | ; 992 | 993 | SIMPLE_COMMENT 994 | : '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN) 995 | ; 996 | 997 | BRACKETED_COMMENT 998 | : '/*' .*? '*/' -> channel(HIDDEN) 999 | ; 1000 | 1001 | WS 1002 | : [ \r\n\t]+ -> channel(HIDDEN) 1003 | ; 1004 | 1005 | // Catch-all for anything we can't recognize. 1006 | // We use this to be able to ignore and recover all the text 1007 | // when splitting statements with DelimiterLexer 1008 | UNRECOGNIZED 1009 | : . 1010 | ; 1011 | -------------------------------------------------------------------------------- /src/com/tencent/MyVisitor.java: -------------------------------------------------------------------------------- 1 | package com.tencent; 2 | 3 | public class MyVisitor extends SqlBaseBaseVisitor{ 4 | 5 | public String visitSingleStatement(SqlBaseParser.SingleStatementContext ctx) { 6 | System.out.println("visitSingleStatement"); 7 | return visitChildren(ctx); 8 | } 9 | 10 | public String visitSingleExpression(SqlBaseParser.SingleExpressionContext ctx) { 11 | System.out.println("visitSingleExpression"); 12 | return visitChildren(ctx); 13 | } 14 | 15 | public String visitSingleTableIdentifier(SqlBaseParser.SingleTableIdentifierContext ctx) { 16 | System.out.println("visitSingleTableIdentifier"); 17 | return visitChildren(ctx); 18 | } 19 | 20 | public String visitSingleDataType(SqlBaseParser.SingleDataTypeContext ctx) { 21 | System.out.println("visitSingleDataType"); 22 | return visitChildren(ctx); 23 | } 24 | 25 | public String visitStatementDefault(SqlBaseParser.StatementDefaultContext ctx) { 26 | System.out.println("visitStatementDefault"); 27 | return visitChildren(ctx); 28 | } 29 | 30 | public String visitUse(SqlBaseParser.UseContext ctx) { 31 | System.out.println("visitUse"); 32 | return visitChildren(ctx); 33 | } 34 | 35 | public String visitCreateDatabase(SqlBaseParser.CreateDatabaseContext ctx) { 36 | System.out.println("visitCreateDatabase"); 37 | return visitChildren(ctx); 38 | } 39 | 40 | public String visitSetDatabaseProperties(SqlBaseParser.SetDatabasePropertiesContext ctx) { 41 | System.out.println("visitSetDatabaseProperties"); 42 | return visitChildren(ctx); 43 | } 44 | 45 | public String visitDropDatabase(SqlBaseParser.DropDatabaseContext ctx) { 46 | System.out.println("visitDropDatabase"); 47 | return visitChildren(ctx); 48 | } 49 | 50 | public String visitCreateTableUsing(SqlBaseParser.CreateTableUsingContext ctx) { 51 | System.out.println("visitCreateTableUsing"); 52 | return visitChildren(ctx); 53 | } 54 | 55 | public String visitCreateTable(SqlBaseParser.CreateTableContext ctx) { 56 | System.out.println("visitCreateTable"); 57 | return visitChildren(ctx); 58 | } 59 | 60 | public String visitCreateTableLike(SqlBaseParser.CreateTableLikeContext ctx) { 61 | System.out.println("visitCreateTableLike"); 62 | return visitChildren(ctx); 63 | } 64 | 65 | public String visitAnalyze(SqlBaseParser.AnalyzeContext ctx) { 66 | System.out.println("visitAnalyze"); 67 | return visitChildren(ctx); 68 | } 69 | 70 | public String visitRenameTable(SqlBaseParser.RenameTableContext ctx) { 71 | System.out.println("visitRenameTable"); 72 | return visitChildren(ctx); 73 | } 74 | 75 | public String visitSetTableProperties(SqlBaseParser.SetTablePropertiesContext ctx) { 76 | System.out.println("visitSetTableProperties"); 77 | return visitChildren(ctx); 78 | } 79 | 80 | public String visitUnsetTableProperties(SqlBaseParser.UnsetTablePropertiesContext ctx) { 81 | System.out.println("visitUnsetTableProperties"); 82 | return visitChildren(ctx); 83 | } 84 | 85 | public String visitSetTableSerDe(SqlBaseParser.SetTableSerDeContext ctx) { 86 | System.out.println("visitSetTableSerDe"); 87 | return visitChildren(ctx); 88 | } 89 | 90 | public String visitAddTablePartition(SqlBaseParser.AddTablePartitionContext ctx) { 91 | System.out.println("visitAddTablePartition"); 92 | return visitChildren(ctx); 93 | } 94 | 95 | public String visitRenameTablePartition(SqlBaseParser.RenameTablePartitionContext ctx) { 96 | System.out.println("visitRenameTablePartition"); 97 | return visitChildren(ctx); 98 | } 99 | 100 | public String visitDropTablePartitions(SqlBaseParser.DropTablePartitionsContext ctx) { 101 | System.out.println("visitSDropTablePartitions"); 102 | return visitChildren(ctx); 103 | } 104 | 105 | public String visitSetTableLocation(SqlBaseParser.SetTableLocationContext ctx) { 106 | System.out.println("visitSetTableLocation"); 107 | return visitChildren(ctx); 108 | } 109 | 110 | public String visitRecoverPartitions(SqlBaseParser.RecoverPartitionsContext ctx) { 111 | System.out.println("visitRecoverPartitions"); 112 | return visitChildren(ctx); 113 | } 114 | 115 | public String visitDropTable(SqlBaseParser.DropTableContext ctx) { 116 | System.out.println("visitDropTable"); 117 | return visitChildren(ctx); 118 | } 119 | 120 | public String visitCreateView(SqlBaseParser.CreateViewContext ctx) { 121 | System.out.println("visitCreateView"); 122 | return visitChildren(ctx); 123 | } 124 | 125 | public String visitCreateTempViewUsing(SqlBaseParser.CreateTempViewUsingContext ctx) { 126 | System.out.println("visitCreateTempViewUsing"); 127 | return visitChildren(ctx); 128 | } 129 | 130 | public String visitAlterViewQuery(SqlBaseParser.AlterViewQueryContext ctx) { 131 | System.out.println("visitAlterViewQuery"); 132 | return visitChildren(ctx); 133 | } 134 | 135 | public String visitCreateFunction(SqlBaseParser.CreateFunctionContext ctx) { 136 | System.out.println("visitCreateFunction"); 137 | return visitChildren(ctx); 138 | } 139 | 140 | public String visitDropFunction(SqlBaseParser.DropFunctionContext ctx) { 141 | System.out.println("visitDropFunction"); 142 | return visitChildren(ctx); 143 | } 144 | 145 | public String visitExplain(SqlBaseParser.ExplainContext ctx) { 146 | System.out.println("visitExplain"); 147 | return visitChildren(ctx); 148 | } 149 | 150 | public String visitShowTables(SqlBaseParser.ShowTablesContext ctx) { 151 | System.out.println("visitShowTables"); 152 | return visitChildren(ctx); 153 | } 154 | 155 | public String visitShowDatabases(SqlBaseParser.ShowDatabasesContext ctx) { 156 | System.out.println("visitShowDatabases"); 157 | return visitChildren(ctx); 158 | } 159 | 160 | public String visitShowTblProperties(SqlBaseParser.ShowTblPropertiesContext ctx) { 161 | System.out.println("visitShowTblProperties"); 162 | return visitChildren(ctx); 163 | } 164 | 165 | public String visitShowColumns(SqlBaseParser.ShowColumnsContext ctx) { 166 | System.out.println("visitShowColumns"); 167 | return visitChildren(ctx); 168 | } 169 | 170 | public String visitShowPartitions(SqlBaseParser.ShowPartitionsContext ctx) { 171 | System.out.println("visitShowPartitions"); 172 | return visitChildren(ctx); 173 | } 174 | 175 | public String visitShowFunctions(SqlBaseParser.ShowFunctionsContext ctx) { 176 | System.out.println("visitShowFunctions"); 177 | return visitChildren(ctx); 178 | } 179 | 180 | public String visitShowCreateTable(SqlBaseParser.ShowCreateTableContext ctx) { 181 | System.out.println("visitShowCreateTable"); 182 | return visitChildren(ctx); 183 | } 184 | 185 | public String visitDescribeFunction(SqlBaseParser.DescribeFunctionContext ctx) { 186 | System.out.println("visitDescribeFunction"); 187 | return visitChildren(ctx); 188 | } 189 | 190 | public String visitDescribeDatabase(SqlBaseParser.DescribeDatabaseContext ctx) { 191 | System.out.println("visitDescribeDatabase"); 192 | return visitChildren(ctx); 193 | } 194 | 195 | public String visitDescribeTable(SqlBaseParser.DescribeTableContext ctx) { 196 | System.out.println("visitDescribeTable"); 197 | return visitChildren(ctx); 198 | } 199 | 200 | public String visitRefreshTable(SqlBaseParser.RefreshTableContext ctx) { 201 | System.out.println("visitRefreshTable"); 202 | return visitChildren(ctx); 203 | } 204 | 205 | public String visitRefreshResource(SqlBaseParser.RefreshResourceContext ctx) { 206 | System.out.println("visitRefreshResource"); 207 | return visitChildren(ctx); 208 | } 209 | 210 | public String visitCacheTable(SqlBaseParser.CacheTableContext ctx) { 211 | System.out.println("visitCacheTable"); 212 | return visitChildren(ctx); 213 | } 214 | 215 | public String visitUncacheTable(SqlBaseParser.UncacheTableContext ctx) { 216 | System.out.println("visitUncacheTable"); 217 | return visitChildren(ctx); 218 | } 219 | 220 | public String visitClearCache(SqlBaseParser.ClearCacheContext ctx) { 221 | System.out.println("visitClearCache"); 222 | return visitChildren(ctx); 223 | } 224 | 225 | public String visitLoadData(SqlBaseParser.LoadDataContext ctx) { 226 | System.out.println("visitLoadData"); 227 | return visitChildren(ctx); 228 | } 229 | 230 | public String visitTruncateTable(SqlBaseParser.TruncateTableContext ctx) { 231 | System.out.println("visitTruncateTable"); 232 | return visitChildren(ctx); 233 | } 234 | 235 | public String visitRepairTable(SqlBaseParser.RepairTableContext ctx) { 236 | System.out.println("visitRepairTable"); 237 | return visitChildren(ctx); 238 | } 239 | 240 | public String visitManageResource(SqlBaseParser.ManageResourceContext ctx) { 241 | System.out.println("visitManageResource"); 242 | return visitChildren(ctx); 243 | } 244 | 245 | public String visitFailNativeCommand(SqlBaseParser.FailNativeCommandContext ctx) { 246 | System.out.println("visitFailNativeCommand"); 247 | return visitChildren(ctx); 248 | } 249 | 250 | public String visitSetConfiguration(SqlBaseParser.SetConfigurationContext ctx) { 251 | System.out.println("visitSetConfiguration"); 252 | return visitChildren(ctx); 253 | } 254 | 255 | public String visitResetConfiguration(SqlBaseParser.ResetConfigurationContext ctx) { 256 | System.out.println("visitResetConfiguration"); 257 | return visitChildren(ctx); 258 | } 259 | 260 | public String visitUnsupportedHiveNativeCommands(SqlBaseParser.UnsupportedHiveNativeCommandsContext ctx) { 261 | System.out.println("visitUnsupportedHiveNativeCommand"); 262 | return visitChildren(ctx); 263 | } 264 | 265 | public String visitCreateTableHeader(SqlBaseParser.CreateTableHeaderContext ctx) { 266 | System.out.println("visitCreateTableHeader"); 267 | return visitChildren(ctx); 268 | } 269 | 270 | public String visitBucketSpec(SqlBaseParser.BucketSpecContext ctx) { 271 | System.out.println("visitBucketSpec"); 272 | return visitChildren(ctx); 273 | } 274 | 275 | public String visitSkewSpec(SqlBaseParser.SkewSpecContext ctx) { 276 | System.out.println("visitSkewSpec"); 277 | return visitChildren(ctx); 278 | } 279 | 280 | public String visitLocationSpec(SqlBaseParser.LocationSpecContext ctx) { 281 | System.out.println("visitLocationSpec"); 282 | return visitChildren(ctx); 283 | } 284 | 285 | public String visitQuery(SqlBaseParser.QueryContext ctx) { 286 | System.out.println("visitQuery"); 287 | return visitChildren(ctx); 288 | } 289 | 290 | public String visitInsertInto(SqlBaseParser.InsertIntoContext ctx) { 291 | System.out.println("visitInsertInto"); 292 | return visitChildren(ctx); 293 | } 294 | 295 | public String visitPartitionSpecLocation(SqlBaseParser.PartitionSpecLocationContext ctx) { 296 | System.out.println("visitPartitionSpecLocation"); 297 | return visitChildren(ctx); 298 | } 299 | 300 | public String visitPartitionSpec(SqlBaseParser.PartitionSpecContext ctx) { 301 | System.out.println("visitPartitionSpec"); 302 | return visitChildren(ctx); 303 | } 304 | 305 | public String visitPartitionVal(SqlBaseParser.PartitionValContext ctx) { 306 | System.out.println("visitPartitionVal"); 307 | return visitChildren(ctx); 308 | } 309 | 310 | public String visitDescribeFuncName(SqlBaseParser.DescribeFuncNameContext ctx) { 311 | System.out.println("visitDescribeFuncName"); 312 | return visitChildren(ctx); 313 | } 314 | 315 | public String visitDescribeColName(SqlBaseParser.DescribeColNameContext ctx) { 316 | System.out.println("visitDescribeColName"); 317 | return visitChildren(ctx); 318 | } 319 | 320 | public String visitCtes(SqlBaseParser.CtesContext ctx) { 321 | System.out.println("visitCtes"); 322 | return visitChildren(ctx); 323 | } 324 | 325 | public String visitNamedQuery(SqlBaseParser.NamedQueryContext ctx) { 326 | System.out.println("visitNamedQuery"); 327 | return visitChildren(ctx); 328 | } 329 | 330 | public String visitTableProvider(SqlBaseParser.TableProviderContext ctx) { 331 | System.out.println("visitTableProvider"); 332 | return visitChildren(ctx); 333 | } 334 | 335 | public String visitTablePropertyList(SqlBaseParser.TablePropertyListContext ctx) { 336 | System.out.println("visitTablePropertyList"); 337 | return visitChildren(ctx); 338 | } 339 | 340 | public String visitTableProperty(SqlBaseParser.TablePropertyContext ctx) { 341 | System.out.println("visitTableProperty"); 342 | return visitChildren(ctx); 343 | } 344 | 345 | public String visitTablePropertyKey(SqlBaseParser.TablePropertyKeyContext ctx) { 346 | System.out.println("visitTablePropertyKey"); 347 | return visitChildren(ctx); 348 | } 349 | 350 | public String visitTablePropertyValue(SqlBaseParser.TablePropertyValueContext ctx) { 351 | System.out.println("visitTablePropertyValue"); 352 | return visitChildren(ctx); 353 | } 354 | 355 | public String visitConstantList(SqlBaseParser.ConstantListContext ctx) { 356 | System.out.println("visitConstantList"); 357 | return visitChildren(ctx); 358 | } 359 | 360 | public String visitNestedConstantList(SqlBaseParser.NestedConstantListContext ctx) { 361 | System.out.println("visitNestedConstantList"); 362 | return visitChildren(ctx); 363 | } 364 | 365 | public String visitCreateFileFormat(SqlBaseParser.CreateFileFormatContext ctx) { 366 | System.out.println("visitCreateFileFormat"); 367 | return visitChildren(ctx); 368 | } 369 | 370 | public String visitTableFileFormat(SqlBaseParser.TableFileFormatContext ctx) { 371 | System.out.println("visitTableFileFormat"); 372 | return visitChildren(ctx); 373 | } 374 | 375 | public String visitGenericFileFormat(SqlBaseParser.GenericFileFormatContext ctx) { 376 | System.out.println("visitGenericFileFormat"); 377 | return visitChildren(ctx); 378 | } 379 | 380 | public String visitStorageHandler(SqlBaseParser.StorageHandlerContext ctx) { 381 | System.out.println("visitStorageHandler"); 382 | return visitChildren(ctx); 383 | } 384 | 385 | public String visitResource(SqlBaseParser.ResourceContext ctx) { 386 | System.out.println("visitResource"); 387 | return visitChildren(ctx); 388 | } 389 | 390 | public String visitSingleInsertQuery(SqlBaseParser.SingleInsertQueryContext ctx) { 391 | System.out.println("visitSingleInsertQuery"); 392 | return visitChildren(ctx); 393 | } 394 | 395 | public String visitMultiInsertQuery(SqlBaseParser.MultiInsertQueryContext ctx) { 396 | System.out.println("visitMultiInsertQuery"); 397 | return visitChildren(ctx); 398 | } 399 | 400 | public String visitQueryOrganization(SqlBaseParser.QueryOrganizationContext ctx) { 401 | System.out.println("visitQueryOrganization"); 402 | return visitChildren(ctx); 403 | } 404 | 405 | public String visitMultiInsertQueryBody(SqlBaseParser.MultiInsertQueryBodyContext ctx) { 406 | System.out.println("visitMultiInsertQueryBody"); 407 | return visitChildren(ctx); 408 | } 409 | 410 | public String visitQueryTermDefault(SqlBaseParser.QueryTermDefaultContext ctx) { 411 | System.out.println("visitQueryTermDefault"); 412 | return visitChildren(ctx); 413 | } 414 | 415 | public String visitSetOperation(SqlBaseParser.SetOperationContext ctx) { 416 | System.out.println("visitSetOperation"); 417 | return visitChildren(ctx); 418 | } 419 | 420 | public String visitQueryPrimaryDefault(SqlBaseParser.QueryPrimaryDefaultContext ctx) { 421 | System.out.println("visitQueryPrimaryDefault"); 422 | return visitChildren(ctx); 423 | } 424 | 425 | public String visitTable(SqlBaseParser.TableContext ctx) { 426 | System.out.println("visitTable"); 427 | return visitChildren(ctx); 428 | } 429 | 430 | public String visitInlineTableDefault1(SqlBaseParser.InlineTableDefault1Context ctx) { 431 | System.out.println("visitInlineTableDefault1"); 432 | return visitChildren(ctx); 433 | } 434 | 435 | public String visitSubquery(SqlBaseParser.SubqueryContext ctx) { 436 | System.out.println("visitSubquery"); 437 | return visitChildren(ctx); 438 | } 439 | 440 | public String visitSortItem(SqlBaseParser.SortItemContext ctx) { 441 | System.out.println("visitSortItem"); 442 | return visitChildren(ctx); 443 | } 444 | 445 | public String visitQuerySpecification(SqlBaseParser.QuerySpecificationContext ctx) { 446 | System.out.println("visitQuerySpecification"); 447 | return visitChildren(ctx); 448 | } 449 | 450 | public String visitFromClause(SqlBaseParser.FromClauseContext ctx) { 451 | System.out.println("visitFromClause"); 452 | return visitChildren(ctx); 453 | } 454 | 455 | public String visitAggregation(SqlBaseParser.AggregationContext ctx) { 456 | System.out.println("visitAggregation"); 457 | return visitChildren(ctx); 458 | } 459 | 460 | public String visitGroupingSet(SqlBaseParser.GroupingSetContext ctx) { 461 | System.out.println("visitGroupingSet"); 462 | return visitChildren(ctx); 463 | } 464 | 465 | public String visitLateralView(SqlBaseParser.LateralViewContext ctx) { 466 | System.out.println("visitLateralView"); 467 | return visitChildren(ctx); 468 | } 469 | 470 | public String visitSetQuantifier(SqlBaseParser.SetQuantifierContext ctx) { 471 | System.out.println("visitSetQuantifier"); 472 | return visitChildren(ctx); 473 | } 474 | 475 | public String visitRelation(SqlBaseParser.RelationContext ctx) { 476 | System.out.println("visitRelation"); 477 | return visitChildren(ctx); 478 | } 479 | 480 | public String visitJoinRelation(SqlBaseParser.JoinRelationContext ctx) { 481 | System.out.println("visitJoinRelation"); 482 | return visitChildren(ctx); 483 | } 484 | 485 | public String visitJoinType(SqlBaseParser.JoinTypeContext ctx) { 486 | System.out.println("visitJoinType"); 487 | return visitChildren(ctx); 488 | } 489 | 490 | public String visitJoinCriteria(SqlBaseParser.JoinCriteriaContext ctx) { 491 | System.out.println("visitJoinCriteria"); 492 | return visitChildren(ctx); 493 | } 494 | 495 | public String visitSample(SqlBaseParser.SampleContext ctx) { 496 | System.out.println("visitSample"); 497 | return visitChildren(ctx); 498 | } 499 | 500 | public String visitIdentifierList(SqlBaseParser.IdentifierListContext ctx) { 501 | System.out.println("visitIdentifierList"); 502 | return visitChildren(ctx); 503 | } 504 | 505 | public String visitIdentifierSeq(SqlBaseParser.IdentifierSeqContext ctx) { 506 | System.out.println("visitIdentifierSeq"); 507 | return visitChildren(ctx); 508 | } 509 | 510 | public String visitOrderedIdentifierList(SqlBaseParser.OrderedIdentifierListContext ctx) { 511 | return visitChildren(ctx); 512 | } 513 | 514 | public String visitOrderedIdentifier(SqlBaseParser.OrderedIdentifierContext ctx) { 515 | return visitChildren(ctx); 516 | } 517 | 518 | public String visitIdentifierCommentList(SqlBaseParser.IdentifierCommentListContext ctx) { 519 | return visitChildren(ctx); 520 | } 521 | 522 | public String visitIdentifierComment(SqlBaseParser.IdentifierCommentContext ctx) { 523 | return visitChildren(ctx); 524 | } 525 | 526 | public String visitTableName(SqlBaseParser.TableNameContext ctx) { 527 | System.out.println("visitTableName: " + ctx.getText()); 528 | return visitChildren(ctx); 529 | } 530 | 531 | public String visitAliasedQuery(SqlBaseParser.AliasedQueryContext ctx) { 532 | System.out.println("visitAliasedQuery"); 533 | return visitChildren(ctx); 534 | } 535 | 536 | public String visitAliasedRelation(SqlBaseParser.AliasedRelationContext ctx) { 537 | System.out.println("visitAliasedRelation"); 538 | return visitChildren(ctx); 539 | } 540 | 541 | public String visitInlineTableDefault2(SqlBaseParser.InlineTableDefault2Context ctx) { 542 | System.out.println("visitInlineTableDefault2"); 543 | return visitChildren(ctx); 544 | } 545 | 546 | public String visitTableValuedFunction(SqlBaseParser.TableValuedFunctionContext ctx) { 547 | System.out.println("visitTableValueFunction"); 548 | return visitChildren(ctx); 549 | } 550 | 551 | public String visitInlineTable(SqlBaseParser.InlineTableContext ctx) { 552 | System.out.println("visitInlineTable"); 553 | return visitChildren(ctx); 554 | } 555 | 556 | public String visitRowFormatSerde(SqlBaseParser.RowFormatSerdeContext ctx) { 557 | System.out.println("visitRowFormatSerde"); 558 | return visitChildren(ctx); 559 | } 560 | 561 | public String visitRowFormatDelimited(SqlBaseParser.RowFormatDelimitedContext ctx) { 562 | System.out.println("visitRowFormatDelimited"); 563 | return visitChildren(ctx); 564 | } 565 | 566 | public String visitTableIdentifier(SqlBaseParser.TableIdentifierContext ctx) { 567 | System.out.println("visitTableIdentifier: table=" + ctx.table.getText()); 568 | return visitChildren(ctx); 569 | } 570 | 571 | public String visitNamedExpression(SqlBaseParser.NamedExpressionContext ctx) { 572 | System.out.println("visitNamedExpression"); 573 | return visitChildren(ctx); 574 | } 575 | 576 | public String visitNamedExpressionSeq(SqlBaseParser.NamedExpressionSeqContext ctx) { 577 | System.out.println("visitNamedExpressionSeq"); 578 | return visitChildren(ctx); 579 | } 580 | 581 | public String visitExpression(SqlBaseParser.ExpressionContext ctx) { 582 | System.out.println("visitExpression"); 583 | return visitChildren(ctx); 584 | } 585 | 586 | public String visitLogicalNot(SqlBaseParser.LogicalNotContext ctx) { 587 | System.out.println("visitLogicalNot"); 588 | return visitChildren(ctx); 589 | } 590 | 591 | public String visitBooleanDefault(SqlBaseParser.BooleanDefaultContext ctx) { 592 | System.out.println("visitBooleanDefault"); 593 | return visitChildren(ctx); 594 | } 595 | 596 | public String visitExists(SqlBaseParser.ExistsContext ctx) { 597 | System.out.println("visitExists"); 598 | return visitChildren(ctx); 599 | } 600 | 601 | public String visitLogicalBinary(SqlBaseParser.LogicalBinaryContext ctx) { 602 | System.out.println("visitLogicalBinary"); 603 | return visitChildren(ctx); 604 | } 605 | 606 | public String visitPredicated(SqlBaseParser.PredicatedContext ctx) { 607 | System.out.println("visitPredicated"); 608 | return visitChildren(ctx); 609 | } 610 | 611 | public String visitPredicate(SqlBaseParser.PredicateContext ctx) { 612 | System.out.println("visitPredicate"); 613 | return visitChildren(ctx); 614 | } 615 | 616 | public String visitValueExpressionDefault(SqlBaseParser.ValueExpressionDefaultContext ctx) { 617 | System.out.println("visitValueExpressionDefault"); 618 | return visitChildren(ctx); 619 | } 620 | 621 | public String visitComparison(SqlBaseParser.ComparisonContext ctx) { 622 | System.out.println("visitComparison"); 623 | return visitChildren(ctx); 624 | } 625 | 626 | public String visitArithmeticBinary(SqlBaseParser.ArithmeticBinaryContext ctx) { 627 | System.out.println("visitArithmeticBinary: operator=" + ctx.operator.getText() + ctx.operator.getType()); 628 | return visitChildren(ctx); 629 | } 630 | 631 | public String visitArithmeticUnary(SqlBaseParser.ArithmeticUnaryContext ctx) { 632 | System.out.println("visitArithmeticUnary " + ctx.operator); 633 | return visitChildren(ctx); 634 | } 635 | 636 | public String visitDereference(SqlBaseParser.DereferenceContext ctx) { 637 | System.out.println("visitDereference"); 638 | return visitChildren(ctx); 639 | } 640 | 641 | public String visitSimpleCase(SqlBaseParser.SimpleCaseContext ctx) { 642 | System.out.println("visitSimpleCase"); 643 | return visitChildren(ctx); 644 | } 645 | 646 | public String visitColumnReference(SqlBaseParser.ColumnReferenceContext ctx) { 647 | System.out.println("visitColumnReference"); 648 | return visitChildren(ctx); 649 | } 650 | 651 | public String visitRowConstructor(SqlBaseParser.RowConstructorContext ctx) { 652 | System.out.println("visitRowConstructor"); 653 | return visitChildren(ctx); 654 | } 655 | 656 | public String visitStar(SqlBaseParser.StarContext ctx) { 657 | System.out.println("visitStar"); 658 | return visitChildren(ctx); 659 | } 660 | 661 | public String visitSubscript(SqlBaseParser.SubscriptContext ctx) { 662 | System.out.println("visitSubscript"); 663 | return visitChildren(ctx); 664 | } 665 | 666 | public String visitTimeFunctionCall(SqlBaseParser.TimeFunctionCallContext ctx) { 667 | System.out.println("visitTimeFunctionCall"); 668 | return visitChildren(ctx); 669 | } 670 | 671 | public String visitSubqueryExpression(SqlBaseParser.SubqueryExpressionContext ctx) { 672 | System.out.println("visitSubqueryExpression"); 673 | return visitChildren(ctx); 674 | } 675 | 676 | public String visitCast(SqlBaseParser.CastContext ctx) { 677 | System.out.println("visitCast"); 678 | return visitChildren(ctx); 679 | } 680 | 681 | public String visitConstantDefault(SqlBaseParser.ConstantDefaultContext ctx) { 682 | System.out.println("visitConstantDefault"); 683 | return visitChildren(ctx); 684 | } 685 | 686 | public String visitParenthesizedExpression(SqlBaseParser.ParenthesizedExpressionContext ctx) { 687 | System.out.println("visitParenthesizedExpression"); 688 | return visitChildren(ctx); 689 | } 690 | 691 | public String visitFunctionCall(SqlBaseParser.FunctionCallContext ctx) { 692 | System.out.println("visitFunctionCall: " + ctx.getText() + " | qualifiedName=" 693 | + ctx.qualifiedName().getText() + ctx.expression(0).getText()); 694 | return visitChildren(ctx); 695 | } 696 | 697 | public String visitSearchedCase(SqlBaseParser.SearchedCaseContext ctx) { 698 | System.out.println("visitSearchedCase"); 699 | return visitChildren(ctx); 700 | } 701 | 702 | public String visitNullLiteral(SqlBaseParser.NullLiteralContext ctx) { 703 | System.out.println("visitNullLiteral"); 704 | return visitChildren(ctx); 705 | } 706 | 707 | public String visitIntervalLiteral(SqlBaseParser.IntervalLiteralContext ctx) { 708 | System.out.println("visitIntervalLiteral"); 709 | return visitChildren(ctx); 710 | } 711 | 712 | public String visitTypeConstructor(SqlBaseParser.TypeConstructorContext ctx) { 713 | System.out.println("visitTypeConstructor"); 714 | return visitChildren(ctx); 715 | } 716 | 717 | public String visitNumericLiteral(SqlBaseParser.NumericLiteralContext ctx) { 718 | System.out.println("visitNumericLiteral"); 719 | return visitChildren(ctx); 720 | } 721 | 722 | public String visitBooleanLiteral(SqlBaseParser.BooleanLiteralContext ctx) { 723 | System.out.println("visitBooleanLiteral"); 724 | return visitChildren(ctx); 725 | } 726 | 727 | public String visitStringLiteral(SqlBaseParser.StringLiteralContext ctx) { 728 | System.out.println("visitStringLiteral"); 729 | return visitChildren(ctx); 730 | } 731 | 732 | public String visitComparisonOperator(SqlBaseParser.ComparisonOperatorContext ctx) { 733 | System.out.println("visitComparisonOperator"); 734 | return visitChildren(ctx); 735 | } 736 | 737 | public String visitArithmeticOperator(SqlBaseParser.ArithmeticOperatorContext ctx) { 738 | System.out.println("visitArithmeticOperator"); 739 | return visitChildren(ctx); 740 | } 741 | 742 | public String visitPredicateOperator(SqlBaseParser.PredicateOperatorContext ctx) { 743 | System.out.println("visitPredicateOperator"); 744 | return visitChildren(ctx); 745 | } 746 | 747 | public String visitBooleanValue(SqlBaseParser.BooleanValueContext ctx) { 748 | System.out.println("visitBooleanValue"); 749 | return visitChildren(ctx); 750 | } 751 | 752 | public String visitInterval(SqlBaseParser.IntervalContext ctx) { 753 | System.out.println("visitInterval"); 754 | return visitChildren(ctx); 755 | } 756 | 757 | public String visitIntervalField(SqlBaseParser.IntervalFieldContext ctx) { 758 | System.out.println("visitIntervalField"); 759 | return visitChildren(ctx); 760 | } 761 | 762 | public String visitIntervalValue(SqlBaseParser.IntervalValueContext ctx) { 763 | System.out.println("visitIntervalValue"); 764 | return visitChildren(ctx); 765 | } 766 | 767 | public String visitComplexDataType(SqlBaseParser.ComplexDataTypeContext ctx) { 768 | System.out.println("visitComplexDataType"); 769 | return visitChildren(ctx); 770 | } 771 | 772 | public String visitPrimitiveDataType(SqlBaseParser.PrimitiveDataTypeContext ctx) { 773 | System.out.println("visitPrimitiveDataType"); 774 | return visitChildren(ctx); 775 | } 776 | 777 | public String visitColTypeList(SqlBaseParser.ColTypeListContext ctx) { 778 | System.out.println("visitColTypeList"); 779 | return visitChildren(ctx); 780 | } 781 | 782 | public String visitColType(SqlBaseParser.ColTypeContext ctx) { 783 | System.out.println("visitColType"); 784 | return visitChildren(ctx); 785 | } 786 | 787 | public String visitComplexColTypeList(SqlBaseParser.ComplexColTypeListContext ctx) { 788 | System.out.println("visitComplexColTypeList"); 789 | return visitChildren(ctx); 790 | } 791 | 792 | public String visitComplexColType(SqlBaseParser.ComplexColTypeContext ctx) { 793 | System.out.println("visitComplexColType"); 794 | return visitChildren(ctx); 795 | } 796 | 797 | public String visitWhenClause(SqlBaseParser.WhenClauseContext ctx) { 798 | System.out.println("visitWhenClause"); 799 | return visitChildren(ctx); 800 | } 801 | 802 | public String visitWindows(SqlBaseParser.WindowsContext ctx) { 803 | System.out.println("visitWindows"); 804 | return visitChildren(ctx); 805 | } 806 | 807 | public String visitNamedWindow(SqlBaseParser.NamedWindowContext ctx) { 808 | System.out.println("visitNamedWindow"); 809 | return visitChildren(ctx); 810 | } 811 | 812 | public String visitWindowRef(SqlBaseParser.WindowRefContext ctx) { 813 | System.out.println("visitWindowRef"); 814 | return visitChildren(ctx); 815 | } 816 | 817 | public String visitWindowDef(SqlBaseParser.WindowDefContext ctx) { 818 | System.out.println("visitWindowDef"); 819 | return visitChildren(ctx); 820 | } 821 | 822 | public String visitWindowFrame(SqlBaseParser.WindowFrameContext ctx) { 823 | System.out.println("visitWindowFrame"); 824 | return visitChildren(ctx); 825 | } 826 | 827 | public String visitFrameBound(SqlBaseParser.FrameBoundContext ctx) { 828 | System.out.println("visitFrameBound"); 829 | return visitChildren(ctx); 830 | } 831 | 832 | public String visitQualifiedName(SqlBaseParser.QualifiedNameContext ctx) { 833 | System.out.println("visitQualifiedName"); 834 | return visitChildren(ctx); 835 | } 836 | 837 | public String visitIdentifier(SqlBaseParser.IdentifierContext ctx) { 838 | System.out.println("visitIdentifier"); 839 | return visitChildren(ctx); 840 | } 841 | 842 | public String visitUnquotedIdentifier(SqlBaseParser.UnquotedIdentifierContext ctx) { 843 | System.out.println("visitUnquotedIdentifier"); 844 | return visitChildren(ctx); 845 | } 846 | 847 | public String visitQuotedIdentifierAlternative(SqlBaseParser.QuotedIdentifierAlternativeContext ctx) { 848 | System.out.println("visitQuotedIdentifierAlternative"); 849 | return visitChildren(ctx); 850 | } 851 | 852 | public String visitQuotedIdentifier(SqlBaseParser.QuotedIdentifierContext ctx) { 853 | System.out.println("visitQuotedIdentifer"); 854 | return visitChildren(ctx); 855 | } 856 | 857 | public String visitDecimalLiteral(SqlBaseParser.DecimalLiteralContext ctx) { 858 | System.out.println("visitDecimalLiteral"); 859 | return visitChildren(ctx); 860 | } 861 | 862 | public String visitIntegerLiteral(SqlBaseParser.IntegerLiteralContext ctx) { 863 | System.out.println("visitIntegerLiteral"); 864 | return visitChildren(ctx); 865 | } 866 | 867 | public String visitBigIntLiteral(SqlBaseParser.BigIntLiteralContext ctx) { 868 | System.out.println("visitBigIntLiteral"); 869 | return visitChildren(ctx); 870 | } 871 | 872 | public String visitSmallIntLiteral(SqlBaseParser.SmallIntLiteralContext ctx) { 873 | System.out.println("visitSmallIntLiteral"); 874 | return visitChildren(ctx); 875 | } 876 | 877 | public String visitTinyIntLiteral(SqlBaseParser.TinyIntLiteralContext ctx) { 878 | System.out.println("visitTinyIntLiteral"); 879 | return visitChildren(ctx); 880 | } 881 | 882 | public String visitDoubleLiteral(SqlBaseParser.DoubleLiteralContext ctx) { 883 | System.out.println("visitDoubleLiteral"); 884 | return visitChildren(ctx); 885 | } 886 | 887 | public String visitBigDecimalLiteral(SqlBaseParser.BigDecimalLiteralContext ctx) { 888 | System.out.println("visitBigDecimalLiteral"); 889 | return visitChildren(ctx); 890 | } 891 | 892 | public String visitNonReserved(SqlBaseParser.NonReservedContext ctx) { 893 | System.out.println("visitNonReserved"); 894 | return visitChildren(ctx); 895 | } 896 | } -------------------------------------------------------------------------------- /src/com/tencent/ParserDriver.java: -------------------------------------------------------------------------------- 1 | package com.tencent; 2 | 3 | import org.antlr.v4.runtime.ANTLRInputStream; 4 | import org.antlr.v4.runtime.CommonTokenStream; 5 | 6 | public class ParserDriver { 7 | public static void main(String[] args) { 8 | String query = ""; 9 | SqlBaseLexer lexer = new SqlBaseLexer(new ANTLRInputStream(query)); 10 | SqlBaseParser parser = new SqlBaseParser(new CommonTokenStream(lexer)); 11 | MyVisitor visitor = new MyVisitor(); 12 | String res = visitor.visitSingleStatement(parser.singleStatement()); 13 | System.out.println("res="+res); 14 | } 15 | } 16 | --------------------------------------------------------------------------------