sqlglot.parsers.duckdb
1from __future__ import annotations 2 3import typing as t 4 5from sqlglot import exp, parser 6from sqlglot.trie import new_trie 7from sqlglot.dialects.dialect import ( 8 binary_from_function, 9 build_dayofweek_zero_based, 10 build_default_decimal_type, 11 build_formatted_time, 12 build_regexp_extract, 13 date_trunc_to_time, 14 map_date_part, 15 pivot_column_names, 16) 17from sqlglot.helper import seq_get 18from sqlglot.parser import IsPredicatePrecedence, binary_range_parser 19from sqlglot.tokens import TokenType 20from collections.abc import Collection 21 22 23def _build_list_sort(name: str, desc: bool = False) -> t.Callable[[list], exp.Expr]: 24 # Orders are case-insensitive strings, e.g. LIST_SORT(x, 'desc', 'nulls first'), and NULLs default to last 25 def _builder(args: list) -> exp.Expr: 26 orders = [exp.Literal.string("DESC"), *args[1:]] if desc else args[1:] 27 order_name = _list_sort_order_name(seq_get(orders, 0), "ASC") 28 null_order_name = _list_sort_order_name(seq_get(orders, 1), "NULLS LAST") 29 valid = order_name in ("ASC", "DESC") and null_order_name in ("NULLS FIRST", "NULLS LAST") 30 if not valid: 31 return exp.Anonymous(this=name, expressions=args) 32 33 return exp.ArraySort( 34 this=seq_get(args, 0), 35 asc=exp.false() if order_name == "DESC" else None, 36 nulls_first=exp.Boolean(this=null_order_name == "NULLS FIRST"), 37 ) 38 39 return _builder 40 41 42def _list_sort_order_name(order: exp.Expr | None, default: str) -> str | None: 43 if order is None: 44 return default 45 return order.name.upper() if order.is_string else None 46 47 48def _build_array_prepend(args: list) -> exp.Expr: 49 return exp.ArrayPrepend(this=seq_get(args, 1), expression=seq_get(args, 0)) 50 51 52def _build_date_trunc(args: list) -> exp.DateTrunc | exp.TimestampTrunc: 53 trunc = date_trunc_to_time(args) 54 unit = trunc.args.get("unit") 55 if isinstance(unit, (exp.Literal, exp.Var)) and map_date_part(unit).name.upper() == "CENTURY": 56 # DuckDB truncates centuries to multiples of 100, rather than years 1, 101, etc. 57 trunc.set("century_from_zero", True) 58 return trunc 59 60 61def _build_date_diff(args: list) -> exp.Expr: 62 unit = seq_get(args, 0) 63 64 # DATE_DIFF counts the unit boundaries crossed, e.g. one month from 2026-01-31 to 2026-02-01, 65 # except for WEEK, which counts whole 7-day spans 66 date_part_boundary = ( 67 isinstance(unit, (exp.Literal, exp.Var)) and unit.name.upper() not in ("WEEK", "WEEKS", "W") 68 ) or None 69 70 return exp.DateDiff( 71 this=seq_get(args, 2), 72 expression=seq_get(args, 1), 73 unit=unit, 74 date_part_boundary=date_part_boundary, 75 ) 76 77 78def _build_generate_series(end_exclusive: bool = False) -> t.Callable[[list], exp.GenerateSeries]: 79 def _builder(args: list) -> exp.GenerateSeries: 80 # Check https://duckdb.org/docs/sql/functions/nested.html#range-functions 81 if len(args) == 1: 82 # DuckDB uses 0 as a default for the series' start when it's omitted 83 args.insert(0, exp.Literal.number("0")) 84 85 gen_series = exp.GenerateSeries.from_arg_list(args) 86 gen_series.set("is_end_exclusive", end_exclusive) 87 88 return gen_series 89 90 return _builder 91 92 93def _build_make_timestamp(args: list) -> exp.Expr: 94 if len(args) == 1: 95 return exp.UnixToTime(this=seq_get(args, 0), scale=exp.UnixToTime.MICROS) 96 97 return exp.TimestampFromParts( 98 year=seq_get(args, 0), 99 month=seq_get(args, 1), 100 day=seq_get(args, 2), 101 hour=seq_get(args, 3), 102 min=seq_get(args, 4), 103 sec=seq_get(args, 5), 104 ) 105 106 107def _show_parser(*args: t.Any, **kwargs: t.Any) -> t.Callable[[DuckDBParser], exp.Show]: 108 def _parse(self: DuckDBParser) -> exp.Show: 109 return self._parse_show_duckdb(*args, **kwargs) 110 111 return _parse 112 113 114def _convert_text_type(dtype: exp.DataType) -> exp.DataType: 115 dtype.set("expressions", None) 116 return dtype 117 118 119_parse_regexp_like = binary_range_parser(exp.RegexpLike) 120_parse_regexp_full_match = binary_range_parser(exp.RegexpFullMatch) 121 122 123class DuckDBParser(parser.Parser): 124 EXTRACT_FUNCTIONS = dict.fromkeys(("DAYOFWEEK", "DOW", "WEEKDAY"), build_dayofweek_zero_based) 125 126 SUPPORTS_TABLE_QUERY = True 127 128 IS_PREDICATE_PRECEDENCE = IsPredicatePrecedence.LOW 129 130 MAP_KEYS_ARE_ARBITRARY_EXPRESSIONS = True 131 PIVOT_COLUMN_NAMING = "agg_name_if_aliased_or_multiple" 132 133 SUPPORTS_DIRECTED_JOIN = False 134 135 JOIN_KINDS = parser.Parser.JOIN_KINDS - {TokenType.STRAIGHT_JOIN} 136 137 NO_PAREN_FUNCTIONS = { 138 **parser.Parser.NO_PAREN_FUNCTIONS, 139 TokenType.LOCALTIME: exp.Localtime, 140 TokenType.LOCALTIMESTAMP: exp.Localtimestamp, 141 TokenType.CURRENT_CATALOG: exp.CurrentCatalog, 142 TokenType.SESSION_USER: exp.SessionUser, 143 } 144 145 BITWISE = { 146 **{k: v for k, v in parser.Parser.BITWISE.items() if k != TokenType.CARET}, 147 TokenType.LT_EQ_GT: exp.CosineDistance, 148 } 149 150 COLUMN_OPERATORS = { 151 k: v 152 for k, v in parser.Parser.COLUMN_OPERATORS.items() 153 if k not in (TokenType.ARROW, TokenType.DARROW) 154 } 155 156 JSON_OPERATORS = { 157 TokenType.ARROW: parser.build_json_extract, 158 TokenType.DARROW: parser.build_json_extract_scalar, 159 } 160 161 RANGE_PARSERS = { 162 **parser.Parser.RANGE_PARSERS, 163 TokenType.DAMP: binary_range_parser(exp.ArrayOverlaps), 164 TokenType.TILDE: lambda self, this: self._parse_tilde(this), 165 # https://duckdb.org/docs/stable/sql/functions/pattern_matching#similar-to 166 TokenType.SIMILAR_TO: _parse_regexp_full_match, 167 } 168 169 EXPONENT = { 170 **parser.Parser.EXPONENT, 171 TokenType.CARET: exp.Pow, 172 TokenType.DSTAR: exp.Pow, 173 } 174 175 FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "STRUCT_PACK"} 176 177 SHOW_PARSERS = { 178 "TABLES": _show_parser("TABLES"), 179 "ALL TABLES": _show_parser("ALL TABLES"), 180 } 181 182 FUNCTIONS = { 183 **{k: v for k, v in parser.Parser.FUNCTIONS.items() if k not in ("DATE_SUB", "GLOB")}, 184 **dict.fromkeys( 185 ("ARRAY_DISTINCT", "LIST_DISTINCT"), 186 lambda args: exp.ArrayDistinct(this=seq_get(args, 0), check_null=False), 187 ), 188 "ANY_VALUE": lambda args: exp.IgnoreNulls(this=exp.AnyValue.from_arg_list(args)), 189 "ARG_MAX_NULL": parser.build_arg_max_or_min_with_nulls(exp.ArgMax), 190 "ARG_MIN_NULL": parser.build_arg_max_or_min_with_nulls(exp.ArgMin), 191 "ARRAY_PREPEND": _build_array_prepend, 192 "ARRAY_REVERSE_SORT": _build_list_sort("ARRAY_REVERSE_SORT", desc=True), 193 "ARRAY_SORT": _build_list_sort("ARRAY_SORT"), 194 **dict.fromkeys( 195 ("ARRAY_SLICE", "LIST_SLICE"), 196 lambda args: exp.ArraySlice( 197 this=seq_get(args, 0), 198 start=seq_get(args, 1), 199 end=seq_get(args, 2), 200 step=seq_get(args, 3), 201 is_length=False, 202 ), 203 ), 204 "BIT_AND": exp.BitwiseAndAgg.from_arg_list, 205 "BIT_OR": exp.BitwiseOrAgg.from_arg_list, 206 "BIT_XOR": exp.BitwiseXorAgg.from_arg_list, 207 "CURRENT_LOCALTIMESTAMP": exp.Localtimestamp.from_arg_list, 208 "DATEDIFF": _build_date_diff, 209 "DATE_DIFF": _build_date_diff, 210 "DATE_TRUNC": _build_date_trunc, 211 "DATETRUNC": _build_date_trunc, 212 **dict.fromkeys(("DAYOFWEEK", "WEEKDAY"), build_dayofweek_zero_based), 213 "DECODE": lambda args: exp.Decode( 214 this=seq_get(args, 0), charset=exp.Literal.string("utf-8") 215 ), 216 "EDITDIST3": exp.Levenshtein.from_arg_list, 217 "ENCODE": lambda args: exp.Encode( 218 this=seq_get(args, 0), charset=exp.Literal.string("utf-8") 219 ), 220 "EPOCH": exp.TimeToUnix.from_arg_list, 221 "EPOCH_MS": lambda args: exp.UnixToTime(this=seq_get(args, 0), scale=exp.UnixToTime.MILLIS), 222 "FORMAT": lambda args: exp.Format(this=seq_get(args, 0), expressions=args[1:], is_fmt=True), 223 "FROM_HEX": exp.Unhex.from_arg_list, 224 "GENERATE_SERIES": _build_generate_series(), 225 "GET_CURRENT_TIME": exp.CurrentTime.from_arg_list, 226 "GET_BIT": lambda args: exp.Getbit( 227 this=seq_get(args, 0), expression=seq_get(args, 1), zero_is_msb=True 228 ), 229 "JARO_WINKLER_SIMILARITY": exp.JarowinklerSimilarity.from_arg_list, 230 "JSON": exp.ParseJSON.from_arg_list, 231 "JSON_ARRAY": lambda args: exp.JSONArray(expressions=args), 232 "JSON_EXTRACT_PATH": parser.build_extract_json_with_path(exp.JSONExtract), 233 "JSON_EXTRACT_STRING": parser.build_extract_json_with_path(exp.JSONExtractScalar), 234 "LIST": exp.ArrayAgg.from_arg_list, 235 "LIST_APPEND": exp.ArrayAppend.from_arg_list, 236 "LIST_CONCAT": parser.build_array_concat, 237 "LIST_CONTAINS": exp.ArrayContains.from_arg_list, 238 "LIST_COSINE_DISTANCE": exp.CosineDistance.from_arg_list, 239 "LIST_DISTANCE": exp.EuclideanDistance.from_arg_list, 240 "LIST_FILTER": exp.ArrayFilter.from_arg_list, 241 "LIST_HAS": exp.ArrayContains.from_arg_list, 242 "LIST_HAS_ANY": exp.ArrayOverlaps.from_arg_list, 243 "LIST_INTERSECT": exp.ArrayIntersect.from_arg_list, 244 "LIST_MAX": exp.ArrayMax.from_arg_list, 245 "LIST_MIN": exp.ArrayMin.from_arg_list, 246 "LIST_PREPEND": _build_array_prepend, 247 "LIST_REVERSE_SORT": _build_list_sort("LIST_REVERSE_SORT", desc=True), 248 "LIST_SORT": _build_list_sort("LIST_SORT"), 249 "LIST_TRANSFORM": exp.Transform.from_arg_list, 250 "LIST_VALUE": lambda args: exp.Array( 251 expressions=args, value_constructor=len(args) == 1 and isinstance(args[0], exp.Query) 252 ), 253 "MAKE_DATE": exp.DateFromParts.from_arg_list, 254 "MAKE_TIME": exp.TimeFromParts.from_arg_list, 255 "MAKE_TIMESTAMP": _build_make_timestamp, 256 "PRINTF": exp.Format.from_arg_list, 257 "QUANTILE_CONT": exp.PercentileCont.from_arg_list, 258 "QUANTILE_DISC": exp.PercentileDisc.from_arg_list, 259 "RANGE": _build_generate_series(end_exclusive=True), 260 "REGEXP_EXTRACT": build_regexp_extract(exp.RegexpExtract), 261 "REGEXP_EXTRACT_ALL": build_regexp_extract(exp.RegexpExtractAll), 262 "REGEXP_MATCHES": exp.RegexpLike.from_arg_list, 263 "REGEXP_REPLACE": lambda args: exp.RegexpReplace( 264 this=seq_get(args, 0), 265 expression=seq_get(args, 1), 266 replacement=seq_get(args, 2), 267 modifiers=seq_get(args, 3), 268 single_replace=True, 269 ), 270 "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)), 271 "STRFTIME": build_formatted_time(exp.TimeToStr), 272 "STRING_SPLIT": exp.Split.from_arg_list, 273 "STRING_SPLIT_REGEX": exp.RegexpSplit.from_arg_list, 274 "STRING_TO_ARRAY": exp.Split.from_arg_list, 275 "STRPTIME": build_formatted_time(exp.StrToTime), 276 "STRUCT_PACK": exp.Struct.from_arg_list, 277 "STR_SPLIT": exp.Split.from_arg_list, 278 "STR_SPLIT_REGEX": exp.RegexpSplit.from_arg_list, 279 "TODAY": exp.CurrentDate.from_arg_list, 280 "TIME_BUCKET": exp.DateBin.from_arg_list, 281 "TO_TIMESTAMP": exp.UnixToTime.from_arg_list, 282 "UNNEST": exp.Explode.from_arg_list, 283 "VERSION": exp.CurrentVersion.from_arg_list, 284 "XOR": binary_from_function(exp.BitwiseXor), 285 } 286 287 FUNCTION_PARSERS = { 288 **{k: v for k, v in parser.Parser.FUNCTION_PARSERS.items() if k != "DECODE"}, 289 **dict.fromkeys( 290 ("GROUP_CONCAT", "LISTAGG", "STRINGAGG"), lambda self: self._parse_string_agg() 291 ), 292 **parser.parse_distinct_arg_functions("ARG_MAX_NULL", "ARG_MIN_NULL"), 293 "APPROX_QUANTILE": lambda self: self._parse_distinct_arg_function(exp.ApproxQuantile), 294 "MAX": lambda self: self._parse_min_max(exp.Max), 295 "MIN": lambda self: self._parse_min_max(exp.Min), 296 "QUANTILE": lambda self: self._parse_distinct_arg_function(exp.Quantile), 297 "QUANTILE_CONT": lambda self: self._parse_distinct_arg_function(exp.PercentileCont), 298 "QUANTILE_DISC": lambda self: self._parse_distinct_arg_function(exp.PercentileDisc), 299 } 300 301 NO_PAREN_FUNCTION_PARSERS = { 302 **parser.Parser.NO_PAREN_FUNCTION_PARSERS, 303 "MAP": lambda self: self._parse_map(), 304 "@": lambda self: exp.Abs(this=self._parse_bitwise()), 305 } 306 307 PLACEHOLDER_PARSERS = { 308 **parser.Parser.PLACEHOLDER_PARSERS, 309 TokenType.PARAMETER: lambda self: ( 310 self.expression( 311 exp.Placeholder( 312 this=self._identifier_expression(quoted=True) 313 if self._prev.token_type == TokenType.IDENTIFIER 314 else self._prev.text 315 ) 316 ) 317 if self._match(TokenType.NUMBER) or self._match_set(self.ID_VAR_TOKENS) 318 else None 319 ), 320 } 321 322 TYPE_CONVERTERS = { 323 # https://duckdb.org/docs/sql/data_types/numeric 324 exp.DType.DECIMAL: build_default_decimal_type(precision=18, scale=3), 325 # https://duckdb.org/docs/sql/data_types/text 326 exp.DType.TEXT: _convert_text_type, 327 } 328 329 STATEMENT_PARSERS = { 330 **parser.Parser.STATEMENT_PARSERS, 331 TokenType.ATTACH: lambda self: self._parse_attach_detach(), 332 TokenType.CONNECT: lambda self: self.expression( 333 exp.ConnectTo(this=self._parse_string() or self._parse_id_var()) 334 ), 335 TokenType.DETACH: lambda self: self._parse_attach_detach(is_attach=False), 336 TokenType.DISCONNECT: lambda self: self.expression(exp.Disconnect()), 337 TokenType.FORCE: lambda self: self._parse_force(), 338 TokenType.INSTALL: lambda self: self._parse_install(), 339 TokenType.SHOW: lambda self: self._parse_show(), 340 } 341 342 SET_PARSERS = { 343 **parser.Parser.SET_PARSERS, 344 "VARIABLE": lambda self: self._parse_set_item_assignment("VARIABLE"), 345 } 346 347 SHOW_TRIE = new_trie(key.split(" ") for key in SHOW_PARSERS) 348 SET_TRIE = new_trie(key.split(" ") for key in SET_PARSERS) 349 350 def _parse_min_max(self, func: type[exp.Min] | type[exp.Max]) -> exp.Min | exp.Max: 351 expression = self._parse_distinct_arg_function(func) 352 if len(expression.expressions) > 1: 353 self.raise_error(f"Expected at most 2 arguments for {func.__name__}") 354 expression.set("count", seq_get(expression.expressions, 0)) 355 expression.set("expressions", None) 356 return expression 357 358 def _parse_tilde(self, this: exp.Expr | None) -> exp.Expr | None: 359 # ~ and !~ match anywhere in the string since DuckDB 2.0, and the whole string before it 360 # https://duckdb.org/docs/2.0/sql/functions/pattern_matching 361 if self.dialect.version >= (2, 0): 362 return _parse_regexp_like(self, this) 363 return _parse_regexp_full_match(self, this) 364 365 def _parse_trigger_execute(self) -> exp.Expr | None: 366 body = self._try_parse(self._parse_statement) 367 return body if not self._curr else None 368 369 def _parse_function_properties(self) -> exp.Properties | None: 370 if self._match(TokenType.TABLE): 371 return exp.Properties( 372 expressions=[ 373 exp.ReturnsProperty( 374 this=exp.Schema(this=exp.var("TABLE")), 375 is_table=True, 376 ), 377 ] 378 ) 379 return super()._parse_function_properties() 380 381 def _parse_lambda(self, alias: bool = False) -> exp.Expr | None: 382 index = self._index 383 if not self._match_text_seq("LAMBDA"): 384 return super()._parse_lambda(alias=alias) 385 386 expressions = self._parse_csv(self._parse_lambda_arg) 387 if not self._match(TokenType.COLON): 388 self._retreat(index) 389 return None 390 391 this = self._replace_lambda(self._parse_assignment(), expressions) 392 return self.expression(exp.Lambda(this=this, expressions=expressions)) 393 394 def _parse_expression(self) -> exp.Expr | None: 395 # DuckDB supports prefix aliases, e.g. foo: 1 396 if self._next.token_type == TokenType.COLON: 397 alias = self._parse_id_var(tokens=self.ALIAS_TOKENS) 398 self._match(TokenType.COLON) 399 comments = self._prev_comments 400 401 this = self._parse_assignment() 402 if isinstance(this, exp.Expr): 403 # Moves the comment next to the alias in `alias: expr /* comment */` 404 comments += this.pop_comments() or [] 405 406 return self.expression(exp.Alias(this=this, alias=alias), comments=comments) 407 408 return super()._parse_expression() 409 410 def _parse_table( 411 self, 412 schema: bool = False, 413 joins: bool = False, 414 alias_tokens: Collection[TokenType] | None = None, 415 parse_bracket: bool = False, 416 is_db_reference: bool = False, 417 parse_partition: bool = False, 418 consume_pipe: bool = False, 419 ) -> exp.Expr | None: 420 # DuckDB supports prefix aliases, e.g. FROM foo: bar 421 if self._next.token_type == TokenType.COLON: 422 alias = self._parse_table_alias(alias_tokens=alias_tokens or self.TABLE_ALIAS_TOKENS) 423 self._match(TokenType.COLON) 424 comments = self._prev_comments 425 else: 426 alias = None 427 comments = [] 428 429 table = super()._parse_table( 430 schema=schema, 431 joins=joins, 432 alias_tokens=alias_tokens, 433 parse_bracket=parse_bracket, 434 is_db_reference=is_db_reference, 435 parse_partition=parse_partition, 436 ) 437 if isinstance(table, exp.Expr) and isinstance(alias, exp.TableAlias): 438 # Moves the comment next to the alias in `alias: table /* comment */` 439 comments += table.pop_comments() or [] 440 alias.comments = alias.pop_comments() + comments 441 table.set("alias", alias) 442 443 return table 444 445 def _parse_table_alias( 446 self, alias_tokens: Collection[TokenType] | None = None 447 ) -> exp.TableAlias | None: 448 if ( 449 self._match_text_seq("NEAREST", advance=False) 450 and self._next.token_type == TokenType.NUMBER 451 ) or self._match_text_seq("APPROX", "NEAREST", advance=False): 452 return None 453 454 return super()._parse_table_alias(alias_tokens=alias_tokens) 455 456 def _parse_join( 457 self, 458 skip_join_token: bool = False, 459 parse_bracket: bool = False, 460 alias_tokens: Collection[TokenType] | None = None, 461 ) -> exp.Join | None: 462 join_type = None 463 if self._match_text_seq("JOIN", "BY", "(", "TYPE"): 464 join_type = self._parse_var(any_token=True) 465 self._match_r_paren() 466 skip_join_token = True 467 468 join = super()._parse_join( 469 skip_join_token=skip_join_token, 470 parse_bracket=parse_bracket, 471 alias_tokens=alias_tokens, 472 ) 473 if not join: 474 return join 475 476 if join_type: 477 parts = join_type.name.upper().removesuffix("_JOIN").split("_") 478 if parts[0] in ("LEFT", "RIGHT", "FULL"): 479 join.set("side", parts.pop(0)) 480 join.set("kind", " ".join(parts) or None) 481 482 approximate = self._match_text_seq("APPROX", "NEAREST") 483 if approximate or self._match_text_seq("NEAREST"): 484 if join.kind == "CROSS": 485 join.set("kind", None) 486 count = self._parse_number() 487 488 if not self._match_text_seq("BY"): 489 self.raise_error("Expected BY after NEAREST count") 490 if not self._match_texts(("DISTANCE", "SIMILARITY")): 491 self.raise_error("Expected DISTANCE or SIMILARITY after BY") 492 493 similarity = self._prev.text.upper() == "SIMILARITY" 494 join.set( 495 "nearest", 496 self.expression( 497 exp.Nearest( 498 this=self._parse_disjunction(), 499 count=count, 500 approximate=approximate, 501 similarity=similarity, 502 ) 503 ), 504 ) 505 506 return join 507 508 def _parse_table_sample(self, as_modifier: bool = False) -> exp.TableSample | None: 509 # https://duckdb.org/docs/sql/samples.html 510 sample = super()._parse_table_sample(as_modifier=as_modifier) 511 if sample and not sample.args.get("method"): 512 if sample.args.get("size"): 513 sample.set("method", exp.var("RESERVOIR")) 514 else: 515 sample.set("method", exp.var("SYSTEM")) 516 517 return sample 518 519 def _parse_bracket_key_value( 520 self, is_map: bool = False, is_subscript: bool = False 521 ) -> exp.Expr | None: 522 if is_subscript and self._match(TokenType.COLON, advance=False): 523 return self._parse_slice(None) 524 return super()._parse_bracket_key_value(is_map=is_map, is_subscript=is_subscript) 525 526 def _parse_bracket(self, this: exp.Expr | None = None) -> exp.Expr | None: 527 bracket = super()._parse_bracket(this) 528 529 if self.dialect.version < (1, 2) and isinstance(bracket, exp.Bracket): 530 # https://duckdb.org/2025/02/05/announcing-duckdb-120.html#breaking-changes 531 bracket.set("returns_list_for_maps", True) 532 533 return bracket 534 535 def _parse_map(self) -> exp.ToMap | exp.Map: 536 if self._match(TokenType.L_BRACE, advance=False): 537 return self.expression(exp.ToMap(this=self._parse_bracket())) 538 539 args = self._parse_wrapped_csv(self._parse_assignment) 540 return self.expression(exp.Map(keys=seq_get(args, 0), values=seq_get(args, 1))) 541 542 def _parse_struct_types(self, type_required: bool = False) -> exp.Expr | None: 543 return self._parse_field_def() 544 545 def _pivot_column_names(self, aggregations: list[exp.Expr]) -> list[str]: 546 if len(aggregations) == 1: 547 return super()._pivot_column_names(aggregations) 548 return pivot_column_names(aggregations, dialect="duckdb") 549 550 def _parse_attach_detach(self, is_attach: bool = True) -> exp.Attach | exp.Detach: 551 def _parse_attach_option() -> exp.AttachOption: 552 return self.expression( 553 exp.AttachOption( 554 this=self._parse_var(any_token=True), 555 expression=self._parse_field(any_token=True), 556 ) 557 ) 558 559 self._match(TokenType.DATABASE) 560 exists = self._parse_exists(not_=is_attach) 561 this = self._parse_alias(self._parse_primary_or_var(), explicit=True) 562 563 if self._match(TokenType.L_PAREN, advance=False): 564 expressions = self._parse_wrapped_csv(_parse_attach_option) 565 else: 566 expressions = None 567 568 return ( 569 self.expression(exp.Attach(this=this, exists=exists, expressions=expressions)) 570 if is_attach 571 else self.expression(exp.Detach(this=this, exists=exists)) 572 ) 573 574 def _parse_show_duckdb(self, this: str) -> exp.Show: 575 from_ = self._parse_table(schema=True) if self._match(TokenType.FROM) else None 576 return self.expression(exp.Show(this=this, from_=from_)) 577 578 def _parse_force(self) -> exp.Install | exp.Command: 579 # FORCE can only be followed by INSTALL or CHECKPOINT 580 # In the case of CHECKPOINT, we fallback 581 if not self._match(TokenType.INSTALL): 582 return self._parse_as_command(self._prev) 583 584 return self._parse_install(force=True) 585 586 def _parse_install(self, force: bool = False) -> exp.Install: 587 return self.expression( 588 exp.Install( 589 this=self._parse_id_var(), 590 from_=self._parse_var_or_string() if self._match(TokenType.FROM) else None, 591 force=force, 592 ) 593 ) 594 595 def _parse_primary(self) -> exp.Expr | None: 596 if self._match_pair(TokenType.HASH, TokenType.NUMBER): 597 return exp.PositionalColumn(this=exp.Literal.number(self._prev.text)) 598 599 return super()._parse_primary()
124class DuckDBParser(parser.Parser): 125 EXTRACT_FUNCTIONS = dict.fromkeys(("DAYOFWEEK", "DOW", "WEEKDAY"), build_dayofweek_zero_based) 126 127 SUPPORTS_TABLE_QUERY = True 128 129 IS_PREDICATE_PRECEDENCE = IsPredicatePrecedence.LOW 130 131 MAP_KEYS_ARE_ARBITRARY_EXPRESSIONS = True 132 PIVOT_COLUMN_NAMING = "agg_name_if_aliased_or_multiple" 133 134 SUPPORTS_DIRECTED_JOIN = False 135 136 JOIN_KINDS = parser.Parser.JOIN_KINDS - {TokenType.STRAIGHT_JOIN} 137 138 NO_PAREN_FUNCTIONS = { 139 **parser.Parser.NO_PAREN_FUNCTIONS, 140 TokenType.LOCALTIME: exp.Localtime, 141 TokenType.LOCALTIMESTAMP: exp.Localtimestamp, 142 TokenType.CURRENT_CATALOG: exp.CurrentCatalog, 143 TokenType.SESSION_USER: exp.SessionUser, 144 } 145 146 BITWISE = { 147 **{k: v for k, v in parser.Parser.BITWISE.items() if k != TokenType.CARET}, 148 TokenType.LT_EQ_GT: exp.CosineDistance, 149 } 150 151 COLUMN_OPERATORS = { 152 k: v 153 for k, v in parser.Parser.COLUMN_OPERATORS.items() 154 if k not in (TokenType.ARROW, TokenType.DARROW) 155 } 156 157 JSON_OPERATORS = { 158 TokenType.ARROW: parser.build_json_extract, 159 TokenType.DARROW: parser.build_json_extract_scalar, 160 } 161 162 RANGE_PARSERS = { 163 **parser.Parser.RANGE_PARSERS, 164 TokenType.DAMP: binary_range_parser(exp.ArrayOverlaps), 165 TokenType.TILDE: lambda self, this: self._parse_tilde(this), 166 # https://duckdb.org/docs/stable/sql/functions/pattern_matching#similar-to 167 TokenType.SIMILAR_TO: _parse_regexp_full_match, 168 } 169 170 EXPONENT = { 171 **parser.Parser.EXPONENT, 172 TokenType.CARET: exp.Pow, 173 TokenType.DSTAR: exp.Pow, 174 } 175 176 FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "STRUCT_PACK"} 177 178 SHOW_PARSERS = { 179 "TABLES": _show_parser("TABLES"), 180 "ALL TABLES": _show_parser("ALL TABLES"), 181 } 182 183 FUNCTIONS = { 184 **{k: v for k, v in parser.Parser.FUNCTIONS.items() if k not in ("DATE_SUB", "GLOB")}, 185 **dict.fromkeys( 186 ("ARRAY_DISTINCT", "LIST_DISTINCT"), 187 lambda args: exp.ArrayDistinct(this=seq_get(args, 0), check_null=False), 188 ), 189 "ANY_VALUE": lambda args: exp.IgnoreNulls(this=exp.AnyValue.from_arg_list(args)), 190 "ARG_MAX_NULL": parser.build_arg_max_or_min_with_nulls(exp.ArgMax), 191 "ARG_MIN_NULL": parser.build_arg_max_or_min_with_nulls(exp.ArgMin), 192 "ARRAY_PREPEND": _build_array_prepend, 193 "ARRAY_REVERSE_SORT": _build_list_sort("ARRAY_REVERSE_SORT", desc=True), 194 "ARRAY_SORT": _build_list_sort("ARRAY_SORT"), 195 **dict.fromkeys( 196 ("ARRAY_SLICE", "LIST_SLICE"), 197 lambda args: exp.ArraySlice( 198 this=seq_get(args, 0), 199 start=seq_get(args, 1), 200 end=seq_get(args, 2), 201 step=seq_get(args, 3), 202 is_length=False, 203 ), 204 ), 205 "BIT_AND": exp.BitwiseAndAgg.from_arg_list, 206 "BIT_OR": exp.BitwiseOrAgg.from_arg_list, 207 "BIT_XOR": exp.BitwiseXorAgg.from_arg_list, 208 "CURRENT_LOCALTIMESTAMP": exp.Localtimestamp.from_arg_list, 209 "DATEDIFF": _build_date_diff, 210 "DATE_DIFF": _build_date_diff, 211 "DATE_TRUNC": _build_date_trunc, 212 "DATETRUNC": _build_date_trunc, 213 **dict.fromkeys(("DAYOFWEEK", "WEEKDAY"), build_dayofweek_zero_based), 214 "DECODE": lambda args: exp.Decode( 215 this=seq_get(args, 0), charset=exp.Literal.string("utf-8") 216 ), 217 "EDITDIST3": exp.Levenshtein.from_arg_list, 218 "ENCODE": lambda args: exp.Encode( 219 this=seq_get(args, 0), charset=exp.Literal.string("utf-8") 220 ), 221 "EPOCH": exp.TimeToUnix.from_arg_list, 222 "EPOCH_MS": lambda args: exp.UnixToTime(this=seq_get(args, 0), scale=exp.UnixToTime.MILLIS), 223 "FORMAT": lambda args: exp.Format(this=seq_get(args, 0), expressions=args[1:], is_fmt=True), 224 "FROM_HEX": exp.Unhex.from_arg_list, 225 "GENERATE_SERIES": _build_generate_series(), 226 "GET_CURRENT_TIME": exp.CurrentTime.from_arg_list, 227 "GET_BIT": lambda args: exp.Getbit( 228 this=seq_get(args, 0), expression=seq_get(args, 1), zero_is_msb=True 229 ), 230 "JARO_WINKLER_SIMILARITY": exp.JarowinklerSimilarity.from_arg_list, 231 "JSON": exp.ParseJSON.from_arg_list, 232 "JSON_ARRAY": lambda args: exp.JSONArray(expressions=args), 233 "JSON_EXTRACT_PATH": parser.build_extract_json_with_path(exp.JSONExtract), 234 "JSON_EXTRACT_STRING": parser.build_extract_json_with_path(exp.JSONExtractScalar), 235 "LIST": exp.ArrayAgg.from_arg_list, 236 "LIST_APPEND": exp.ArrayAppend.from_arg_list, 237 "LIST_CONCAT": parser.build_array_concat, 238 "LIST_CONTAINS": exp.ArrayContains.from_arg_list, 239 "LIST_COSINE_DISTANCE": exp.CosineDistance.from_arg_list, 240 "LIST_DISTANCE": exp.EuclideanDistance.from_arg_list, 241 "LIST_FILTER": exp.ArrayFilter.from_arg_list, 242 "LIST_HAS": exp.ArrayContains.from_arg_list, 243 "LIST_HAS_ANY": exp.ArrayOverlaps.from_arg_list, 244 "LIST_INTERSECT": exp.ArrayIntersect.from_arg_list, 245 "LIST_MAX": exp.ArrayMax.from_arg_list, 246 "LIST_MIN": exp.ArrayMin.from_arg_list, 247 "LIST_PREPEND": _build_array_prepend, 248 "LIST_REVERSE_SORT": _build_list_sort("LIST_REVERSE_SORT", desc=True), 249 "LIST_SORT": _build_list_sort("LIST_SORT"), 250 "LIST_TRANSFORM": exp.Transform.from_arg_list, 251 "LIST_VALUE": lambda args: exp.Array( 252 expressions=args, value_constructor=len(args) == 1 and isinstance(args[0], exp.Query) 253 ), 254 "MAKE_DATE": exp.DateFromParts.from_arg_list, 255 "MAKE_TIME": exp.TimeFromParts.from_arg_list, 256 "MAKE_TIMESTAMP": _build_make_timestamp, 257 "PRINTF": exp.Format.from_arg_list, 258 "QUANTILE_CONT": exp.PercentileCont.from_arg_list, 259 "QUANTILE_DISC": exp.PercentileDisc.from_arg_list, 260 "RANGE": _build_generate_series(end_exclusive=True), 261 "REGEXP_EXTRACT": build_regexp_extract(exp.RegexpExtract), 262 "REGEXP_EXTRACT_ALL": build_regexp_extract(exp.RegexpExtractAll), 263 "REGEXP_MATCHES": exp.RegexpLike.from_arg_list, 264 "REGEXP_REPLACE": lambda args: exp.RegexpReplace( 265 this=seq_get(args, 0), 266 expression=seq_get(args, 1), 267 replacement=seq_get(args, 2), 268 modifiers=seq_get(args, 3), 269 single_replace=True, 270 ), 271 "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)), 272 "STRFTIME": build_formatted_time(exp.TimeToStr), 273 "STRING_SPLIT": exp.Split.from_arg_list, 274 "STRING_SPLIT_REGEX": exp.RegexpSplit.from_arg_list, 275 "STRING_TO_ARRAY": exp.Split.from_arg_list, 276 "STRPTIME": build_formatted_time(exp.StrToTime), 277 "STRUCT_PACK": exp.Struct.from_arg_list, 278 "STR_SPLIT": exp.Split.from_arg_list, 279 "STR_SPLIT_REGEX": exp.RegexpSplit.from_arg_list, 280 "TODAY": exp.CurrentDate.from_arg_list, 281 "TIME_BUCKET": exp.DateBin.from_arg_list, 282 "TO_TIMESTAMP": exp.UnixToTime.from_arg_list, 283 "UNNEST": exp.Explode.from_arg_list, 284 "VERSION": exp.CurrentVersion.from_arg_list, 285 "XOR": binary_from_function(exp.BitwiseXor), 286 } 287 288 FUNCTION_PARSERS = { 289 **{k: v for k, v in parser.Parser.FUNCTION_PARSERS.items() if k != "DECODE"}, 290 **dict.fromkeys( 291 ("GROUP_CONCAT", "LISTAGG", "STRINGAGG"), lambda self: self._parse_string_agg() 292 ), 293 **parser.parse_distinct_arg_functions("ARG_MAX_NULL", "ARG_MIN_NULL"), 294 "APPROX_QUANTILE": lambda self: self._parse_distinct_arg_function(exp.ApproxQuantile), 295 "MAX": lambda self: self._parse_min_max(exp.Max), 296 "MIN": lambda self: self._parse_min_max(exp.Min), 297 "QUANTILE": lambda self: self._parse_distinct_arg_function(exp.Quantile), 298 "QUANTILE_CONT": lambda self: self._parse_distinct_arg_function(exp.PercentileCont), 299 "QUANTILE_DISC": lambda self: self._parse_distinct_arg_function(exp.PercentileDisc), 300 } 301 302 NO_PAREN_FUNCTION_PARSERS = { 303 **parser.Parser.NO_PAREN_FUNCTION_PARSERS, 304 "MAP": lambda self: self._parse_map(), 305 "@": lambda self: exp.Abs(this=self._parse_bitwise()), 306 } 307 308 PLACEHOLDER_PARSERS = { 309 **parser.Parser.PLACEHOLDER_PARSERS, 310 TokenType.PARAMETER: lambda self: ( 311 self.expression( 312 exp.Placeholder( 313 this=self._identifier_expression(quoted=True) 314 if self._prev.token_type == TokenType.IDENTIFIER 315 else self._prev.text 316 ) 317 ) 318 if self._match(TokenType.NUMBER) or self._match_set(self.ID_VAR_TOKENS) 319 else None 320 ), 321 } 322 323 TYPE_CONVERTERS = { 324 # https://duckdb.org/docs/sql/data_types/numeric 325 exp.DType.DECIMAL: build_default_decimal_type(precision=18, scale=3), 326 # https://duckdb.org/docs/sql/data_types/text 327 exp.DType.TEXT: _convert_text_type, 328 } 329 330 STATEMENT_PARSERS = { 331 **parser.Parser.STATEMENT_PARSERS, 332 TokenType.ATTACH: lambda self: self._parse_attach_detach(), 333 TokenType.CONNECT: lambda self: self.expression( 334 exp.ConnectTo(this=self._parse_string() or self._parse_id_var()) 335 ), 336 TokenType.DETACH: lambda self: self._parse_attach_detach(is_attach=False), 337 TokenType.DISCONNECT: lambda self: self.expression(exp.Disconnect()), 338 TokenType.FORCE: lambda self: self._parse_force(), 339 TokenType.INSTALL: lambda self: self._parse_install(), 340 TokenType.SHOW: lambda self: self._parse_show(), 341 } 342 343 SET_PARSERS = { 344 **parser.Parser.SET_PARSERS, 345 "VARIABLE": lambda self: self._parse_set_item_assignment("VARIABLE"), 346 } 347 348 SHOW_TRIE = new_trie(key.split(" ") for key in SHOW_PARSERS) 349 SET_TRIE = new_trie(key.split(" ") for key in SET_PARSERS) 350 351 def _parse_min_max(self, func: type[exp.Min] | type[exp.Max]) -> exp.Min | exp.Max: 352 expression = self._parse_distinct_arg_function(func) 353 if len(expression.expressions) > 1: 354 self.raise_error(f"Expected at most 2 arguments for {func.__name__}") 355 expression.set("count", seq_get(expression.expressions, 0)) 356 expression.set("expressions", None) 357 return expression 358 359 def _parse_tilde(self, this: exp.Expr | None) -> exp.Expr | None: 360 # ~ and !~ match anywhere in the string since DuckDB 2.0, and the whole string before it 361 # https://duckdb.org/docs/2.0/sql/functions/pattern_matching 362 if self.dialect.version >= (2, 0): 363 return _parse_regexp_like(self, this) 364 return _parse_regexp_full_match(self, this) 365 366 def _parse_trigger_execute(self) -> exp.Expr | None: 367 body = self._try_parse(self._parse_statement) 368 return body if not self._curr else None 369 370 def _parse_function_properties(self) -> exp.Properties | None: 371 if self._match(TokenType.TABLE): 372 return exp.Properties( 373 expressions=[ 374 exp.ReturnsProperty( 375 this=exp.Schema(this=exp.var("TABLE")), 376 is_table=True, 377 ), 378 ] 379 ) 380 return super()._parse_function_properties() 381 382 def _parse_lambda(self, alias: bool = False) -> exp.Expr | None: 383 index = self._index 384 if not self._match_text_seq("LAMBDA"): 385 return super()._parse_lambda(alias=alias) 386 387 expressions = self._parse_csv(self._parse_lambda_arg) 388 if not self._match(TokenType.COLON): 389 self._retreat(index) 390 return None 391 392 this = self._replace_lambda(self._parse_assignment(), expressions) 393 return self.expression(exp.Lambda(this=this, expressions=expressions)) 394 395 def _parse_expression(self) -> exp.Expr | None: 396 # DuckDB supports prefix aliases, e.g. foo: 1 397 if self._next.token_type == TokenType.COLON: 398 alias = self._parse_id_var(tokens=self.ALIAS_TOKENS) 399 self._match(TokenType.COLON) 400 comments = self._prev_comments 401 402 this = self._parse_assignment() 403 if isinstance(this, exp.Expr): 404 # Moves the comment next to the alias in `alias: expr /* comment */` 405 comments += this.pop_comments() or [] 406 407 return self.expression(exp.Alias(this=this, alias=alias), comments=comments) 408 409 return super()._parse_expression() 410 411 def _parse_table( 412 self, 413 schema: bool = False, 414 joins: bool = False, 415 alias_tokens: Collection[TokenType] | None = None, 416 parse_bracket: bool = False, 417 is_db_reference: bool = False, 418 parse_partition: bool = False, 419 consume_pipe: bool = False, 420 ) -> exp.Expr | None: 421 # DuckDB supports prefix aliases, e.g. FROM foo: bar 422 if self._next.token_type == TokenType.COLON: 423 alias = self._parse_table_alias(alias_tokens=alias_tokens or self.TABLE_ALIAS_TOKENS) 424 self._match(TokenType.COLON) 425 comments = self._prev_comments 426 else: 427 alias = None 428 comments = [] 429 430 table = super()._parse_table( 431 schema=schema, 432 joins=joins, 433 alias_tokens=alias_tokens, 434 parse_bracket=parse_bracket, 435 is_db_reference=is_db_reference, 436 parse_partition=parse_partition, 437 ) 438 if isinstance(table, exp.Expr) and isinstance(alias, exp.TableAlias): 439 # Moves the comment next to the alias in `alias: table /* comment */` 440 comments += table.pop_comments() or [] 441 alias.comments = alias.pop_comments() + comments 442 table.set("alias", alias) 443 444 return table 445 446 def _parse_table_alias( 447 self, alias_tokens: Collection[TokenType] | None = None 448 ) -> exp.TableAlias | None: 449 if ( 450 self._match_text_seq("NEAREST", advance=False) 451 and self._next.token_type == TokenType.NUMBER 452 ) or self._match_text_seq("APPROX", "NEAREST", advance=False): 453 return None 454 455 return super()._parse_table_alias(alias_tokens=alias_tokens) 456 457 def _parse_join( 458 self, 459 skip_join_token: bool = False, 460 parse_bracket: bool = False, 461 alias_tokens: Collection[TokenType] | None = None, 462 ) -> exp.Join | None: 463 join_type = None 464 if self._match_text_seq("JOIN", "BY", "(", "TYPE"): 465 join_type = self._parse_var(any_token=True) 466 self._match_r_paren() 467 skip_join_token = True 468 469 join = super()._parse_join( 470 skip_join_token=skip_join_token, 471 parse_bracket=parse_bracket, 472 alias_tokens=alias_tokens, 473 ) 474 if not join: 475 return join 476 477 if join_type: 478 parts = join_type.name.upper().removesuffix("_JOIN").split("_") 479 if parts[0] in ("LEFT", "RIGHT", "FULL"): 480 join.set("side", parts.pop(0)) 481 join.set("kind", " ".join(parts) or None) 482 483 approximate = self._match_text_seq("APPROX", "NEAREST") 484 if approximate or self._match_text_seq("NEAREST"): 485 if join.kind == "CROSS": 486 join.set("kind", None) 487 count = self._parse_number() 488 489 if not self._match_text_seq("BY"): 490 self.raise_error("Expected BY after NEAREST count") 491 if not self._match_texts(("DISTANCE", "SIMILARITY")): 492 self.raise_error("Expected DISTANCE or SIMILARITY after BY") 493 494 similarity = self._prev.text.upper() == "SIMILARITY" 495 join.set( 496 "nearest", 497 self.expression( 498 exp.Nearest( 499 this=self._parse_disjunction(), 500 count=count, 501 approximate=approximate, 502 similarity=similarity, 503 ) 504 ), 505 ) 506 507 return join 508 509 def _parse_table_sample(self, as_modifier: bool = False) -> exp.TableSample | None: 510 # https://duckdb.org/docs/sql/samples.html 511 sample = super()._parse_table_sample(as_modifier=as_modifier) 512 if sample and not sample.args.get("method"): 513 if sample.args.get("size"): 514 sample.set("method", exp.var("RESERVOIR")) 515 else: 516 sample.set("method", exp.var("SYSTEM")) 517 518 return sample 519 520 def _parse_bracket_key_value( 521 self, is_map: bool = False, is_subscript: bool = False 522 ) -> exp.Expr | None: 523 if is_subscript and self._match(TokenType.COLON, advance=False): 524 return self._parse_slice(None) 525 return super()._parse_bracket_key_value(is_map=is_map, is_subscript=is_subscript) 526 527 def _parse_bracket(self, this: exp.Expr | None = None) -> exp.Expr | None: 528 bracket = super()._parse_bracket(this) 529 530 if self.dialect.version < (1, 2) and isinstance(bracket, exp.Bracket): 531 # https://duckdb.org/2025/02/05/announcing-duckdb-120.html#breaking-changes 532 bracket.set("returns_list_for_maps", True) 533 534 return bracket 535 536 def _parse_map(self) -> exp.ToMap | exp.Map: 537 if self._match(TokenType.L_BRACE, advance=False): 538 return self.expression(exp.ToMap(this=self._parse_bracket())) 539 540 args = self._parse_wrapped_csv(self._parse_assignment) 541 return self.expression(exp.Map(keys=seq_get(args, 0), values=seq_get(args, 1))) 542 543 def _parse_struct_types(self, type_required: bool = False) -> exp.Expr | None: 544 return self._parse_field_def() 545 546 def _pivot_column_names(self, aggregations: list[exp.Expr]) -> list[str]: 547 if len(aggregations) == 1: 548 return super()._pivot_column_names(aggregations) 549 return pivot_column_names(aggregations, dialect="duckdb") 550 551 def _parse_attach_detach(self, is_attach: bool = True) -> exp.Attach | exp.Detach: 552 def _parse_attach_option() -> exp.AttachOption: 553 return self.expression( 554 exp.AttachOption( 555 this=self._parse_var(any_token=True), 556 expression=self._parse_field(any_token=True), 557 ) 558 ) 559 560 self._match(TokenType.DATABASE) 561 exists = self._parse_exists(not_=is_attach) 562 this = self._parse_alias(self._parse_primary_or_var(), explicit=True) 563 564 if self._match(TokenType.L_PAREN, advance=False): 565 expressions = self._parse_wrapped_csv(_parse_attach_option) 566 else: 567 expressions = None 568 569 return ( 570 self.expression(exp.Attach(this=this, exists=exists, expressions=expressions)) 571 if is_attach 572 else self.expression(exp.Detach(this=this, exists=exists)) 573 ) 574 575 def _parse_show_duckdb(self, this: str) -> exp.Show: 576 from_ = self._parse_table(schema=True) if self._match(TokenType.FROM) else None 577 return self.expression(exp.Show(this=this, from_=from_)) 578 579 def _parse_force(self) -> exp.Install | exp.Command: 580 # FORCE can only be followed by INSTALL or CHECKPOINT 581 # In the case of CHECKPOINT, we fallback 582 if not self._match(TokenType.INSTALL): 583 return self._parse_as_command(self._prev) 584 585 return self._parse_install(force=True) 586 587 def _parse_install(self, force: bool = False) -> exp.Install: 588 return self.expression( 589 exp.Install( 590 this=self._parse_id_var(), 591 from_=self._parse_var_or_string() if self._match(TokenType.FROM) else None, 592 force=force, 593 ) 594 ) 595 596 def _parse_primary(self) -> exp.Expr | None: 597 if self._match_pair(TokenType.HASH, TokenType.NUMBER): 598 return exp.PositionalColumn(this=exp.Literal.number(self._prev.text)) 599 600 return super()._parse_primary()
Parser consumes a list of tokens produced by the Tokenizer and produces a parsed syntax tree.
Arguments:
- error_level: The desired error level. Default: ErrorLevel.IMMEDIATE
- error_message_context: The amount of context to capture from a query string when displaying the error message (in number of characters). Default: 100
- max_errors: Maximum number of error messages to include in a raised ParseError. This is only relevant if error_level is ErrorLevel.RAISE. Default: 3
- max_nodes: Maximum number of AST nodes to prevent memory exhaustion. Set to -1 (default) to disable the check.
EXTRACT_FUNCTIONS =
{'DAYOFWEEK': <function build_dayofweek_zero_based>, 'DOW': <function build_dayofweek_zero_based>, 'WEEKDAY': <function build_dayofweek_zero_based>}
JOIN_KINDS =
{<TokenType.ANTI: 229>, <TokenType.OUTER: 357>, <TokenType.SEMI: 399>, <TokenType.INNER: 309>, <TokenType.CROSS: 253>}
NO_PAREN_FUNCTIONS =
{<TokenType.CURRENT_DATE: 255>: <class 'sqlglot.expressions.temporal.CurrentDate'>, <TokenType.CURRENT_DATETIME: 256>: <class 'sqlglot.expressions.temporal.CurrentDate'>, <TokenType.CURRENT_TIME: 258>: <class 'sqlglot.expressions.temporal.CurrentTime'>, <TokenType.CURRENT_TIMESTAMP: 259>: <class 'sqlglot.expressions.temporal.CurrentTimestamp'>, <TokenType.CURRENT_USER: 260>: <class 'sqlglot.expressions.functions.CurrentUser'>, <TokenType.CURRENT_ROLE: 262>: <class 'sqlglot.expressions.functions.CurrentRole'>, <TokenType.LOCALTIME: 186>: <class 'sqlglot.expressions.temporal.Localtime'>, <TokenType.LOCALTIMESTAMP: 187>: <class 'sqlglot.expressions.temporal.Localtimestamp'>, <TokenType.CURRENT_CATALOG: 263>: <class 'sqlglot.expressions.functions.CurrentCatalog'>, <TokenType.SESSION_USER: 63>: <class 'sqlglot.expressions.functions.SessionUser'>}
BITWISE =
{<TokenType.AMP: 37>: <class 'sqlglot.expressions.core.BitwiseAnd'>, <TokenType.PIPE: 40>: <class 'sqlglot.expressions.core.BitwiseOr'>, <TokenType.LT_EQ_GT: 31>: <class 'sqlglot.expressions.math.CosineDistance'>}
COLUMN_OPERATORS =
{<TokenType.DOT: 8>: None, <TokenType.DOTCOLON: 12>: <function Parser.<lambda>>, <TokenType.DCOLON: 14>: <function Parser.<lambda>>, <TokenType.HASH_ARROW: 50>: <function Parser.<lambda>>, <TokenType.DHASH_ARROW: 51>: <function Parser.<lambda>>, <TokenType.PLACEHOLDER: 367>: <function Parser.<lambda>>}
JSON_OPERATORS =
{<TokenType.ARROW: 46>: <function build_json_extract>, <TokenType.DARROW: 47>: <function build_json_extract_scalar>}
RANGE_PARSERS =
{<TokenType.AT_GT: 58>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.BETWEEN: 238>: <function Parser.<lambda>>, <TokenType.GLOB: 297>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.ILIKE: 305>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IN: 306>: <function Parser.<lambda>>, <TokenType.IRLIKE: 317>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IS: 318>: <function Parser.<lambda>>, <TokenType.LIKE: 328>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.LT_AT: 57>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OVERLAPS: 359>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.RLIKE: 391>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.SIMILAR_TO: 406>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.FOR: 289>: <function Parser.<lambda>>, <TokenType.QMARK_AMP: 70>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.QMARK_PIPE: 71>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.HASH_DASH: 72>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.AT_QMARK: 56>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.ADJACENT: 67>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OPERATOR: 350>: <function Parser.<lambda>>, <TokenType.AMP_LT: 65>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.AMP_GT: 66>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.CARET_AT: 44>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.DAMP: 64>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.TILDE: 45>: <function DuckDBParser.<lambda>>}
EXPONENT =
{<TokenType.CARET: 43>: <class 'sqlglot.expressions.core.Pow'>, <TokenType.DSTAR: 69>: <class 'sqlglot.expressions.core.Pow'>}
SHOW_PARSERS =
{'TABLES': <function _show_parser.<locals>._parse>, 'ALL TABLES': <function _show_parser.<locals>._parse>}
FUNCTIONS =
{'AI_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.AIAgg'>>, 'AI_CLASSIFY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.AIClassify'>>, 'AI_EMBED': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.AIEmbed'>>, 'A_I_FORECAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.AIForecast'>>, 'AI_GENERATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.AIGenerate'>>, 'AI_SIMILARITY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.AISimilarity'>>, 'AI_SUMMARIZE_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.AISummarizeAgg'>>, 'ABS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Abs'>>, 'ACOS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Acos'>>, 'ACOSH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Acosh'>>, 'ADD_MONTHS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.AddMonths'>>, 'AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Agg'>>, 'AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.And'>>, 'ANONYMOUS_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.AnonymousAggFunc'>>, 'ANY_VALUE': <function DuckDBParser.<lambda>>, 'APPLY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Apply'>>, 'APPROX_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.ApproxDistinct'>>, 'APPROX_COUNT_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.ApproxDistinct'>>, 'APPROX_PERCENTILE_ACCUMULATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxPercentileAccumulate'>>, 'APPROX_PERCENTILE_COMBINE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxPercentileCombine'>>, 'APPROX_PERCENTILE_ESTIMATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxPercentileEstimate'>>, 'APPROX_QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxQuantile'>>, 'APPROX_QUANTILES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxQuantiles'>>, 'APPROX_TOP_K': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxTopK'>>, 'APPROX_TOP_K_ACCUMULATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxTopKAccumulate'>>, 'APPROX_TOP_K_COMBINE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxTopKCombine'>>, 'APPROX_TOP_K_ESTIMATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxTopKEstimate'>>, 'APPROX_TOP_SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproxTopSum'>>, 'APPROXIMATE_SIMILARITY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproximateSimilarity'>>, 'APPROXIMATE_JACCARD_INDEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ApproximateSimilarity'>>, 'ARG_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMax'>>, 'ARGMAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMax'>>, 'MAX_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMax'>>, 'ARG_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMin'>>, 'ARGMIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMin'>>, 'MIN_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArgMin'>>, 'ARRAY': <function Parser.<lambda>>, 'ARRAY_AGG': <function Parser.<lambda>>, 'ARRAY_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayAll'>>, 'ARRAY_ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayAny'>>, 'ARRAY_APPEND': <function build_array_append>, 'ARRAY_COMPACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayCompact'>>, 'ARRAY_CONCAT': <function build_array_concat>, 'ARRAY_CAT': <function build_array_concat>, 'ARRAY_CONCAT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArrayConcatAgg'>>, 'ARRAY_CONSTRUCT_COMPACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayConstructCompact'>>, 'ARRAY_CONTAINED_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContainedBy'>>, 'ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContains'>>, 'ARRAY_HAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContains'>>, 'ARRAY_CONTAINS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContainsAll'>>, 'ARRAY_HAS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContainsAll'>>, 'ARRAY_DISTINCT': <function DuckDBParser.<lambda>>, 'ARRAY_EXCEPT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayExcept'>>, 'FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayFilter'>>, 'ARRAY_FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayFilter'>>, 'ARRAY_FIRST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayFirst'>>, 'ARRAY_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayInsert'>>, 'ARRAY_INTERSECT': <function Parser.<lambda>>, 'ARRAY_INTERSECTION': <function Parser.<lambda>>, 'ARRAY_LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayLast'>>, 'ARRAY_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayMax'>>, 'ARRAY_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayMin'>>, 'ARRAY_OVERLAPS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayOverlaps'>>, 'ARRAY_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayPosition'>>, 'ARRAY_PREPEND': <function _build_array_prepend>, 'ARRAY_REMOVE': <function build_array_remove>, 'ARRAY_REMOVE_AT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayRemoveAt'>>, 'ARRAY_REVERSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayReverse'>>, 'ARRAY_SIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraySize'>>, 'ARRAY_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraySize'>>, 'ARRAY_SLICE': <function DuckDBParser.<lambda>>, 'ARRAY_SORT': <function _build_list_sort.<locals>._builder>, 'ARRAY_SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraySum'>>, 'ARRAY_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayToString'>>, 'ARRAY_JOIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayToString'>>, 'ARRAY_UNION_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArrayUnionAgg'>>, 'ARRAY_UNIQUE_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArrayUniqueAgg'>>, 'ARRAYS_ZIP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraysZip'>>, 'ASCII': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Ascii'>>, 'ASIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Asin'>>, 'ASINH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Asinh'>>, 'ATAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Atan'>>, 'ATAN2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Atan2'>>, 'ATANH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Atanh'>>, 'AVG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Avg'>>, 'BASE64_DECODE_BINARY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Base64DecodeBinary'>>, 'BASE64_DECODE_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Base64DecodeString'>>, 'BASE64_ENCODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Base64Encode'>>, 'BIT_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.BitLength'>>, 'BITMAP_BIT_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitmapBitPosition'>>, 'BITMAP_BUCKET_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitmapBucketNumber'>>, 'BITMAP_CONSTRUCT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitmapConstructAgg'>>, 'BITMAP_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitmapCount'>>, 'BITMAP_OR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitmapOrAgg'>>, 'BITWISE_AND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseAndAgg'>>, 'BITWISE_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseCount'>>, 'BITWISE_OR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseOrAgg'>>, 'BITWISE_XOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseXorAgg'>>, 'BOOLAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Booland'>>, 'BOOLNOT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Boolnot'>>, 'BOOLOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Boolor'>>, 'BOOLXOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BoolxorAgg'>>, 'BYTE_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ByteLength'>>, 'CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Case'>>, 'CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Cast'>>, 'CAST_TO_STR_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CastToStrType'>>, 'CBRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Cbrt'>>, 'CEIL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Ceil'>>, 'CEILING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Ceil'>>, 'CHECK_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.CheckJson'>>, 'CHECK_XML': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CheckXml'>>, 'CHR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Chr'>>, 'CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Chr'>>, 'CITY_HASH64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.CityHash64'>>, 'COALESCE': <function build_coalesce>, 'IFNULL': <function build_coalesce>, 'NVL': <function build_coalesce>, 'CODE_POINTS_TO_BYTES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.CodePointsToBytes'>>, 'CODE_POINTS_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.CodePointsToString'>>, 'COLLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Collate'>>, 'COLLATION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Collation'>>, 'COLUMNS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Columns'>>, 'COMBINED_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.CombinedAggFunc'>>, 'COMBINED_PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.CombinedParameterizedAgg'>>, 'COMPRESS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Compress'>>, 'CONCAT': <function Parser.<lambda>>, 'CONCAT_WS': <function Parser.<lambda>>, 'CONNECT_BY_ROOT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ConnectByRoot'>>, 'CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Contains'>>, 'CONVERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Convert'>>, 'CONVERT_TIMEZONE': <function build_convert_timezone>, 'CONVERT_TO_CHARSET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ConvertToCharset'>>, 'CORR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Corr'>>, 'COS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Cos'>>, 'COSH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Cosh'>>, 'COSINE_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.CosineDistance'>>, 'COT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Cot'>>, 'COTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Coth'>>, 'COUNT': <function Parser.<lambda>>, 'COUNT_IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.CountIf'>>, 'COUNTIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.CountIf'>>, 'COVAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.CovarPop'>>, 'COVAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.CovarSamp'>>, 'CSC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Csc'>>, 'CSCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Csch'>>, 'CUME_DIST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.CumeDist'>>, 'CURRENT_ACCOUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentAccount'>>, 'CURRENT_ACCOUNT_NAME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentAccountName'>>, 'CURRENT_AVAILABLE_ROLES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentAvailableRoles'>>, 'CURRENT_CATALOG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentCatalog'>>, 'CURRENT_CLIENT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentClient'>>, 'CURRENT_DATABASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentDatabase'>>, 'CURRENT_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentDate'>>, 'CURRENT_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentDatetime'>>, 'CURRENT_IP_ADDRESS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentIpAddress'>>, 'CURRENT_ORGANIZATION_NAME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentOrganizationName'>>, 'CURRENT_ORGANIZATION_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentOrganizationUser'>>, 'CURRENT_PATH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentPath'>>, 'CURRENT_REGION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentRegion'>>, 'CURRENT_ROLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentRole'>>, 'CURRENT_ROLE_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentRoleType'>>, 'CURRENT_SCHEMA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSchema'>>, 'CURRENT_SCHEMAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSchemas'>>, 'CURRENT_SECONDARY_ROLES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSecondaryRoles'>>, 'CURRENT_SESSION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSession'>>, 'CURRENT_STATEMENT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentStatement'>>, 'CURRENT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTime'>>, 'CURRENT_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTimestamp'>>, 'CURRENT_TIMESTAMP_L_T_Z': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTimestampLTZ'>>, 'CURRENT_TIMEZONE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTimezone'>>, 'CURRENT_TRANSACTION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentTransaction'>>, 'CURRENT_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentUser'>>, 'CURRENT_USER_ID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentUserId'>>, 'CURRENT_VERSION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentVersion'>>, 'CURRENT_WAREHOUSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentWarehouse'>>, 'DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Date'>>, 'DATE_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateAdd'>>, 'DATE_BIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateBin'>>, 'DATEDIFF': <function _build_date_diff>, 'DATE_DIFF': <function _build_date_diff>, 'DATE_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateFromParts'>>, 'DATEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateFromParts'>>, 'DATE_FROM_UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateFromUnixDate'>>, 'DATE_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateStrToDate'>>, 'DATE_TO_DATE_STR': <function Parser.<lambda>>, 'DATE_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateToDi'>>, 'DATE_TRUNC': <function _build_date_trunc>, 'DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Datetime'>>, 'DATETIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DatetimeAdd'>>, 'DATETIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DatetimeDiff'>>, 'DATETIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DatetimeSub'>>, 'DATETIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DatetimeTrunc'>>, 'DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Day'>>, 'DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfMonth'>>, 'DAYOFMONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfMonth'>>, 'DAY_OF_WEEK': <function Parser.<lambda>>, 'DAYOFWEEK': <function build_dayofweek_zero_based>, 'DAYOFWEEK_ISO': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfWeekIso'>>, 'ISODOW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfWeekIso'>>, 'DAY_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfYear'>>, 'DAYOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfYear'>>, 'DAYNAME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Dayname'>>, 'DECODE': <function DuckDBParser.<lambda>>, 'DECODE_CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.DecodeCase'>>, 'DECOMPRESS_BINARY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.DecompressBinary'>>, 'DECOMPRESS_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.DecompressString'>>, 'DECRYPT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Decrypt'>>, 'DECRYPT_RAW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.DecryptRaw'>>, 'DEGREES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Degrees'>>, 'DENSE_RANK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.DenseRank'>>, 'DI_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DiToDate'>>, 'DOT_PRODUCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.DotProduct'>>, 'DYNAMIC_IDENTIFIER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.DynamicIdentifier'>>, 'ELT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Elt'>>, 'ENCODE': <function DuckDBParser.<lambda>>, 'ENCRYPT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Encrypt'>>, 'ENCRYPT_RAW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.EncryptRaw'>>, 'ENDS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.EndsWith'>>, 'ENDSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.EndsWith'>>, 'EQUAL_NULL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.EqualNull'>>, 'EUCLIDEAN_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.EuclideanDistance'>>, 'EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Exists'>>, 'EXP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Exp'>>, 'EXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Explode'>>, 'EXPLODING_GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ExplodingGenerateSeries'>>, 'EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Extract'>>, 'FACTORIAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Factorial'>>, 'FARM_FINGERPRINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FarmFingerprint'>>, 'FARMFINGERPRINT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FarmFingerprint'>>, 'FEATURES_AT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.FeaturesAtTime'>>, 'FIND_IN_SET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FindInSet'>>, 'FIRST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.First'>>, 'FIRST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.FirstValue'>>, 'FLATTEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Flatten'>>, 'FLOAT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Float64'>>, 'FLOOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Floor'>>, 'FORMAT': <function DuckDBParser.<lambda>>, 'FROM_BASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FromBase'>>, 'FROM_BASE32': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FromBase32'>>, 'FROM_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.FromBase64'>>, 'FROM_ISO8601_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.FromISO8601Date'>>, 'FROM_ISO8601_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.FromISO8601Timestamp'>>, 'FROM_ISO8601_TIMESTAMP_NANOS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.FromISO8601TimestampNanos'>>, 'FROM_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.FromJson'>>, 'GAP_FILL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.GapFill'>>, 'GENERATE_BOOL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateBool'>>, 'GENERATE_DATE_ARRAY': <function Parser.<lambda>>, 'GENERATE_DOUBLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateDouble'>>, 'GENERATE_EMBEDDING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateEmbedding'>>, 'GENERATE_INT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateInt'>>, 'GENERATE_SERIES': <function _build_generate_series.<locals>._builder>, 'GENERATE_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateTable'>>, 'GENERATE_TEXT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GenerateText'>>, 'GENERATE_TIMESTAMP_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.GenerateTimestampArray'>>, 'GENERATOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Generator'>>, 'GET_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.GetExtract'>>, 'GET_IGNORE_CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.GetIgnoreCase'>>, 'GETBIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Getbit'>>, 'GET_BIT': <function DuckDBParser.<lambda>>, 'GREATEST': <function Parser.<lambda>>, 'GROUP_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.GroupConcat'>>, 'GROUPING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Grouping'>>, 'GROUPING_ID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.GroupingId'>>, 'HASH_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.HashAgg'>>, 'HEX': <function build_hex>, 'HEX_DECODE_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.HexDecodeString'>>, 'HLL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Hll'>>, 'HOST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Host'>>, 'HOUR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Hour'>>, 'IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.If'>>, 'IIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.If'>>, 'INITCAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Initcap'>>, 'INLINE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Inline'>>, 'INT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Int64'>>, 'IS_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.IsArray'>>, 'IS_ASCII': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.IsAscii'>>, 'IS_INF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.IsInf'>>, 'ISINF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.IsInf'>>, 'IS_NAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.IsNan'>>, 'ISNAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.IsNan'>>, 'IS_NULL_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.IsNullValue'>>, 'J_S_O_N_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONArray'>>, 'J_S_O_N_ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONArrayAgg'>>, 'JSON_ARRAY_APPEND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONArrayAppend'>>, 'JSON_ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONArrayContains'>>, 'JSON_ARRAY_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONArrayInsert'>>, 'JSONB_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBContains'>>, 'J_S_O_N_B_CONTAINS_ALL_TOP_KEYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBContainsAllTopKeys'>>, 'J_S_O_N_B_CONTAINS_ANY_TOP_KEYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBContainsAnyTopKeys'>>, 'J_S_O_N_B_CONTAINS_TOP_KEY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBContainsTopKey'>>, 'J_S_O_N_B_DELETE_AT_PATH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBDeleteAtPath'>>, 'JSONB_EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBExists'>>, 'JSONB_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBExtract'>>, 'JSONB_EXTRACT_SCALAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBExtractScalar'>>, 'J_S_O_N_B_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBObjectAgg'>>, 'J_S_O_N_B_PATH_EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBPathExists'>>, 'J_S_O_N_BOOL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONBool'>>, 'J_S_O_N_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.JSONCast'>>, 'J_S_O_N_EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONExists'>>, 'JSON_EXTRACT': <function build_extract_json_with_path.<locals>._builder>, 'JSON_EXTRACT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONExtractArray'>>, 'JSON_EXTRACT_SCALAR': <function build_extract_json_with_path.<locals>._builder>, 'JSON_FORMAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONFormat'>>, 'JSON_KEYS': <function Parser.<lambda>>, 'J_S_O_N_KEYS_AT_DEPTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONKeysAtDepth'>>, 'J_S_O_N_OBJECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONObject'>>, 'J_S_O_N_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONObjectAgg'>>, 'JSON_REMOVE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONRemove'>>, 'JSON_SET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONSet'>>, 'JSON_STRIP_NULLS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONStripNulls'>>, 'J_S_O_N_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONTable'>>, 'JSON_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.JSONType'>>, 'J_S_O_N_VALUE_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.query.JSONValueArray'>>, 'JAROWINKLER_SIMILARITY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.JarowinklerSimilarity'>>, 'JUSTIFY_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.JustifyDays'>>, 'JUSTIFY_HOURS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.JustifyHours'>>, 'JUSTIFY_INTERVAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.JustifyInterval'>>, 'KURTOSIS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Kurtosis'>>, 'LAG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Lag'>>, 'LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Last'>>, 'LAST_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.LastDay'>>, 'LAST_DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.LastDay'>>, 'LAST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LastValue'>>, 'LAX_BOOL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.LaxBool'>>, 'LAX_FLOAT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.LaxFloat64'>>, 'LAX_INT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.LaxInt64'>>, 'LAX_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.LaxString'>>, 'LEAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Lead'>>, 'LEAST': <function Parser.<lambda>>, 'LEFT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Left'>>, 'LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Length'>>, 'LEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Length'>>, 'CHAR_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Length'>>, 'CHARACTER_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Length'>>, 'LEVENSHTEIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Levenshtein'>>, 'LIST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ArrayAgg'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Ln'>>, 'LOCALTIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Localtime'>>, 'LOCALTIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Localtimestamp'>>, 'LOG': <function build_logarithm>, 'LOGICAL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalAnd'>>, 'BOOL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalAnd'>>, 'BOOLAND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalAnd'>>, 'LOGICAL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalOr'>>, 'BOOL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalOr'>>, 'BOOLOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.LogicalOr'>>, 'LOWER': <function build_lower>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Lower'>>, 'LOWER_HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.LowerHex'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.MD5'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.MD5Digest'>>, 'M_D5_NUMBER_LOWER64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.MD5NumberLower64'>>, 'M_D5_NUMBER_UPPER64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.MD5NumberUpper64'>>, 'M_L_FORECAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.MLForecast'>>, 'M_L_TRANSLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.MLTranslate'>>, 'MAKE_INTERVAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.MakeInterval'>>, 'MANHATTAN_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.ManhattanDistance'>>, 'MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Map'>>, 'MAP_CAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapCat'>>, 'MAP_CONTAINS_KEY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapContainsKey'>>, 'MAP_DELETE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapDelete'>>, 'MAP_FROM_ENTRIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapFromEntries'>>, 'MAP_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapInsert'>>, 'MAP_KEYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapKeys'>>, 'MAP_PICK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapPick'>>, 'MAP_SIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.MapSize'>>, 'MATCH_AGAINST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.MatchAgainst'>>, 'MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Max'>>, 'MEDIAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Median'>>, 'MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Min'>>, 'MINHASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Minhash'>>, 'MINHASH_COMBINE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.MinhashCombine'>>, 'MINUTE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Minute'>>, 'MODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Mode'>>, 'MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Month'>>, 'MONTHNAME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Monthname'>>, 'MONTHS_BETWEEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.MonthsBetween'>>, 'NANVL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Nanvl'>>, 'NEGATIVE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Negative'>>, 'NET_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.NetFunc'>>, 'NEXT_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.NextDay'>>, 'NEXT_VALUE_FOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ddl.NextValueFor'>>, 'NORMAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Normal'>>, 'NORMALIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Normalize'>>, 'NTH_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.NthValue'>>, 'NTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Ntile'>>, 'NULLIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Nullif'>>, 'NUMBER_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.NumberToStr'>>, 'NVL2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Nvl2'>>, 'OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.ObjectAgg'>>, 'OBJECT_ID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.ObjectId'>>, 'OBJECT_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.ObjectInsert'>>, 'OBJECT_TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ObjectTransform'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.OpenJSON'>>, 'OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Or'>>, 'OVERLAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Overlay'>>, 'PAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Pad'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.ParameterizedAgg'>>, 'PARSE_BIGNUMERIC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ParseBignumeric'>>, 'PARSE_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.ParseDatetime'>>, 'PARSE_IP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ParseIp'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.ParseJSON'>>, 'PARSE_NUMERIC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ParseNumeric'>>, 'PARSE_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.ParseTime'>>, 'PARSE_URL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ParseUrl'>>, 'PERCENT_RANK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.PercentRank'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.PercentileDisc'>>, 'PI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Pi'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Predict'>>, 'PREVIOUS_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.PreviousDay'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Quarter'>>, 'RADIANS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Radians'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Randn'>>, 'RANDSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Randstr'>>, 'RANGE_BUCKET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.RangeBucket'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.RangeN'>>, 'RANK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Rank'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ReadCSV'>>, 'READ_PARQUET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ReadParquet'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Reduce'>>, 'REG_DOMAIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.RegDomain'>>, 'REGEXP_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpCount'>>, 'REGEXP_EXTRACT': <function build_regexp_extract.<locals>._builder>, 'REGEXP_EXTRACT_ALL': <function build_regexp_extract.<locals>._builder>, 'REGEXP_FULL_MATCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpFullMatch'>>, 'REGEXP_I_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpILike'>>, 'REGEXP_INSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpInstr'>>, 'REGEXP_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.RegexpLike'>>, 'REGEXP_REPLACE': <function DuckDBParser.<lambda>>, 'REGEXP_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpSplit'>>, 'REGEXP_SUBSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpSubstr'>>, 'REGR_AVGX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrAvgx'>>, 'REGR_AVGY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrAvgy'>>, 'REGR_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrCount'>>, 'REGR_INTERCEPT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrIntercept'>>, 'REGR_R2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrR2'>>, 'REGR_SLOPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrSlope'>>, 'REGR_SXX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrSxx'>>, 'REGR_SXY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrSxy'>>, 'REGR_SYY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrSyy'>>, 'REGR_VALX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrValx'>>, 'REGR_VALY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RegrValy'>>, 'REPEAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Repeat'>>, 'REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Replace'>>, 'REVERSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Reverse'>>, 'RIGHT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Right'>>, 'RINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Rint'>>, 'ROUND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Round'>>, 'ROW_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.RowNumber'>>, 'RTRIMMED_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RtrimmedLength'>>, 'SHA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SHA'>>, 'SHA1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SHA'>>, 'S_H_A1_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SHA1Digest'>>, 'SHA2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SHA2'>>, 'S_H_A2_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SHA2Digest'>>, 'SAFE_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.SafeAdd'>>, 'SAFE_CONVERT_BYTES_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SafeConvertBytesToString'>>, 'SAFE_DIVIDE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.SafeDivide'>>, 'SAFE_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.SafeFunc'>>, 'SAFE_MULTIPLY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.SafeMultiply'>>, 'SAFE_NEGATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.SafeNegate'>>, 'SAFE_SUBTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.SafeSubtract'>>, 'SEARCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Search'>>, 'SEARCH_IP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SearchIp'>>, 'SEC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sec'>>, 'SECH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sech'>>, 'SECOND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Second'>>, 'SECRET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Secret'>>, 'SEQ1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Seq1'>>, 'SEQ2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Seq2'>>, 'SEQ4': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Seq4'>>, 'SEQ8': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Seq8'>>, 'SESSION_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.SessionUser'>>, 'SHUFFLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Shuffle'>>, 'SIGN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sign'>>, 'SIGNUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sign'>>, 'SIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sin'>>, 'SINH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sinh'>>, 'SKEWNESS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Skewness'>>, 'SOUNDEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Soundex'>>, 'SOUNDEX_P123': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SoundexP123'>>, 'SPACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Space'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Split'>>, 'SPLIT_PART': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SplitPart'>>, 'SPLIT_TO_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.SplitToTable'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Sqrt'>>, 'ST_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StDistance'>>, 'ST_GEOGFROMGEOJSON': <function build_st_geogfromgeojson>, 'ST_GEOGPOINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StGeogPoint'>>, 'ST_POINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StPoint'>>, 'ST_MAKEPOINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StPoint'>>, 'ST_X': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StX'>>, 'ST_Y': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StY'>>, 'STACK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Stack'>>, 'STANDARD_HASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StandardHash'>>, 'STAR_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StarMap'>>, 'STARTS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StartsWith'>>, 'STARTSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StartsWith'>>, 'STDDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Stddev'>>, 'STDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StrPosition'>>, 'STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.StrToDate'>>, 'STR_TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StrToMap'>>, 'STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.StrToTime'>>, 'STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.StrToUnix'>>, 'STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.String'>>, 'STRING_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Split'>>, 'SPLIT_BY_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StringToArray'>>, 'STRIP_NULL_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.StripNullValue'>>, 'STRTOK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Strtok'>>, 'STRTOK_SPLIT_TO_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StrtokSplitToTable'>>, 'STRTOK_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StrtokToArray'>>, 'STRUCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Struct'>>, 'STRUCT_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.StructExtract'>>, 'STUFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Stuff'>>, 'INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Stuff'>>, 'SUBSTRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Substring'>>, 'SUBSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Substring'>>, 'SUBSTRING_INDEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.SubstringIndex'>>, 'SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Sum'>>, 'SYSTIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Systimestamp'>>, 'TAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Tan'>>, 'TANH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Tanh'>>, 'TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Time'>>, 'TIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeAdd'>>, 'TIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeDiff'>>, 'TIME_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeFromParts'>>, 'TIMEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeFromParts'>>, 'TIME_SLICE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeSlice'>>, 'TIME_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeStrToDate'>>, 'TIME_STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeStrToTime'>>, 'TIME_STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeStrToUnix'>>, 'TIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeSub'>>, 'TIME_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeToStr'>>, 'TIME_TO_TIME_STR': <function Parser.<lambda>>, 'TIME_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeToUnix'>>, 'TIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeTrunc'>>, 'TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Timestamp'>>, 'TIMESTAMP_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampAdd'>>, 'TIMESTAMPDIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampDiff'>>, 'TIMESTAMP_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampDiff'>>, 'TIMESTAMP_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampFromParts'>>, 'TIMESTAMPFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampFromParts'>>, 'TIMESTAMP_LTZ_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampLtzFromParts'>>, 'TIMESTAMPLTZFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampLtzFromParts'>>, 'TIMESTAMP_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampSub'>>, 'TIMESTAMP_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampTrunc'>>, 'TIMESTAMP_TZ_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampTzFromParts'>>, 'TIMESTAMPTZFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimestampTzFromParts'>>, 'TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ToArray'>>, 'TO_BASE32': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToBase32'>>, 'TO_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToBase64'>>, 'TO_BINARY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToBinary'>>, 'TO_BOOLEAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ToBoolean'>>, 'TO_CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToChar'>>, 'TO_CODE_POINTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToCodePoints'>>, 'TO_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.ToDays'>>, 'TO_DECFLOAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToDecfloat'>>, 'TO_DOUBLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToDouble'>>, 'TO_FILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToFile'>>, 'TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ToMap'>>, 'TO_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.ToNumber'>>, 'TO_VARIANT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.ToVariant'>>, 'TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Transform'>>, 'TRANSLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Translate'>>, 'TRIM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Trim'>>, 'TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Trunc'>>, 'TRUNCATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Trunc'>>, 'TRY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Try'>>, 'TRY_BASE64_DECODE_BINARY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.TryBase64DecodeBinary'>>, 'TRY_BASE64_DECODE_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.TryBase64DecodeString'>>, 'TRY_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.TryCast'>>, 'TRY_HEX_DECODE_BINARY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.TryHexDecodeBinary'>>, 'TRY_HEX_DECODE_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.TryHexDecodeString'>>, 'TRY_TO_DECFLOAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.TryToDecfloat'>>, 'TS_OR_DI_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDiToDi'>>, 'TS_OR_DS_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsAdd'>>, 'TS_OR_DS_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsDiff'>>, 'TS_OR_DS_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsToDate'>>, 'TS_OR_DS_TO_DATE_STR': <function Parser.<lambda>>, 'TS_OR_DS_TO_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsToDatetime'>>, 'TS_OR_DS_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsToTime'>>, 'TS_OR_DS_TO_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TsOrDsToTimestamp'>>, 'TYPEOF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Typeof'>>, 'UNHEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Unhex'>>, 'UNICODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Unicode'>>, 'UNIFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Uniform'>>, 'UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixDate'>>, 'UNIX_MICROS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixMicros'>>, 'UNIX_MILLIS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixMillis'>>, 'UNIX_SECONDS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixSeconds'>>, 'UNIX_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixToStr'>>, 'UNIX_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixToTime'>>, 'UNIX_TO_TIME_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixToTimeStr'>>, 'UNNEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Explode'>>, 'UPPER': <function build_upper>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Upper'>>, 'UTC_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UtcDate'>>, 'UTC_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UtcTime'>>, 'UTC_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UtcTimestamp'>>, 'UUID': <function Parser.<lambda>>, 'GEN_RANDOM_UUID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Uuid'>>, 'GENERATE_UUID': <function Parser.<lambda>>, 'UUID_STRING': <function Parser.<lambda>>, 'VAR_MAP': <function build_var_map>, 'VARIANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Variance'>>, 'VARIANCE_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Variance'>>, 'VAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.Variance'>>, 'VARIANCE_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.VariancePop'>>, 'VAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.VariancePop'>>, 'VECTOR_SEARCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.VectorSearch'>>, 'WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Week'>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.WeekOfYear'>>, 'WEEKOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.WeekOfYear'>>, 'WEEK_START': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.WeekStart'>>, 'WEIGHT_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.WeightString'>>, 'WIDTH_BUCKET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.WidthBucket'>>, 'XMLELEMENT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.XMLElement'>>, 'XMLGET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.XMLGet'>>, 'X_M_L_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.XMLTable'>>, 'XOR': <function binary_from_function.<locals>.<lambda>>, 'YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Year'>>, 'YEAR_OF_WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.YearOfWeek'>>, 'YEAROFWEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.YearOfWeek'>>, 'YEAR_OF_WEEK_ISO': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.YearOfWeekIso'>>, 'YEAROFWEEKISO': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.YearOfWeekIso'>>, 'ZIPF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.Zipf'>>, 'EXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array._ExplodeOuter'>>, 'SORT_ARRAY': <function build_sort_array>, 'ARRAYAGG': <function Parser.<lambda>>, 'JSON_EXTRACT_PATH_TEXT': <function build_extract_json_with_path.<locals>._builder>, 'LIKE': <function build_like>, 'LOG2': <function Parser.<lambda>>, 'LOG10': <function Parser.<lambda>>, 'LPAD': <function Parser.<lambda>>, 'LEFTPAD': <function Parser.<lambda>>, 'LTRIM': <function Parser.<lambda>>, 'MOD': <function build_mod>, 'RIGHTPAD': <function Parser.<lambda>>, 'RPAD': <function Parser.<lambda>>, 'RTRIM': <function Parser.<lambda>>, 'SCOPE_RESOLUTION': <function Parser.<lambda>>, 'STRPOS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StrPosition'>>, 'CHARINDEX': <function Parser.<lambda>>, 'INSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.StrPosition'>>, 'LOCATE': <function Parser.<lambda>>, 'TO_HEX': <function build_hex>, 'LIST_DISTINCT': <function DuckDBParser.<lambda>>, 'ARG_MAX_NULL': <function build_arg_max_or_min_with_nulls.<locals>.<lambda>>, 'ARG_MIN_NULL': <function build_arg_max_or_min_with_nulls.<locals>.<lambda>>, 'ARRAY_REVERSE_SORT': <function _build_list_sort.<locals>._builder>, 'LIST_SLICE': <function DuckDBParser.<lambda>>, 'BIT_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseAndAgg'>>, 'BIT_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseOrAgg'>>, 'BIT_XOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseXorAgg'>>, 'CURRENT_LOCALTIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Localtimestamp'>>, 'DATETRUNC': <function _build_date_trunc>, 'WEEKDAY': <function build_dayofweek_zero_based>, 'EDITDIST3': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Levenshtein'>>, 'EPOCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeToUnix'>>, 'EPOCH_MS': <function DuckDBParser.<lambda>>, 'FROM_HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Unhex'>>, 'GET_CURRENT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTime'>>, 'JARO_WINKLER_SIMILARITY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.JarowinklerSimilarity'>>, 'JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.json.ParseJSON'>>, 'JSON_ARRAY': <function DuckDBParser.<lambda>>, 'JSON_EXTRACT_PATH': <function build_extract_json_with_path.<locals>._builder>, 'JSON_EXTRACT_STRING': <function build_extract_json_with_path.<locals>._builder>, 'LIST_APPEND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayAppend'>>, 'LIST_CONCAT': <function build_array_concat>, 'LIST_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContains'>>, 'LIST_COSINE_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.CosineDistance'>>, 'LIST_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.EuclideanDistance'>>, 'LIST_FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayFilter'>>, 'LIST_HAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayContains'>>, 'LIST_HAS_ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayOverlaps'>>, 'LIST_INTERSECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayIntersect'>>, 'LIST_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayMax'>>, 'LIST_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayMin'>>, 'LIST_PREPEND': <function _build_array_prepend>, 'LIST_REVERSE_SORT': <function _build_list_sort.<locals>._builder>, 'LIST_SORT': <function _build_list_sort.<locals>._builder>, 'LIST_TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Transform'>>, 'LIST_VALUE': <function DuckDBParser.<lambda>>, 'MAKE_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateFromParts'>>, 'MAKE_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeFromParts'>>, 'MAKE_TIMESTAMP': <function _build_make_timestamp>, 'PRINTF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Format'>>, 'QUANTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.PercentileCont'>>, 'QUANTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.PercentileDisc'>>, 'RANGE': <function _build_generate_series.<locals>._builder>, 'REGEXP_MATCHES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.RegexpLike'>>, 'SHA256': <function DuckDBParser.<lambda>>, 'STRFTIME': <function build_formatted_time.<locals>._builder>, 'STRING_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Split'>>, 'STRING_SPLIT_REGEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpSplit'>>, 'STRPTIME': <function build_formatted_time.<locals>._builder>, 'STRUCT_PACK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.Struct'>>, 'STR_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Split'>>, 'STR_SPLIT_REGEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpSplit'>>, 'TODAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentDate'>>, 'TIME_BUCKET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateBin'>>, 'TO_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.UnixToTime'>>, 'VERSION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentVersion'>>}
FUNCTION_PARSERS =
{'ARG_MAX': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'ARGMAX': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'MAX_BY': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'ARG_MIN': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'ARGMIN': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'MIN_BY': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'CAST': <function Parser.<lambda>>, 'CEIL': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'CHAR': <function Parser.<lambda>>, 'CHR': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'FLOOR': <function Parser.<lambda>>, 'GAP_FILL': <function Parser.<lambda>>, 'INITCAP': <function Parser.<lambda>>, 'JSON_OBJECT': <function Parser.<lambda>>, 'JSON_OBJECTAGG': <function Parser.<lambda>>, 'JSON_TABLE': <function Parser.<lambda>>, 'MATCH': <function Parser.<lambda>>, 'NORMALIZE': <function Parser.<lambda>>, 'OPENJSON': <function Parser.<lambda>>, 'OVERLAY': <function Parser.<lambda>>, 'POSITION': <function Parser.<lambda>>, 'SAFE_CAST': <function Parser.<lambda>>, 'STRING_AGG': <function Parser.<lambda>>, 'SUBSTRING': <function Parser.<lambda>>, 'TRIM': <function Parser.<lambda>>, 'TRY_CAST': <function Parser.<lambda>>, 'TRY_CONVERT': <function Parser.<lambda>>, 'WEIGHT_STRING': <function Parser.<lambda>>, 'XMLELEMENT': <function Parser.<lambda>>, 'XMLTABLE': <function Parser.<lambda>>, 'GROUP_CONCAT': <function DuckDBParser.<lambda>>, 'LISTAGG': <function DuckDBParser.<lambda>>, 'STRINGAGG': <function DuckDBParser.<lambda>>, 'ARG_MAX_NULL': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'ARG_MIN_NULL': <function parse_distinct_arg_functions.<locals>.<dictcomp>.<lambda>>, 'APPROX_QUANTILE': <function DuckDBParser.<lambda>>, 'MAX': <function DuckDBParser.<lambda>>, 'MIN': <function DuckDBParser.<lambda>>, 'QUANTILE': <function DuckDBParser.<lambda>>, 'QUANTILE_CONT': <function DuckDBParser.<lambda>>, 'QUANTILE_DISC': <function DuckDBParser.<lambda>>}
NO_PAREN_FUNCTION_PARSERS =
{'ANY': <function Parser.<lambda>>, 'CASE': <function Parser.<lambda>>, 'CONNECT_BY_ROOT': <function Parser.<lambda>>, 'IF': <function Parser.<lambda>>, 'MAP': <function DuckDBParser.<lambda>>, '@': <function DuckDBParser.<lambda>>}
PLACEHOLDER_PARSERS =
{<TokenType.PLACEHOLDER: 367>: <function Parser.<lambda>>, <TokenType.PARAMETER: 60>: <function DuckDBParser.<lambda>>, <TokenType.COLON: 11>: <function Parser.<lambda>>}
TYPE_CONVERTERS =
{<DType.DECIMAL: 'DECIMAL'>: <function build_default_decimal_type.<locals>._builder>, <DType.TEXT: 'TEXT'>: <function _convert_text_type>}
STATEMENT_PARSERS =
{<TokenType.ALTER: 227>: <function Parser.<lambda>>, <TokenType.ANALYZE: 450>: <function Parser.<lambda>>, <TokenType.BEGIN: 237>: <function Parser.<lambda>>, <TokenType.CACHE: 240>: <function Parser.<lambda>>, <TokenType.COMMENT: 246>: <function Parser.<lambda>>, <TokenType.COMMIT: 247>: <function Parser.<lambda>>, <TokenType.COPY: 251>: <function Parser.<lambda>>, <TokenType.CREATE: 252>: <function Parser.<lambda>>, <TokenType.DECLARE: 264>: <function Parser.<lambda>>, <TokenType.DELETE: 266>: <function Parser.<lambda>>, <TokenType.DESC: 267>: <function Parser.<lambda>>, <TokenType.DESCRIBE: 268>: <function Parser.<lambda>>, <TokenType.DROP: 275>: <function Parser.<lambda>>, <TokenType.GRANT: 299>: <function Parser.<lambda>>, <TokenType.REVOKE: 388>: <function Parser.<lambda>>, <TokenType.INSERT: 310>: <function Parser.<lambda>>, <TokenType.KILL: 324>: <function Parser.<lambda>>, <TokenType.LOAD: 331>: <function Parser.<lambda>>, <TokenType.MERGE: 338>: <function Parser.<lambda>>, <TokenType.PIVOT: 366>: <function Parser.<lambda>>, <TokenType.PRAGMA: 371>: <function Parser.<lambda>>, <TokenType.REFRESH: 384>: <function Parser.<lambda>>, <TokenType.ROLLBACK: 393>: <function Parser.<lambda>>, <TokenType.SET: 403>: <function Parser.<lambda>>, <TokenType.TRUNCATE: 422>: <function Parser.<lambda>>, <TokenType.UNCACHE: 425>: <function Parser.<lambda>>, <TokenType.UNPIVOT: 429>: <function Parser.<lambda>>, <TokenType.UPDATE: 430>: <function Parser.<lambda>>, <TokenType.USE: 431>: <function Parser.<lambda>>, <TokenType.SEMICOLON: 19>: <function Parser.<lambda>>, <TokenType.ATTACH: 235>: <function DuckDBParser.<lambda>>, <TokenType.CONNECT: 248>: <function DuckDBParser.<lambda>>, <TokenType.DETACH: 269>: <function DuckDBParser.<lambda>>, <TokenType.DISCONNECT: 270>: <function DuckDBParser.<lambda>>, <TokenType.FORCE: 290>: <function DuckDBParser.<lambda>>, <TokenType.INSTALL: 311>: <function DuckDBParser.<lambda>>, <TokenType.SHOW: 405>: <function DuckDBParser.<lambda>>}
SET_PARSERS =
{'GLOBAL': <function Parser.<lambda>>, 'LOCAL': <function Parser.<lambda>>, 'SESSION': <function Parser.<lambda>>, 'TRANSACTION': <function Parser.<lambda>>, 'VARIABLE': <function DuckDBParser.<lambda>>}
SET_TRIE =
{'GLOBAL': {0: True}, 'LOCAL': {0: True}, 'SESSION': {0: True}, 'TRANSACTION': {0: True}, 'VARIABLE': {0: True}}
Inherited Members
- sqlglot.parser.Parser
- Parser
- STRUCT_TYPE_TOKENS
- NESTED_TYPE_TOKENS
- ENUM_TYPE_TOKENS
- AGGREGATE_TYPE_TOKENS
- TYPE_TOKENS
- SIGNED_TO_UNSIGNED_TYPE_TOKEN
- SUBQUERY_PREDICATES
- SUBQUERY_TOKENS
- RESERVED_TOKENS
- TEXT_MATCH_EXCLUDED_TOKENS
- DB_CREATABLES
- CREATABLES
- TRIGGER_EVENTS
- ALTERABLES
- ID_VAR_TOKENS
- TABLE_ALIAS_TOKENS
- ALIAS_TOKENS
- COLON_PLACEHOLDER_TOKENS
- ARRAY_CONSTRUCTORS
- COMMENT_TABLE_ALIAS_TOKENS
- UPDATE_ALIAS_TOKENS
- TRIM_TYPES
- IDENTIFIER_TOKENS
- BRACKETS
- COLUMN_POSTFIX_TOKENS
- TABLE_POSTFIX_TOKENS
- FUNC_TOKENS
- CONJUNCTION
- ASSIGNMENT
- DISJUNCTION
- EQUALITY
- COMPARISON
- TERM
- FACTOR
- TIMES
- TIMESTAMPS
- SET_OPERATIONS
- JOIN_METHODS
- JOIN_SIDES
- JOIN_HINTS
- TABLE_TERMINATORS
- LAMBDAS
- TYPED_LAMBDA_ARGS
- LAMBDA_ARG_TERMINATORS
- CAST_COLUMN_OPERATORS
- EXPRESSION_PARSERS
- UNARY_PARSERS
- STRING_PARSERS
- NUMERIC_PARSERS
- PRIMARY_PARSERS
- PIPE_SYNTAX_TRANSFORM_PARSERS
- PROPERTY_PARSERS
- CONSTRAINT_PARSERS
- ALTER_PARSERS
- ALTER_ALTER_PARSERS
- SCHEMA_UNNAMED_CONSTRAINTS
- RESERVED_CONSTRAINT_KINDS
- INVALID_FUNC_NAME_TOKENS
- KEY_VALUE_DEFINITIONS
- QUERY_MODIFIER_PARSERS
- QUERY_MODIFIER_TOKENS
- TYPE_LITERAL_PARSERS
- DDL_SELECT_TOKENS
- PRE_VOLATILE_TOKENS
- TRANSACTION_KIND
- TRANSACTION_CHARACTERISTICS
- CONFLICT_ALGORITHMS
- CONFLICT_ACTIONS
- TRIGGER_TIMING
- TRIGGER_DEFERRABLE
- CREATE_SEQUENCE
- ISOLATED_LOADING_OPTIONS
- USABLES
- CAST_ACTIONS
- SCHEMA_BINDING_OPTIONS
- PROCEDURE_OPTIONS
- EXECUTE_AS_OPTIONS
- KEY_CONSTRAINT_OPTIONS
- WINDOW_EXCLUDE_OPTIONS
- INSERT_ALTERNATIVES
- CLONE_KEYWORDS
- VERSION_PHRASES
- HISTORICAL_DATA_PREFIX
- HISTORICAL_DATA_KIND
- OPCLASS_FOLLOW_KEYWORDS
- OPTYPE_FOLLOW_TOKENS
- TABLE_INDEX_HINT_TOKENS
- VIEW_ATTRIBUTES
- WINDOW_ALIAS_TOKENS
- WINDOW_BEFORE_PAREN_TOKENS
- WINDOW_SIDES
- JSON_KEY_VALUE_SEPARATOR_TOKENS
- FETCH_TOKENS
- ADD_CONSTRAINT_TOKENS
- ADD_CONSTRAINT_KEYWORDS
- DISTINCT_TOKENS
- UNNEST_OFFSET_ALIAS_TOKENS
- SELECT_START_TOKENS
- COPY_INTO_VARLEN_OPTIONS
- IS_PREDICATE_TOKENS
- IS_JSON_PREDICATE_KIND
- ODBC_DATETIME_LITERALS
- ON_CONDITION_TOKENS
- PRIVILEGE_FOLLOW_TOKENS
- DESCRIBE_STYLES
- SET_ASSIGNMENT_DELIMITERS
- ANALYZE_STYLES
- ANALYZE_EXPRESSION_PARSERS
- PARTITION_KEYWORDS
- AMBIGUOUS_ALIAS_TOKENS
- OPERATION_MODIFIERS
- RECURSIVE_CTE_SEARCH_KIND
- SECURITY_PROPERTY_KEYWORDS
- MODIFIABLES
- STRICT_CAST
- PREFIXED_PIVOT_COLUMNS
- IDENTIFY_PIVOT_STRINGS
- UNPIVOT_VALUE_COLUMNS_FIRST
- LOG_DEFAULTS_TO_LN
- TABLESAMPLE_CSV
- DEFAULT_SAMPLING_METHOD
- SET_REQUIRES_ASSIGNMENT_DELIMITER
- TRIM_PATTERN_FIRST
- STRING_ALIASES
- STRING_AGG_DEFAULT_SEPARATOR
- MODIFIERS_ATTACHED_TO_SET_OP
- SET_OP_MODIFIERS
- NO_PAREN_IF_COMMANDS
- JSON_ARROWS_REQUIRE_JSON_TYPE
- COLON_IS_VARIANT_EXTRACT
- COLON_CHAIN_IS_SINGLE_EXTRACT
- VALUES_FOLLOWED_BY_PAREN
- SUPPORTS_IMPLICIT_UNNEST
- SUPPORTS_GROUP_BY_AUTO
- SUPPORTS_DIGIT_PREFIXED_FIELD_NAMES
- INTERVAL_SPANS
- SUPPORTS_PARTITION_SELECTION
- WRAPPED_TRANSFORM_COLUMN_CONSTRAINT
- OPTIONAL_ALIAS_TOKEN_CTE
- ALTER_RENAME_REQUIRES_COLUMN
- ALTER_DROP_REQUIRES_COLUMN
- ALTER_TABLE_PARTITIONS
- ALTER_TABLE_MIXED_ACTIONS
- ALTER_TABLE_REQUIRES_ACTION
- ALTER_COLUMN_TYPE_REQUIRES_KEYWORD
- JOINS_HAVE_EQUAL_PRECEDENCE
- MATCH_RECOGNIZE_APPLIES_TO_JOINS
- ZONE_AWARE_TIMESTAMP_CONSTRUCTOR
- AT_TIME_ZONE_READS_SESSION_ZONE
- JSON_EXTRACT_REQUIRES_JSON_EXPRESSION
- ADD_JOIN_ON_TRUE
- SUPPORTS_OMITTED_INTERVAL_SPAN_UNIT
- SUPPORTS_MULTI_PART_INTERVAL_ADD
- ADJACENT_STRINGS_CANNOT_BE_CONNECTED
- SUPPORTS_NTH_VALUE_FROM_MODIFIER
- QUOTED_TYPES_TO_PRESERVE
- error_level
- error_message_context
- max_errors
- max_nodes
- dialect
- sql
- errors
- reset
- raise_error
- validate_expression
- parse
- parse_into
- check_errors
- expression
- parse_set_operation
- build_cast