Edit on GitHub

sqlglot.parsers.mysql

  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    Dialect,
  9    build_date_delta,
 10    build_date_delta_with_interval,
 11    build_formatted_time,
 12    isnull_to_is_null,
 13)
 14from sqlglot.helper import seq_get
 15from sqlglot.parser import IsPredicatePrecedence
 16from sqlglot.tokens import TokenType
 17
 18
 19# All specifiers for time parts (as opposed to date parts)
 20# https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format
 21TIME_SPECIFIERS = {"f", "H", "h", "I", "i", "k", "l", "p", "r", "S", "s", "T"}
 22
 23
 24def _has_time_specifier(date_format: str) -> bool:
 25    i = 0
 26    length = len(date_format)
 27
 28    while i < length:
 29        if date_format[i] == "%":
 30            i += 1
 31            if i < length and date_format[i] in TIME_SPECIFIERS:
 32                return True
 33        i += 1
 34    return False
 35
 36
 37def _str_to_date(args: list) -> exp.StrToDate | exp.StrToTime:
 38    mysql_date_format = seq_get(args, 1)
 39    date_format = Dialect["mysql"].format_time(mysql_date_format)
 40    this = seq_get(args, 0)
 41
 42    if mysql_date_format and _has_time_specifier(mysql_date_format.name):
 43        return exp.StrToTime(this=this, format=date_format)
 44
 45    return exp.StrToDate(this=this, format=date_format)
 46
 47
 48def _build_timestampadd(args: list) -> exp.TimestampAdd:
 49    expression = build_date_delta(exp.TimestampAdd)(args)
 50    unit = expression.unit
 51    expression.set("unit", exp.var((unit.name if unit else "DAY").upper().removeprefix("SQL_TSI_")))
 52    return expression
 53
 54
 55def _show_parser(*args: t.Any, **kwargs: t.Any) -> t.Callable[[MySQLParser], exp.Show]:
 56    def _parse(self: MySQLParser) -> exp.Show:
 57        return self._parse_show_mysql(*args, **kwargs)
 58
 59    return _parse
 60
 61
 62class MySQLParser(parser.Parser):
 63    SUPPORTS_TABLE_QUERY = True
 64
 65    IS_PREDICATE_PRECEDENCE = IsPredicatePrecedence.COMPARISON
 66
 67    NO_PAREN_FUNCTIONS = {
 68        **parser.Parser.NO_PAREN_FUNCTIONS,
 69        TokenType.LOCALTIME: exp.Localtime,
 70        TokenType.LOCALTIMESTAMP: exp.Localtimestamp,
 71    }
 72
 73    ID_VAR_TOKENS = parser.Parser.ID_VAR_TOKENS - {TokenType.STRAIGHT_JOIN}
 74
 75    FUNC_TOKENS = {
 76        *parser.Parser.FUNC_TOKENS,
 77        TokenType.DATABASE,
 78        TokenType.MOD,
 79        TokenType.SCHEMA,
 80        TokenType.VALUES,
 81        TokenType.CHARACTER_SET,
 82    }
 83
 84    CONJUNCTION = {
 85        **parser.Parser.CONJUNCTION,
 86        TokenType.DAMP: exp.And,
 87    }
 88
 89    DISJUNCTION = {
 90        **parser.Parser.DISJUNCTION,
 91        TokenType.DPIPE: exp.Or,
 92    }
 93
 94    UNARY_PARSERS = {
 95        **parser.Parser.UNARY_PARSERS,
 96        TokenType.NOT: lambda self: self._parse_not(),
 97    }
 98
 99    EXPONENT = {
100        TokenType.CARET: exp.BitwiseXor,
101    }
102
103    TABLE_ALIAS_TOKENS = (
104        (parser.Parser.TABLE_ALIAS_TOKENS | {TokenType.ANTI, TokenType.SEMI})
105        - parser.Parser.TABLE_INDEX_HINT_TOKENS
106        - {TokenType.STRAIGHT_JOIN}
107    )
108
109    RANGE_PARSERS = {
110        **parser.Parser.RANGE_PARSERS,
111        TokenType.MEMBER_OF: lambda self, this: self.expression(
112            exp.JSONArrayContains(this=this, expression=self._parse_wrapped(self._parse_expression))
113        ),
114    }
115
116    FUNCTIONS = {
117        **parser.Parser.FUNCTIONS,
118        "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
119        "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
120        "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
121        "BIT_COUNT": exp.BitwiseCount.from_arg_list,
122        "CONVERT_TZ": lambda args: exp.ConvertTimezone(
123            source_tz=seq_get(args, 1), target_tz=seq_get(args, 2), timestamp=seq_get(args, 0)
124        ),
125        "CURDATE": exp.CurrentDate.from_arg_list,
126        "CURTIME": exp.CurrentTime.from_arg_list,
127        "DATE": lambda args: exp.TsOrDsToDate(this=seq_get(args, 0)),
128        "DATEDIFF": lambda args: exp.DateDiff(
129            this=seq_get(args, 0), expression=seq_get(args, 1), date_part_boundary=True
130        ),
131        "DATE_ADD": build_date_delta_with_interval(exp.DateAdd),
132        "DATE_FORMAT": lambda args: exp.TimeToStr(
133            this=exp.TsOrDsToTimestamp(this=seq_get(args, 0)),
134            format=Dialect["mysql"].format_time(seq_get(args, 1)),
135        ),
136        "DATE_SUB": build_date_delta_with_interval(exp.DateSub),
137        "DAY": lambda args: exp.Day(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
138        "DAYOFMONTH": lambda args: exp.DayOfMonth(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
139        "DAYOFWEEK": lambda args: exp.DayOfWeek(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
140        "DAYOFYEAR": lambda args: exp.DayOfYear(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
141        "FORMAT": exp.NumberToStr.from_arg_list,
142        "FROM_UNIXTIME": build_formatted_time(exp.UnixToTime),
143        "ISNULL": isnull_to_is_null,
144        "LENGTH": lambda args: exp.Length(this=seq_get(args, 0), binary=True),
145        "MAKETIME": exp.TimeFromParts.from_arg_list,
146        "MONTH": lambda args: exp.Month(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
147        "MONTHNAME": lambda args: exp.TimeToStr(
148            this=exp.TsOrDsToDate(this=seq_get(args, 0)),
149            format=exp.Literal.string("%B"),
150        ),
151        "SCHEMA": exp.CurrentSchema.from_arg_list,
152        "DATABASE": exp.CurrentSchema.from_arg_list,
153        "STD": exp.StddevPop.from_arg_list,
154        "STDDEV": exp.StddevPop.from_arg_list,
155        "STR_TO_DATE": _str_to_date,
156        "TIMESTAMPADD": _build_timestampadd,
157        "TIMESTAMPDIFF": build_date_delta(exp.TimestampDiff),
158        "TO_DAYS": lambda args: exp.paren(
159            exp.DateDiff(
160                this=exp.TsOrDsToDate(this=seq_get(args, 0)),
161                expression=exp.TsOrDsToDate(this=exp.Literal.string("0000-01-01")),
162                unit=exp.var("DAY"),
163            )
164            + 1
165        ),
166        "VARIANCE": exp.VariancePop.from_arg_list,
167        "VERSION": exp.CurrentVersion.from_arg_list,
168        "WEEK": lambda args: exp.Week(
169            this=exp.TsOrDsToDate(this=seq_get(args, 0)), mode=seq_get(args, 1)
170        ),
171        "WEEKOFYEAR": lambda args: exp.WeekOfYear(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
172        "YEAR": lambda args: exp.Year(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
173    }
174
175    FUNCTION_PARSERS = {
176        **parser.Parser.FUNCTION_PARSERS,
177        "GROUP_CONCAT": lambda self: self._parse_group_concat(),
178        # https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_values
179        "VALUES": lambda self: self.expression(
180            exp.Anonymous(this="VALUES", expressions=[self._parse_id_var()])
181        ),
182        "JSON_VALUE": lambda self: self._parse_json_value(),
183        "SUBSTR": lambda self: self._parse_substring(),
184    }
185
186    STATEMENT_PARSERS = {
187        **parser.Parser.STATEMENT_PARSERS,
188        TokenType.SHOW: lambda self: self._parse_show(),
189    }
190
191    SHOW_PARSERS = {
192        "BINARY LOGS": _show_parser("BINARY LOGS"),
193        "MASTER LOGS": _show_parser("BINARY LOGS"),
194        "BINLOG EVENTS": _show_parser("BINLOG EVENTS"),
195        "CHARACTER SET": _show_parser("CHARACTER SET"),
196        "CHARSET": _show_parser("CHARACTER SET"),
197        "COLLATION": _show_parser("COLLATION"),
198        "FULL COLUMNS": _show_parser("COLUMNS", target="FROM", full=True),
199        "COLUMNS": _show_parser("COLUMNS", target="FROM"),
200        "CREATE DATABASE": _show_parser("CREATE DATABASE", target=True),
201        "CREATE EVENT": _show_parser("CREATE EVENT", target=True),
202        "CREATE FUNCTION": _show_parser("CREATE FUNCTION", target=True),
203        "CREATE PROCEDURE": _show_parser("CREATE PROCEDURE", target=True),
204        "CREATE TABLE": _show_parser("CREATE TABLE", target=True),
205        "CREATE TRIGGER": _show_parser("CREATE TRIGGER", target=True),
206        "CREATE VIEW": _show_parser("CREATE VIEW", target=True),
207        "DATABASES": _show_parser("DATABASES"),
208        "SCHEMAS": _show_parser("DATABASES"),
209        "ENGINE": _show_parser("ENGINE", target=True),
210        "STORAGE ENGINES": _show_parser("ENGINES"),
211        "ENGINES": _show_parser("ENGINES"),
212        "ERRORS": _show_parser("ERRORS"),
213        "EVENTS": _show_parser("EVENTS"),
214        "FUNCTION CODE": _show_parser("FUNCTION CODE", target=True),
215        "FUNCTION STATUS": _show_parser("FUNCTION STATUS"),
216        "GRANTS": _show_parser("GRANTS", target="FOR"),
217        "INDEX": _show_parser("INDEX", target="FROM"),
218        "MASTER STATUS": _show_parser("MASTER STATUS"),
219        "OPEN TABLES": _show_parser("OPEN TABLES"),
220        "PLUGINS": _show_parser("PLUGINS"),
221        "PROCEDURE CODE": _show_parser("PROCEDURE CODE", target=True),
222        "PROCEDURE STATUS": _show_parser("PROCEDURE STATUS"),
223        "PRIVILEGES": _show_parser("PRIVILEGES"),
224        "FULL PROCESSLIST": _show_parser("PROCESSLIST", full=True),
225        "PROCESSLIST": _show_parser("PROCESSLIST"),
226        "PROFILE": _show_parser("PROFILE"),
227        "PROFILES": _show_parser("PROFILES"),
228        "RELAYLOG EVENTS": _show_parser("RELAYLOG EVENTS"),
229        "REPLICAS": _show_parser("REPLICAS"),
230        "SLAVE HOSTS": _show_parser("REPLICAS"),
231        "REPLICA STATUS": _show_parser("REPLICA STATUS"),
232        "SLAVE STATUS": _show_parser("REPLICA STATUS"),
233        "GLOBAL STATUS": _show_parser("STATUS", global_=True),
234        "SESSION STATUS": _show_parser("STATUS"),
235        "STATUS": _show_parser("STATUS"),
236        "TABLE STATUS": _show_parser("TABLE STATUS"),
237        "FULL TABLES": _show_parser("TABLES", full=True),
238        "TABLES": _show_parser("TABLES"),
239        "TRIGGERS": _show_parser("TRIGGERS"),
240        "GLOBAL VARIABLES": _show_parser("VARIABLES", global_=True),
241        "SESSION VARIABLES": _show_parser("VARIABLES"),
242        "VARIABLES": _show_parser("VARIABLES"),
243        "WARNINGS": _show_parser("WARNINGS"),
244    }
245
246    PROPERTY_PARSERS = {
247        **parser.Parser.PROPERTY_PARSERS,
248        "LOCK": lambda self: self._parse_property_assignment(exp.LockProperty),
249        "PARTITION BY": lambda self: self._parse_partition_property(),
250    }
251
252    SET_PARSERS = {
253        **parser.Parser.SET_PARSERS,
254        "PERSIST": lambda self: self._parse_set_item_assignment("PERSIST"),
255        "PERSIST_ONLY": lambda self: self._parse_set_item_assignment("PERSIST_ONLY"),
256        "CHARACTER SET": lambda self: self._parse_set_item_charset("CHARACTER SET"),
257        "CHARSET": lambda self: self._parse_set_item_charset("CHARACTER SET"),
258        "NAMES": lambda self: self._parse_set_item_names(),
259    }
260
261    SHOW_TRIE = new_trie(key.split(" ") for key in SHOW_PARSERS)
262    SET_TRIE = new_trie(key.split(" ") for key in SET_PARSERS)
263
264    CONSTRAINT_PARSERS = {
265        **parser.Parser.CONSTRAINT_PARSERS,
266        "BINARY": lambda self: self.expression(exp.BinaryColumnConstraint()),
267        "FULLTEXT": lambda self: self._parse_index_constraint(kind="FULLTEXT"),
268        "INDEX": lambda self: self._parse_index_constraint(),
269        "KEY": lambda self: self._parse_index_constraint(),
270        "SPATIAL": lambda self: self._parse_index_constraint(kind="SPATIAL"),
271        "ZEROFILL": lambda self: self.expression(exp.ZeroFillColumnConstraint()),
272        "INVISIBLE": lambda self: self.expression(exp.InvisibleColumnConstraint()),
273        # MySQL defines ASCII as latin1, not the ascii character set, and UNICODE as ucs2
274        "ASCII": lambda self: self.expression(
275            exp.CharacterSetColumnConstraint(this=exp.var("latin1"))
276        ),
277        "UNICODE": lambda self: self.expression(
278            exp.CharacterSetColumnConstraint(this=exp.var("ucs2"))
279        ),
280    }
281
282    ALTER_PARSERS = {
283        **parser.Parser.ALTER_PARSERS,
284        "CHANGE": lambda self: self._parse_alter_table_modify(rename=True),
285        "MODIFY": lambda self: self._parse_alter_table_modify(),
286        "FORCE": lambda self: self.expression(exp.ForceProperty()),
287    }
288
289    ALTER_ALTER_PARSERS = {
290        **parser.Parser.ALTER_ALTER_PARSERS,
291        "INDEX": lambda self: self._parse_alter_table_alter_index(),
292    }
293
294    ADD_CONSTRAINT_KEYWORDS = {"FULLTEXT", "SPATIAL"}
295
296    RESERVED_CONSTRAINT_KINDS = {"CHECK", "FOREIGN KEY", "PRIMARY KEY", "UNIQUE"}
297
298    SCHEMA_UNNAMED_CONSTRAINTS = {
299        *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
300        "FULLTEXT",
301        "INDEX",
302        "KEY",
303        "SPATIAL",
304    }
305
306    PROFILE_TYPES: t.ClassVar[parser.OPTIONS_TYPE] = {
307        **dict.fromkeys(("ALL", "CPU", "IPC", "MEMORY", "SOURCE", "SWAPS"), tuple()),
308        "BLOCK": ("IO",),
309        "CONTEXT": ("SWITCHES",),
310        "PAGE": ("FAULTS",),
311    }
312
313    TYPE_TOKENS = {
314        *parser.Parser.TYPE_TOKENS,
315        TokenType.SET,
316    }
317
318    ENUM_TYPE_TOKENS = {
319        *parser.Parser.ENUM_TYPE_TOKENS,
320        TokenType.SET,
321    }
322
323    # SELECT [ ALL | DISTINCT | DISTINCTROW ] [ <OPERATION_MODIFIERS> ]
324    OPERATION_MODIFIERS = {
325        "HIGH_PRIORITY",
326        "STRAIGHT_JOIN",
327        "SQL_SMALL_RESULT",
328        "SQL_BIG_RESULT",
329        "SQL_BUFFER_RESULT",
330        "SQL_NO_CACHE",
331        "SQL_CALC_FOUND_ROWS",
332    }
333
334    ALTER_DROP_REQUIRES_COLUMN = False
335    ALTER_TABLE_MIXED_ACTIONS = True
336    ALTER_TABLE_REQUIRES_ACTION = False
337    LOG_DEFAULTS_TO_LN = True
338    STRING_ALIASES = True
339    VALUES_FOLLOWED_BY_PAREN = False
340    SUPPORTS_PARTITION_SELECTION = True
341
342    def _parse_conjunction(self) -> exp.Expr | None:
343        this = super()._parse_conjunction()
344        while self._match(TokenType.XOR):
345            comments = self._prev_comments
346            this = self.expression(
347                exp.Xor(this=this, expression=super()._parse_conjunction()),
348                comments=comments,
349            )
350        return this
351
352    def _parse_not(self) -> exp.Expr:
353        if self._prev.text == "!":
354            # ! binds more tightly than NOT, so preserve its grouping when generating NOT.
355            return self.expression(
356                exp.Paren(this=self.expression(exp.Not(this=self._parse_unary())))
357            )
358        return self.expression(exp.Not(this=self._parse_equality()))
359
360    def _parse_bitwise(self) -> exp.Expr | None:
361        this = self._parse_bitwise_and()
362        while self._match(TokenType.PIPE):
363            comments = self._prev_comments
364            this = self.expression(
365                exp.BitwiseOr(this=this, expression=self._parse_bitwise_and()),
366                comments=comments,
367            )
368        return this
369
370    def _parse_bitwise_and(self) -> exp.Expr | None:
371        this = self._parse_bitwise_shift()
372        while self._match(TokenType.AMP):
373            comments = self._prev_comments
374            this = self.expression(
375                exp.BitwiseAnd(this=this, expression=self._parse_bitwise_shift()),
376                comments=comments,
377            )
378        return this
379
380    def _parse_bitwise_shift(self) -> exp.Expr | None:
381        this = self._parse_term()
382        while True:
383            if self._match_pair(TokenType.LT, TokenType.LT):
384                klass: type[exp.BitwiseLeftShift | exp.BitwiseRightShift] = exp.BitwiseLeftShift
385            elif self._match_pair(TokenType.GT, TokenType.GT):
386                klass = exp.BitwiseRightShift
387            else:
388                break
389
390            comments = self._prev_comments
391            this = self.expression(
392                klass(this=this, expression=self._parse_term()), comments=comments
393            )
394        return this
395
396    def _parse_column_constraint(self) -> exp.Expr | None:
397        # SIGNED is the default for numeric types, so MySQL ignores it
398        self._match_text_seq("SIGNED")
399        if self._match(TokenType.KEY):
400            return self.expression(exp.ColumnConstraint(kind=self._parse_primary_key()))
401
402        return super()._parse_column_constraint()
403
404    def _parse_range(self, this: exp.Expr | None = None, parse_is: bool = False) -> exp.Expr | None:
405        this = this or self._parse_bitwise()
406
407        if self._match_text_seq("SOUNDS", "LIKE"):
408            this = self.expression(
409                exp.EQ(
410                    this=self.expression(exp.Soundex(this=this)),
411                    expression=self.expression(exp.Soundex(this=self._parse_bitwise())),
412                )
413            )
414            # MySQL evaluates = and IS left to right because they have the same precedence.
415            if self._match(TokenType.IS, advance=False):
416                this = self.expression(exp.Paren(this=this))
417
418        return super()._parse_range(this, parse_is=parse_is)
419
420    def _parse_alter_table_rename(self):
421        if self._match_texts(("INDEX", "KEY")):
422            old = self._parse_id_var()
423            self._match_text_seq("TO")
424            new = self._parse_id_var()
425            return self.expression(exp.RenameIndex(this=old, to=new))
426        return super()._parse_alter_table_rename()
427
428    def _parse_alter_drop_action(self) -> exp.Expr | None:
429        if self._match_pair(TokenType.DROP, TokenType.PRIMARY_KEY):
430            return self.expression(exp.DropPrimaryKey())
431        if self._match_pair(TokenType.DROP, TokenType.KEY):
432            return self._parse_drop(kind="INDEX")
433        if self._match_text_seq("DROP", "CHECK"):
434            return self._parse_drop(kind="CHECK")
435        return super()._parse_alter_drop_action()
436
437    def _parse_alter_table_modify(self, rename: bool = False) -> exp.Expr | None:
438        # MODIFY [COLUMN]            col_name      column_definition [FIRST | AFTER col_name]
439        # CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST | AFTER col_name]
440        self._match(TokenType.COLUMN)
441
442        column = self._parse_field(any_token=True)
443        if column is None:
444            return None
445
446        rename_from = None
447        if rename:
448            rename_from = column
449            column = self._parse_field(any_token=True)
450            if column is None:
451                return None
452
453        column_def = self._parse_column_def(column)
454        if not isinstance(column_def, exp.ColumnDef):
455            return None
456
457        return self.expression(exp.ModifyColumn(this=column_def, rename_from=rename_from))
458
459    def _parse_generated_as_identity(
460        self,
461    ) -> (
462        exp.GeneratedAsIdentityColumnConstraint
463        | exp.ComputedColumnConstraint
464        | exp.GeneratedAsRowColumnConstraint
465    ):
466        this = super()._parse_generated_as_identity()
467
468        if self._match_texts(("STORED", "VIRTUAL")):
469            persisted = self._prev.text.upper() == "STORED"
470
471            if isinstance(this, exp.ComputedColumnConstraint):
472                this.set("persisted", persisted)
473            elif isinstance(this, exp.GeneratedAsIdentityColumnConstraint):
474                this = self.expression(
475                    exp.ComputedColumnConstraint(this=this.expression, persisted=persisted)
476                )
477
478        return this
479
480    def _parse_primary_key_part(self) -> exp.Expr | None:
481        this = self._parse_id_var()
482        if not self._match(TokenType.L_PAREN):
483            return this
484
485        expression = self._parse_number()
486        self._match_r_paren()
487        return self.expression(exp.ColumnPrefix(this=this, expression=expression))
488
489    def _parse_index_constraint_part(self) -> exp.Expr | None:
490        # key_part: {col_name [(length)] | (expr)}, so only a prefixed column is followed by "("
491        if (
492            not self._match(TokenType.L_PAREN, advance=False)
493            and self._next
494            and self._next.token_type == TokenType.L_PAREN
495        ):
496            return self._parse_primary_key_part()
497
498        return self._parse_disjunction()
499
500    def _parse_index_key_part(self) -> exp.Expr | None:
501        # Only keep the Ordered wrapper for an explicit ASC/DESC, otherwise the implicit
502        # nulls_first leaks into other dialects as NULLS FIRST
503        ordered = self._parse_ordered(self._parse_index_constraint_part)
504        return ordered.this if ordered and ordered.args.get("desc") is None else ordered
505
506    def _parse_index_constraint(self, kind: str | None = None) -> exp.IndexColumnConstraint:
507        if kind:
508            self._match_texts(("INDEX", "KEY"))
509
510        this = self._parse_id_var(any_token=False)
511        index_type = self._match(TokenType.USING) and self._advance_any() and self._prev.text
512        expressions = self._parse_wrapped_csv(self._parse_index_key_part)
513
514        return self.expression(
515            exp.IndexColumnConstraint(
516                this=this,
517                expressions=expressions,
518                kind=kind,
519                index_type=index_type,
520                options=self._parse_index_constraint_options(),
521            )
522        )
523
524    def _parse_index_constraint_options(self) -> list[exp.IndexConstraintOption]:
525        options = []
526        while True:
527            if self._match_text_seq("KEY_BLOCK_SIZE"):
528                self._match(TokenType.EQ)
529                opt = exp.IndexConstraintOption(key_block_size=self._parse_number())
530            elif self._match(TokenType.USING):
531                opt = exp.IndexConstraintOption(using=self._advance_any() and self._prev.text)
532            elif self._match_text_seq("WITH", "PARSER"):
533                opt = exp.IndexConstraintOption(parser=self._parse_var(any_token=True))
534            elif self._match(TokenType.COMMENT):
535                opt = exp.IndexConstraintOption(comment=self._parse_string())
536            elif self._match_text_seq("VISIBLE"):
537                opt = exp.IndexConstraintOption(visible=True)
538            elif self._match_text_seq("INVISIBLE"):
539                opt = exp.IndexConstraintOption(visible=False)
540            elif self._match_text_seq("ENGINE_ATTRIBUTE"):
541                self._match(TokenType.EQ)
542                opt = exp.IndexConstraintOption(engine_attr=self._parse_string())
543            elif self._match_text_seq("SECONDARY_ENGINE_ATTRIBUTE"):
544                self._match(TokenType.EQ)
545                opt = exp.IndexConstraintOption(secondary_engine_attr=self._parse_string())
546            else:
547                opt = None
548
549            if not opt:
550                break
551
552            options.append(opt)
553
554        return options
555
556    def _parse_unique(self) -> exp.UniqueColumnConstraint:
557        self._match_texts(("KEY", "INDEX"))
558        this = self._parse_unique_key()
559        index_type = self._parse_index_type()
560
561        # UNIQUE [INDEX | KEY] [index_name] [index_type] (key_part,...) [index_option] ...
562        if not self._match(TokenType.L_PAREN, advance=False):
563            return self.expression(exp.UniqueColumnConstraint(this=this, index_type=index_type))
564
565        expressions = self._parse_wrapped_csv(self._parse_index_key_part)
566
567        return self.expression(
568            exp.UniqueColumnConstraint(
569                this=self.expression(exp.Schema(this=this, expressions=expressions)),
570                index_type=index_type or self._parse_index_type(),
571                options=self._parse_index_constraint_options(),
572            )
573        )
574
575    def _parse_index_type(self) -> str | None:
576        if self._match(TokenType.USING) and self._advance_any():
577            return self._prev.text
578
579        return None
580
581    def _parse_show_mysql(
582        self,
583        this: str,
584        target: bool | str = False,
585        full: bool | None = None,
586        global_: bool | None = None,
587    ) -> exp.Show:
588        json = self._match_text_seq("JSON")
589
590        if target:
591            if isinstance(target, str):
592                self._match_text_seq(*target.split(" "))
593            target_id = self._parse_id_var()
594        else:
595            target_id = None
596
597        index = self._index
598        if self._match_text_seq("IN"):
599            log = self._parse_string()
600            if log is None:
601                self._retreat(index)
602        else:
603            log = None
604
605        if this in ("BINLOG EVENTS", "RELAYLOG EVENTS"):
606            position = self._parse_number() if self._match_text_seq("FROM") else None
607            db = None
608        else:
609            position = None
610            db = None
611
612            if self._match(TokenType.FROM) or self._match_text_seq("IN"):
613                db = self._parse_id_var()
614            elif self._match(TokenType.DOT):
615                db = target_id
616                target_id = self._parse_id_var()
617
618        channel = self._parse_id_var() if self._match_text_seq("FOR", "CHANNEL") else None
619
620        like = self._parse_string() if self._match_text_seq("LIKE") else None
621        where = self._parse_where()
622
623        if this == "PROFILE":
624            types = self._parse_csv(lambda: self._parse_var_from_options(self.PROFILE_TYPES))
625            query = self._parse_number() if self._match_text_seq("FOR", "QUERY") else None
626            offset = self._parse_number() if self._match_text_seq("OFFSET") else None
627            limit = self._parse_number() if self._match_text_seq("LIMIT") else None
628        else:
629            types, query = None, None
630            offset, limit = self._parse_oldstyle_limit()
631
632        mutex = True if self._match_text_seq("MUTEX") else None
633        mutex = False if self._match_text_seq("STATUS") else mutex
634
635        for_table = self._parse_id_var() if self._match_text_seq("FOR", "TABLE") else None
636        for_group = self._parse_string() if self._match_text_seq("FOR", "GROUP") else None
637        for_user = self._parse_string() if self._match_text_seq("FOR", "USER") else None
638        for_role = self._parse_string() if self._match_text_seq("FOR", "ROLE") else None
639        into_outfile = self._parse_string() if self._match_text_seq("INTO", "OUTFILE") else None
640
641        return self.expression(
642            exp.Show(
643                this=this,
644                target=target_id,
645                full=full,
646                log=log,
647                position=position,
648                db=db,
649                channel=channel,
650                like=like,
651                where=where,
652                types=types,
653                query=query,
654                offset=offset,
655                limit=limit,
656                mutex=mutex,
657                for_table=for_table,
658                for_group=for_group,
659                for_user=for_user,
660                for_role=for_role,
661                into_outfile=into_outfile,
662                json=json,
663                global_=global_,
664            )
665        )
666
667    def _parse_oldstyle_limit(
668        self,
669    ) -> tuple[exp.Expr | None, exp.Expr | None]:
670        limit = None
671        offset = None
672        if self._match_text_seq("LIMIT"):
673            parts = self._parse_csv(self._parse_number)
674            if len(parts) == 1:
675                limit = parts[0]
676            elif len(parts) == 2:
677                limit = parts[1]
678                offset = parts[0]
679
680        return offset, limit
681
682    def _parse_set_item_charset(self, kind: str) -> exp.Expr:
683        this = self._parse_string() or self._parse_unquoted_field()
684        return self.expression(exp.SetItem(this=this, kind=kind))
685
686    def _parse_charset_name(self) -> exp.Expr | None:
687        """
688        Preserve quoting when a charset name has characters that require it (e.g. spaces, as allowed
689        for custom XML-registered charsets). Safe names unwrap to a bare Var so roundtrips remain minimal.
690        """
691        identifier = self._parse_identifier()
692        if identifier:
693            return (
694                exp.Var(this=name)
695                if exp.SAFE_IDENTIFIER_RE.match(name := identifier.name)
696                else identifier
697            )
698        return self._parse_var(tokens={TokenType.BINARY})
699
700    def _parse_set_item_names(self) -> exp.Expr:
701        charset = self._parse_string() or self._parse_unquoted_field()
702        if self._match_text_seq("COLLATE"):
703            collate = self._parse_string() or self._parse_unquoted_field()
704        else:
705            collate = None
706
707        return self.expression(exp.SetItem(this=charset, collate=collate, kind="NAMES"))
708
709    def _parse_type(
710        self, parse_interval: bool = True, fallback_to_identifier: bool = False
711    ) -> exp.Expr | None:
712        # mysql binary is special and can work anywhere, even in order by operations
713        # it operates like a no paren func
714        if self._match(TokenType.BINARY, advance=False):
715            data_type = self._parse_types(check_func=True, allow_identifiers=False)
716
717            if isinstance(data_type, exp.DataType):
718                return self.expression(exp.Cast(this=self._parse_column(), to=data_type))
719
720        return super()._parse_type(
721            parse_interval=parse_interval, fallback_to_identifier=fallback_to_identifier
722        )
723
724    def _parse_alter_table_alter_index(self) -> exp.AlterIndex:
725        index = self._parse_field(any_token=True)
726
727        if self._match_text_seq("VISIBLE"):
728            visible = True
729        elif self._match_text_seq("INVISIBLE"):
730            visible = False
731        else:
732            visible = None
733
734        return self.expression(exp.AlterIndex(this=index, visible=visible))
735
736    def _parse_partition_property(
737        self,
738    ) -> exp.Expr | None | list[exp.Expr]:
739        partition_cls: type[exp.Expr] | None = None
740        value_parser = None
741
742        if self._match_text_seq("RANGE"):
743            partition_cls = exp.PartitionByRangeProperty
744            value_parser = self._parse_partition_range_value
745        elif self._match_text_seq("LIST"):
746            partition_cls = exp.PartitionByListProperty
747            value_parser = self._parse_partition_list_value
748
749        if not partition_cls or not value_parser:
750            return None
751
752        partition_expressions = self._parse_wrapped_csv(self._parse_assignment)
753
754        # For Doris and Starrocks
755        if not self._match_text_seq("(", "PARTITION", advance=False):
756            return partition_expressions
757
758        create_expressions = self._parse_wrapped_csv(value_parser)
759
760        return self.expression(
761            partition_cls(
762                partition_expressions=partition_expressions, create_expressions=create_expressions
763            )
764        )
765
766    def _parse_partition_range_value(self) -> exp.Expr | None:
767        self._match_text_seq("PARTITION")
768        name = self._parse_id_var()
769
770        if not self._match_text_seq("VALUES", "LESS", "THAN"):
771            return name
772
773        values = self._parse_wrapped_csv(self._parse_expression)
774
775        if (
776            len(values) == 1
777            and isinstance(values[0], exp.Column)
778            and values[0].name.upper() == "MAXVALUE"
779        ):
780            values = [exp.var("MAXVALUE")]
781
782        part_range = self.expression(exp.PartitionRange(this=name, expressions=values))
783        return self.expression(exp.Partition(expressions=[part_range]))
784
785    def _parse_partition_list_value(self) -> exp.Partition:
786        self._match_text_seq("PARTITION")
787        name = self._parse_id_var()
788        self._match_text_seq("VALUES", "IN")
789        values = self._parse_wrapped_csv(self._parse_expression)
790        part_list = self.expression(exp.PartitionList(this=name, expressions=values))
791        return self.expression(exp.Partition(expressions=[part_list]))
792
793    def _parse_foreign_key(self) -> exp.ForeignKey:
794        # MySQL only uses this name when CONSTRAINT has none and no existing index fits
795        this = (
796            self._parse_id_var()
797            if self._next and self._next.token_type == TokenType.L_PAREN
798            else None
799        )
800        foreign_key = super()._parse_foreign_key()
801        foreign_key.set("this", this)
802        return foreign_key
803
804    def _parse_primary_key(
805        self,
806        wrapped_optional: bool = False,
807        in_props: bool = False,
808        named_primary_key: bool = False,
809    ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
810        this = super()._parse_primary_key(
811            wrapped_optional=wrapped_optional, in_props=in_props, named_primary_key=True
812        )
813        if isinstance(this, exp.PrimaryKey):
814            # KEY_BLOCK_SIZE, COMMENT etc. after the key parts belong to the key, not the table
815            this.set(
816                "options",
817                [*(this.args.get("options") or []), *self._parse_index_constraint_options()],
818            )
819
820        return this
TIME_SPECIFIERS = {'l', 'r', 'S', 'i', 'f', 'p', 'k', 'T', 'I', 'H', 's', 'h'}
class MySQLParser(sqlglot.parser.Parser):
 63class MySQLParser(parser.Parser):
 64    SUPPORTS_TABLE_QUERY = True
 65
 66    IS_PREDICATE_PRECEDENCE = IsPredicatePrecedence.COMPARISON
 67
 68    NO_PAREN_FUNCTIONS = {
 69        **parser.Parser.NO_PAREN_FUNCTIONS,
 70        TokenType.LOCALTIME: exp.Localtime,
 71        TokenType.LOCALTIMESTAMP: exp.Localtimestamp,
 72    }
 73
 74    ID_VAR_TOKENS = parser.Parser.ID_VAR_TOKENS - {TokenType.STRAIGHT_JOIN}
 75
 76    FUNC_TOKENS = {
 77        *parser.Parser.FUNC_TOKENS,
 78        TokenType.DATABASE,
 79        TokenType.MOD,
 80        TokenType.SCHEMA,
 81        TokenType.VALUES,
 82        TokenType.CHARACTER_SET,
 83    }
 84
 85    CONJUNCTION = {
 86        **parser.Parser.CONJUNCTION,
 87        TokenType.DAMP: exp.And,
 88    }
 89
 90    DISJUNCTION = {
 91        **parser.Parser.DISJUNCTION,
 92        TokenType.DPIPE: exp.Or,
 93    }
 94
 95    UNARY_PARSERS = {
 96        **parser.Parser.UNARY_PARSERS,
 97        TokenType.NOT: lambda self: self._parse_not(),
 98    }
 99
100    EXPONENT = {
101        TokenType.CARET: exp.BitwiseXor,
102    }
103
104    TABLE_ALIAS_TOKENS = (
105        (parser.Parser.TABLE_ALIAS_TOKENS | {TokenType.ANTI, TokenType.SEMI})
106        - parser.Parser.TABLE_INDEX_HINT_TOKENS
107        - {TokenType.STRAIGHT_JOIN}
108    )
109
110    RANGE_PARSERS = {
111        **parser.Parser.RANGE_PARSERS,
112        TokenType.MEMBER_OF: lambda self, this: self.expression(
113            exp.JSONArrayContains(this=this, expression=self._parse_wrapped(self._parse_expression))
114        ),
115    }
116
117    FUNCTIONS = {
118        **parser.Parser.FUNCTIONS,
119        "BIT_AND": exp.BitwiseAndAgg.from_arg_list,
120        "BIT_OR": exp.BitwiseOrAgg.from_arg_list,
121        "BIT_XOR": exp.BitwiseXorAgg.from_arg_list,
122        "BIT_COUNT": exp.BitwiseCount.from_arg_list,
123        "CONVERT_TZ": lambda args: exp.ConvertTimezone(
124            source_tz=seq_get(args, 1), target_tz=seq_get(args, 2), timestamp=seq_get(args, 0)
125        ),
126        "CURDATE": exp.CurrentDate.from_arg_list,
127        "CURTIME": exp.CurrentTime.from_arg_list,
128        "DATE": lambda args: exp.TsOrDsToDate(this=seq_get(args, 0)),
129        "DATEDIFF": lambda args: exp.DateDiff(
130            this=seq_get(args, 0), expression=seq_get(args, 1), date_part_boundary=True
131        ),
132        "DATE_ADD": build_date_delta_with_interval(exp.DateAdd),
133        "DATE_FORMAT": lambda args: exp.TimeToStr(
134            this=exp.TsOrDsToTimestamp(this=seq_get(args, 0)),
135            format=Dialect["mysql"].format_time(seq_get(args, 1)),
136        ),
137        "DATE_SUB": build_date_delta_with_interval(exp.DateSub),
138        "DAY": lambda args: exp.Day(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
139        "DAYOFMONTH": lambda args: exp.DayOfMonth(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
140        "DAYOFWEEK": lambda args: exp.DayOfWeek(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
141        "DAYOFYEAR": lambda args: exp.DayOfYear(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
142        "FORMAT": exp.NumberToStr.from_arg_list,
143        "FROM_UNIXTIME": build_formatted_time(exp.UnixToTime),
144        "ISNULL": isnull_to_is_null,
145        "LENGTH": lambda args: exp.Length(this=seq_get(args, 0), binary=True),
146        "MAKETIME": exp.TimeFromParts.from_arg_list,
147        "MONTH": lambda args: exp.Month(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
148        "MONTHNAME": lambda args: exp.TimeToStr(
149            this=exp.TsOrDsToDate(this=seq_get(args, 0)),
150            format=exp.Literal.string("%B"),
151        ),
152        "SCHEMA": exp.CurrentSchema.from_arg_list,
153        "DATABASE": exp.CurrentSchema.from_arg_list,
154        "STD": exp.StddevPop.from_arg_list,
155        "STDDEV": exp.StddevPop.from_arg_list,
156        "STR_TO_DATE": _str_to_date,
157        "TIMESTAMPADD": _build_timestampadd,
158        "TIMESTAMPDIFF": build_date_delta(exp.TimestampDiff),
159        "TO_DAYS": lambda args: exp.paren(
160            exp.DateDiff(
161                this=exp.TsOrDsToDate(this=seq_get(args, 0)),
162                expression=exp.TsOrDsToDate(this=exp.Literal.string("0000-01-01")),
163                unit=exp.var("DAY"),
164            )
165            + 1
166        ),
167        "VARIANCE": exp.VariancePop.from_arg_list,
168        "VERSION": exp.CurrentVersion.from_arg_list,
169        "WEEK": lambda args: exp.Week(
170            this=exp.TsOrDsToDate(this=seq_get(args, 0)), mode=seq_get(args, 1)
171        ),
172        "WEEKOFYEAR": lambda args: exp.WeekOfYear(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
173        "YEAR": lambda args: exp.Year(this=exp.TsOrDsToDate(this=seq_get(args, 0))),
174    }
175
176    FUNCTION_PARSERS = {
177        **parser.Parser.FUNCTION_PARSERS,
178        "GROUP_CONCAT": lambda self: self._parse_group_concat(),
179        # https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_values
180        "VALUES": lambda self: self.expression(
181            exp.Anonymous(this="VALUES", expressions=[self._parse_id_var()])
182        ),
183        "JSON_VALUE": lambda self: self._parse_json_value(),
184        "SUBSTR": lambda self: self._parse_substring(),
185    }
186
187    STATEMENT_PARSERS = {
188        **parser.Parser.STATEMENT_PARSERS,
189        TokenType.SHOW: lambda self: self._parse_show(),
190    }
191
192    SHOW_PARSERS = {
193        "BINARY LOGS": _show_parser("BINARY LOGS"),
194        "MASTER LOGS": _show_parser("BINARY LOGS"),
195        "BINLOG EVENTS": _show_parser("BINLOG EVENTS"),
196        "CHARACTER SET": _show_parser("CHARACTER SET"),
197        "CHARSET": _show_parser("CHARACTER SET"),
198        "COLLATION": _show_parser("COLLATION"),
199        "FULL COLUMNS": _show_parser("COLUMNS", target="FROM", full=True),
200        "COLUMNS": _show_parser("COLUMNS", target="FROM"),
201        "CREATE DATABASE": _show_parser("CREATE DATABASE", target=True),
202        "CREATE EVENT": _show_parser("CREATE EVENT", target=True),
203        "CREATE FUNCTION": _show_parser("CREATE FUNCTION", target=True),
204        "CREATE PROCEDURE": _show_parser("CREATE PROCEDURE", target=True),
205        "CREATE TABLE": _show_parser("CREATE TABLE", target=True),
206        "CREATE TRIGGER": _show_parser("CREATE TRIGGER", target=True),
207        "CREATE VIEW": _show_parser("CREATE VIEW", target=True),
208        "DATABASES": _show_parser("DATABASES"),
209        "SCHEMAS": _show_parser("DATABASES"),
210        "ENGINE": _show_parser("ENGINE", target=True),
211        "STORAGE ENGINES": _show_parser("ENGINES"),
212        "ENGINES": _show_parser("ENGINES"),
213        "ERRORS": _show_parser("ERRORS"),
214        "EVENTS": _show_parser("EVENTS"),
215        "FUNCTION CODE": _show_parser("FUNCTION CODE", target=True),
216        "FUNCTION STATUS": _show_parser("FUNCTION STATUS"),
217        "GRANTS": _show_parser("GRANTS", target="FOR"),
218        "INDEX": _show_parser("INDEX", target="FROM"),
219        "MASTER STATUS": _show_parser("MASTER STATUS"),
220        "OPEN TABLES": _show_parser("OPEN TABLES"),
221        "PLUGINS": _show_parser("PLUGINS"),
222        "PROCEDURE CODE": _show_parser("PROCEDURE CODE", target=True),
223        "PROCEDURE STATUS": _show_parser("PROCEDURE STATUS"),
224        "PRIVILEGES": _show_parser("PRIVILEGES"),
225        "FULL PROCESSLIST": _show_parser("PROCESSLIST", full=True),
226        "PROCESSLIST": _show_parser("PROCESSLIST"),
227        "PROFILE": _show_parser("PROFILE"),
228        "PROFILES": _show_parser("PROFILES"),
229        "RELAYLOG EVENTS": _show_parser("RELAYLOG EVENTS"),
230        "REPLICAS": _show_parser("REPLICAS"),
231        "SLAVE HOSTS": _show_parser("REPLICAS"),
232        "REPLICA STATUS": _show_parser("REPLICA STATUS"),
233        "SLAVE STATUS": _show_parser("REPLICA STATUS"),
234        "GLOBAL STATUS": _show_parser("STATUS", global_=True),
235        "SESSION STATUS": _show_parser("STATUS"),
236        "STATUS": _show_parser("STATUS"),
237        "TABLE STATUS": _show_parser("TABLE STATUS"),
238        "FULL TABLES": _show_parser("TABLES", full=True),
239        "TABLES": _show_parser("TABLES"),
240        "TRIGGERS": _show_parser("TRIGGERS"),
241        "GLOBAL VARIABLES": _show_parser("VARIABLES", global_=True),
242        "SESSION VARIABLES": _show_parser("VARIABLES"),
243        "VARIABLES": _show_parser("VARIABLES"),
244        "WARNINGS": _show_parser("WARNINGS"),
245    }
246
247    PROPERTY_PARSERS = {
248        **parser.Parser.PROPERTY_PARSERS,
249        "LOCK": lambda self: self._parse_property_assignment(exp.LockProperty),
250        "PARTITION BY": lambda self: self._parse_partition_property(),
251    }
252
253    SET_PARSERS = {
254        **parser.Parser.SET_PARSERS,
255        "PERSIST": lambda self: self._parse_set_item_assignment("PERSIST"),
256        "PERSIST_ONLY": lambda self: self._parse_set_item_assignment("PERSIST_ONLY"),
257        "CHARACTER SET": lambda self: self._parse_set_item_charset("CHARACTER SET"),
258        "CHARSET": lambda self: self._parse_set_item_charset("CHARACTER SET"),
259        "NAMES": lambda self: self._parse_set_item_names(),
260    }
261
262    SHOW_TRIE = new_trie(key.split(" ") for key in SHOW_PARSERS)
263    SET_TRIE = new_trie(key.split(" ") for key in SET_PARSERS)
264
265    CONSTRAINT_PARSERS = {
266        **parser.Parser.CONSTRAINT_PARSERS,
267        "BINARY": lambda self: self.expression(exp.BinaryColumnConstraint()),
268        "FULLTEXT": lambda self: self._parse_index_constraint(kind="FULLTEXT"),
269        "INDEX": lambda self: self._parse_index_constraint(),
270        "KEY": lambda self: self._parse_index_constraint(),
271        "SPATIAL": lambda self: self._parse_index_constraint(kind="SPATIAL"),
272        "ZEROFILL": lambda self: self.expression(exp.ZeroFillColumnConstraint()),
273        "INVISIBLE": lambda self: self.expression(exp.InvisibleColumnConstraint()),
274        # MySQL defines ASCII as latin1, not the ascii character set, and UNICODE as ucs2
275        "ASCII": lambda self: self.expression(
276            exp.CharacterSetColumnConstraint(this=exp.var("latin1"))
277        ),
278        "UNICODE": lambda self: self.expression(
279            exp.CharacterSetColumnConstraint(this=exp.var("ucs2"))
280        ),
281    }
282
283    ALTER_PARSERS = {
284        **parser.Parser.ALTER_PARSERS,
285        "CHANGE": lambda self: self._parse_alter_table_modify(rename=True),
286        "MODIFY": lambda self: self._parse_alter_table_modify(),
287        "FORCE": lambda self: self.expression(exp.ForceProperty()),
288    }
289
290    ALTER_ALTER_PARSERS = {
291        **parser.Parser.ALTER_ALTER_PARSERS,
292        "INDEX": lambda self: self._parse_alter_table_alter_index(),
293    }
294
295    ADD_CONSTRAINT_KEYWORDS = {"FULLTEXT", "SPATIAL"}
296
297    RESERVED_CONSTRAINT_KINDS = {"CHECK", "FOREIGN KEY", "PRIMARY KEY", "UNIQUE"}
298
299    SCHEMA_UNNAMED_CONSTRAINTS = {
300        *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
301        "FULLTEXT",
302        "INDEX",
303        "KEY",
304        "SPATIAL",
305    }
306
307    PROFILE_TYPES: t.ClassVar[parser.OPTIONS_TYPE] = {
308        **dict.fromkeys(("ALL", "CPU", "IPC", "MEMORY", "SOURCE", "SWAPS"), tuple()),
309        "BLOCK": ("IO",),
310        "CONTEXT": ("SWITCHES",),
311        "PAGE": ("FAULTS",),
312    }
313
314    TYPE_TOKENS = {
315        *parser.Parser.TYPE_TOKENS,
316        TokenType.SET,
317    }
318
319    ENUM_TYPE_TOKENS = {
320        *parser.Parser.ENUM_TYPE_TOKENS,
321        TokenType.SET,
322    }
323
324    # SELECT [ ALL | DISTINCT | DISTINCTROW ] [ <OPERATION_MODIFIERS> ]
325    OPERATION_MODIFIERS = {
326        "HIGH_PRIORITY",
327        "STRAIGHT_JOIN",
328        "SQL_SMALL_RESULT",
329        "SQL_BIG_RESULT",
330        "SQL_BUFFER_RESULT",
331        "SQL_NO_CACHE",
332        "SQL_CALC_FOUND_ROWS",
333    }
334
335    ALTER_DROP_REQUIRES_COLUMN = False
336    ALTER_TABLE_MIXED_ACTIONS = True
337    ALTER_TABLE_REQUIRES_ACTION = False
338    LOG_DEFAULTS_TO_LN = True
339    STRING_ALIASES = True
340    VALUES_FOLLOWED_BY_PAREN = False
341    SUPPORTS_PARTITION_SELECTION = True
342
343    def _parse_conjunction(self) -> exp.Expr | None:
344        this = super()._parse_conjunction()
345        while self._match(TokenType.XOR):
346            comments = self._prev_comments
347            this = self.expression(
348                exp.Xor(this=this, expression=super()._parse_conjunction()),
349                comments=comments,
350            )
351        return this
352
353    def _parse_not(self) -> exp.Expr:
354        if self._prev.text == "!":
355            # ! binds more tightly than NOT, so preserve its grouping when generating NOT.
356            return self.expression(
357                exp.Paren(this=self.expression(exp.Not(this=self._parse_unary())))
358            )
359        return self.expression(exp.Not(this=self._parse_equality()))
360
361    def _parse_bitwise(self) -> exp.Expr | None:
362        this = self._parse_bitwise_and()
363        while self._match(TokenType.PIPE):
364            comments = self._prev_comments
365            this = self.expression(
366                exp.BitwiseOr(this=this, expression=self._parse_bitwise_and()),
367                comments=comments,
368            )
369        return this
370
371    def _parse_bitwise_and(self) -> exp.Expr | None:
372        this = self._parse_bitwise_shift()
373        while self._match(TokenType.AMP):
374            comments = self._prev_comments
375            this = self.expression(
376                exp.BitwiseAnd(this=this, expression=self._parse_bitwise_shift()),
377                comments=comments,
378            )
379        return this
380
381    def _parse_bitwise_shift(self) -> exp.Expr | None:
382        this = self._parse_term()
383        while True:
384            if self._match_pair(TokenType.LT, TokenType.LT):
385                klass: type[exp.BitwiseLeftShift | exp.BitwiseRightShift] = exp.BitwiseLeftShift
386            elif self._match_pair(TokenType.GT, TokenType.GT):
387                klass = exp.BitwiseRightShift
388            else:
389                break
390
391            comments = self._prev_comments
392            this = self.expression(
393                klass(this=this, expression=self._parse_term()), comments=comments
394            )
395        return this
396
397    def _parse_column_constraint(self) -> exp.Expr | None:
398        # SIGNED is the default for numeric types, so MySQL ignores it
399        self._match_text_seq("SIGNED")
400        if self._match(TokenType.KEY):
401            return self.expression(exp.ColumnConstraint(kind=self._parse_primary_key()))
402
403        return super()._parse_column_constraint()
404
405    def _parse_range(self, this: exp.Expr | None = None, parse_is: bool = False) -> exp.Expr | None:
406        this = this or self._parse_bitwise()
407
408        if self._match_text_seq("SOUNDS", "LIKE"):
409            this = self.expression(
410                exp.EQ(
411                    this=self.expression(exp.Soundex(this=this)),
412                    expression=self.expression(exp.Soundex(this=self._parse_bitwise())),
413                )
414            )
415            # MySQL evaluates = and IS left to right because they have the same precedence.
416            if self._match(TokenType.IS, advance=False):
417                this = self.expression(exp.Paren(this=this))
418
419        return super()._parse_range(this, parse_is=parse_is)
420
421    def _parse_alter_table_rename(self):
422        if self._match_texts(("INDEX", "KEY")):
423            old = self._parse_id_var()
424            self._match_text_seq("TO")
425            new = self._parse_id_var()
426            return self.expression(exp.RenameIndex(this=old, to=new))
427        return super()._parse_alter_table_rename()
428
429    def _parse_alter_drop_action(self) -> exp.Expr | None:
430        if self._match_pair(TokenType.DROP, TokenType.PRIMARY_KEY):
431            return self.expression(exp.DropPrimaryKey())
432        if self._match_pair(TokenType.DROP, TokenType.KEY):
433            return self._parse_drop(kind="INDEX")
434        if self._match_text_seq("DROP", "CHECK"):
435            return self._parse_drop(kind="CHECK")
436        return super()._parse_alter_drop_action()
437
438    def _parse_alter_table_modify(self, rename: bool = False) -> exp.Expr | None:
439        # MODIFY [COLUMN]            col_name      column_definition [FIRST | AFTER col_name]
440        # CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST | AFTER col_name]
441        self._match(TokenType.COLUMN)
442
443        column = self._parse_field(any_token=True)
444        if column is None:
445            return None
446
447        rename_from = None
448        if rename:
449            rename_from = column
450            column = self._parse_field(any_token=True)
451            if column is None:
452                return None
453
454        column_def = self._parse_column_def(column)
455        if not isinstance(column_def, exp.ColumnDef):
456            return None
457
458        return self.expression(exp.ModifyColumn(this=column_def, rename_from=rename_from))
459
460    def _parse_generated_as_identity(
461        self,
462    ) -> (
463        exp.GeneratedAsIdentityColumnConstraint
464        | exp.ComputedColumnConstraint
465        | exp.GeneratedAsRowColumnConstraint
466    ):
467        this = super()._parse_generated_as_identity()
468
469        if self._match_texts(("STORED", "VIRTUAL")):
470            persisted = self._prev.text.upper() == "STORED"
471
472            if isinstance(this, exp.ComputedColumnConstraint):
473                this.set("persisted", persisted)
474            elif isinstance(this, exp.GeneratedAsIdentityColumnConstraint):
475                this = self.expression(
476                    exp.ComputedColumnConstraint(this=this.expression, persisted=persisted)
477                )
478
479        return this
480
481    def _parse_primary_key_part(self) -> exp.Expr | None:
482        this = self._parse_id_var()
483        if not self._match(TokenType.L_PAREN):
484            return this
485
486        expression = self._parse_number()
487        self._match_r_paren()
488        return self.expression(exp.ColumnPrefix(this=this, expression=expression))
489
490    def _parse_index_constraint_part(self) -> exp.Expr | None:
491        # key_part: {col_name [(length)] | (expr)}, so only a prefixed column is followed by "("
492        if (
493            not self._match(TokenType.L_PAREN, advance=False)
494            and self._next
495            and self._next.token_type == TokenType.L_PAREN
496        ):
497            return self._parse_primary_key_part()
498
499        return self._parse_disjunction()
500
501    def _parse_index_key_part(self) -> exp.Expr | None:
502        # Only keep the Ordered wrapper for an explicit ASC/DESC, otherwise the implicit
503        # nulls_first leaks into other dialects as NULLS FIRST
504        ordered = self._parse_ordered(self._parse_index_constraint_part)
505        return ordered.this if ordered and ordered.args.get("desc") is None else ordered
506
507    def _parse_index_constraint(self, kind: str | None = None) -> exp.IndexColumnConstraint:
508        if kind:
509            self._match_texts(("INDEX", "KEY"))
510
511        this = self._parse_id_var(any_token=False)
512        index_type = self._match(TokenType.USING) and self._advance_any() and self._prev.text
513        expressions = self._parse_wrapped_csv(self._parse_index_key_part)
514
515        return self.expression(
516            exp.IndexColumnConstraint(
517                this=this,
518                expressions=expressions,
519                kind=kind,
520                index_type=index_type,
521                options=self._parse_index_constraint_options(),
522            )
523        )
524
525    def _parse_index_constraint_options(self) -> list[exp.IndexConstraintOption]:
526        options = []
527        while True:
528            if self._match_text_seq("KEY_BLOCK_SIZE"):
529                self._match(TokenType.EQ)
530                opt = exp.IndexConstraintOption(key_block_size=self._parse_number())
531            elif self._match(TokenType.USING):
532                opt = exp.IndexConstraintOption(using=self._advance_any() and self._prev.text)
533            elif self._match_text_seq("WITH", "PARSER"):
534                opt = exp.IndexConstraintOption(parser=self._parse_var(any_token=True))
535            elif self._match(TokenType.COMMENT):
536                opt = exp.IndexConstraintOption(comment=self._parse_string())
537            elif self._match_text_seq("VISIBLE"):
538                opt = exp.IndexConstraintOption(visible=True)
539            elif self._match_text_seq("INVISIBLE"):
540                opt = exp.IndexConstraintOption(visible=False)
541            elif self._match_text_seq("ENGINE_ATTRIBUTE"):
542                self._match(TokenType.EQ)
543                opt = exp.IndexConstraintOption(engine_attr=self._parse_string())
544            elif self._match_text_seq("SECONDARY_ENGINE_ATTRIBUTE"):
545                self._match(TokenType.EQ)
546                opt = exp.IndexConstraintOption(secondary_engine_attr=self._parse_string())
547            else:
548                opt = None
549
550            if not opt:
551                break
552
553            options.append(opt)
554
555        return options
556
557    def _parse_unique(self) -> exp.UniqueColumnConstraint:
558        self._match_texts(("KEY", "INDEX"))
559        this = self._parse_unique_key()
560        index_type = self._parse_index_type()
561
562        # UNIQUE [INDEX | KEY] [index_name] [index_type] (key_part,...) [index_option] ...
563        if not self._match(TokenType.L_PAREN, advance=False):
564            return self.expression(exp.UniqueColumnConstraint(this=this, index_type=index_type))
565
566        expressions = self._parse_wrapped_csv(self._parse_index_key_part)
567
568        return self.expression(
569            exp.UniqueColumnConstraint(
570                this=self.expression(exp.Schema(this=this, expressions=expressions)),
571                index_type=index_type or self._parse_index_type(),
572                options=self._parse_index_constraint_options(),
573            )
574        )
575
576    def _parse_index_type(self) -> str | None:
577        if self._match(TokenType.USING) and self._advance_any():
578            return self._prev.text
579
580        return None
581
582    def _parse_show_mysql(
583        self,
584        this: str,
585        target: bool | str = False,
586        full: bool | None = None,
587        global_: bool | None = None,
588    ) -> exp.Show:
589        json = self._match_text_seq("JSON")
590
591        if target:
592            if isinstance(target, str):
593                self._match_text_seq(*target.split(" "))
594            target_id = self._parse_id_var()
595        else:
596            target_id = None
597
598        index = self._index
599        if self._match_text_seq("IN"):
600            log = self._parse_string()
601            if log is None:
602                self._retreat(index)
603        else:
604            log = None
605
606        if this in ("BINLOG EVENTS", "RELAYLOG EVENTS"):
607            position = self._parse_number() if self._match_text_seq("FROM") else None
608            db = None
609        else:
610            position = None
611            db = None
612
613            if self._match(TokenType.FROM) or self._match_text_seq("IN"):
614                db = self._parse_id_var()
615            elif self._match(TokenType.DOT):
616                db = target_id
617                target_id = self._parse_id_var()
618
619        channel = self._parse_id_var() if self._match_text_seq("FOR", "CHANNEL") else None
620
621        like = self._parse_string() if self._match_text_seq("LIKE") else None
622        where = self._parse_where()
623
624        if this == "PROFILE":
625            types = self._parse_csv(lambda: self._parse_var_from_options(self.PROFILE_TYPES))
626            query = self._parse_number() if self._match_text_seq("FOR", "QUERY") else None
627            offset = self._parse_number() if self._match_text_seq("OFFSET") else None
628            limit = self._parse_number() if self._match_text_seq("LIMIT") else None
629        else:
630            types, query = None, None
631            offset, limit = self._parse_oldstyle_limit()
632
633        mutex = True if self._match_text_seq("MUTEX") else None
634        mutex = False if self._match_text_seq("STATUS") else mutex
635
636        for_table = self._parse_id_var() if self._match_text_seq("FOR", "TABLE") else None
637        for_group = self._parse_string() if self._match_text_seq("FOR", "GROUP") else None
638        for_user = self._parse_string() if self._match_text_seq("FOR", "USER") else None
639        for_role = self._parse_string() if self._match_text_seq("FOR", "ROLE") else None
640        into_outfile = self._parse_string() if self._match_text_seq("INTO", "OUTFILE") else None
641
642        return self.expression(
643            exp.Show(
644                this=this,
645                target=target_id,
646                full=full,
647                log=log,
648                position=position,
649                db=db,
650                channel=channel,
651                like=like,
652                where=where,
653                types=types,
654                query=query,
655                offset=offset,
656                limit=limit,
657                mutex=mutex,
658                for_table=for_table,
659                for_group=for_group,
660                for_user=for_user,
661                for_role=for_role,
662                into_outfile=into_outfile,
663                json=json,
664                global_=global_,
665            )
666        )
667
668    def _parse_oldstyle_limit(
669        self,
670    ) -> tuple[exp.Expr | None, exp.Expr | None]:
671        limit = None
672        offset = None
673        if self._match_text_seq("LIMIT"):
674            parts = self._parse_csv(self._parse_number)
675            if len(parts) == 1:
676                limit = parts[0]
677            elif len(parts) == 2:
678                limit = parts[1]
679                offset = parts[0]
680
681        return offset, limit
682
683    def _parse_set_item_charset(self, kind: str) -> exp.Expr:
684        this = self._parse_string() or self._parse_unquoted_field()
685        return self.expression(exp.SetItem(this=this, kind=kind))
686
687    def _parse_charset_name(self) -> exp.Expr | None:
688        """
689        Preserve quoting when a charset name has characters that require it (e.g. spaces, as allowed
690        for custom XML-registered charsets). Safe names unwrap to a bare Var so roundtrips remain minimal.
691        """
692        identifier = self._parse_identifier()
693        if identifier:
694            return (
695                exp.Var(this=name)
696                if exp.SAFE_IDENTIFIER_RE.match(name := identifier.name)
697                else identifier
698            )
699        return self._parse_var(tokens={TokenType.BINARY})
700
701    def _parse_set_item_names(self) -> exp.Expr:
702        charset = self._parse_string() or self._parse_unquoted_field()
703        if self._match_text_seq("COLLATE"):
704            collate = self._parse_string() or self._parse_unquoted_field()
705        else:
706            collate = None
707
708        return self.expression(exp.SetItem(this=charset, collate=collate, kind="NAMES"))
709
710    def _parse_type(
711        self, parse_interval: bool = True, fallback_to_identifier: bool = False
712    ) -> exp.Expr | None:
713        # mysql binary is special and can work anywhere, even in order by operations
714        # it operates like a no paren func
715        if self._match(TokenType.BINARY, advance=False):
716            data_type = self._parse_types(check_func=True, allow_identifiers=False)
717
718            if isinstance(data_type, exp.DataType):
719                return self.expression(exp.Cast(this=self._parse_column(), to=data_type))
720
721        return super()._parse_type(
722            parse_interval=parse_interval, fallback_to_identifier=fallback_to_identifier
723        )
724
725    def _parse_alter_table_alter_index(self) -> exp.AlterIndex:
726        index = self._parse_field(any_token=True)
727
728        if self._match_text_seq("VISIBLE"):
729            visible = True
730        elif self._match_text_seq("INVISIBLE"):
731            visible = False
732        else:
733            visible = None
734
735        return self.expression(exp.AlterIndex(this=index, visible=visible))
736
737    def _parse_partition_property(
738        self,
739    ) -> exp.Expr | None | list[exp.Expr]:
740        partition_cls: type[exp.Expr] | None = None
741        value_parser = None
742
743        if self._match_text_seq("RANGE"):
744            partition_cls = exp.PartitionByRangeProperty
745            value_parser = self._parse_partition_range_value
746        elif self._match_text_seq("LIST"):
747            partition_cls = exp.PartitionByListProperty
748            value_parser = self._parse_partition_list_value
749
750        if not partition_cls or not value_parser:
751            return None
752
753        partition_expressions = self._parse_wrapped_csv(self._parse_assignment)
754
755        # For Doris and Starrocks
756        if not self._match_text_seq("(", "PARTITION", advance=False):
757            return partition_expressions
758
759        create_expressions = self._parse_wrapped_csv(value_parser)
760
761        return self.expression(
762            partition_cls(
763                partition_expressions=partition_expressions, create_expressions=create_expressions
764            )
765        )
766
767    def _parse_partition_range_value(self) -> exp.Expr | None:
768        self._match_text_seq("PARTITION")
769        name = self._parse_id_var()
770
771        if not self._match_text_seq("VALUES", "LESS", "THAN"):
772            return name
773
774        values = self._parse_wrapped_csv(self._parse_expression)
775
776        if (
777            len(values) == 1
778            and isinstance(values[0], exp.Column)
779            and values[0].name.upper() == "MAXVALUE"
780        ):
781            values = [exp.var("MAXVALUE")]
782
783        part_range = self.expression(exp.PartitionRange(this=name, expressions=values))
784        return self.expression(exp.Partition(expressions=[part_range]))
785
786    def _parse_partition_list_value(self) -> exp.Partition:
787        self._match_text_seq("PARTITION")
788        name = self._parse_id_var()
789        self._match_text_seq("VALUES", "IN")
790        values = self._parse_wrapped_csv(self._parse_expression)
791        part_list = self.expression(exp.PartitionList(this=name, expressions=values))
792        return self.expression(exp.Partition(expressions=[part_list]))
793
794    def _parse_foreign_key(self) -> exp.ForeignKey:
795        # MySQL only uses this name when CONSTRAINT has none and no existing index fits
796        this = (
797            self._parse_id_var()
798            if self._next and self._next.token_type == TokenType.L_PAREN
799            else None
800        )
801        foreign_key = super()._parse_foreign_key()
802        foreign_key.set("this", this)
803        return foreign_key
804
805    def _parse_primary_key(
806        self,
807        wrapped_optional: bool = False,
808        in_props: bool = False,
809        named_primary_key: bool = False,
810    ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
811        this = super()._parse_primary_key(
812            wrapped_optional=wrapped_optional, in_props=in_props, named_primary_key=True
813        )
814        if isinstance(this, exp.PrimaryKey):
815            # KEY_BLOCK_SIZE, COMMENT etc. after the key parts belong to the key, not the table
816            this.set(
817                "options",
818                [*(this.args.get("options") or []), *self._parse_index_constraint_options()],
819            )
820
821        return this

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.
SUPPORTS_TABLE_QUERY = True
IS_PREDICATE_PRECEDENCE = <IsPredicatePrecedence.COMPARISON: 2>
NO_PAREN_FUNCTIONS = {<TokenType.CURRENT_DATE: 249>: <class 'sqlglot.expressions.temporal.CurrentDate'>, <TokenType.CURRENT_DATETIME: 250>: <class 'sqlglot.expressions.temporal.CurrentDate'>, <TokenType.CURRENT_TIME: 252>: <class 'sqlglot.expressions.temporal.CurrentTime'>, <TokenType.CURRENT_TIMESTAMP: 253>: <class 'sqlglot.expressions.temporal.CurrentTimestamp'>, <TokenType.CURRENT_USER: 254>: <class 'sqlglot.expressions.functions.CurrentUser'>, <TokenType.CURRENT_ROLE: 256>: <class 'sqlglot.expressions.functions.CurrentRole'>, <TokenType.LOCALTIME: 180>: <class 'sqlglot.expressions.temporal.Localtime'>, <TokenType.LOCALTIMESTAMP: 181>: <class 'sqlglot.expressions.temporal.Localtimestamp'>}
ID_VAR_TOKENS = {<TokenType.SESSION: 59>, <TokenType.SESSION_USER: 61>, <TokenType.IDENTIFIER: 79>, <TokenType.DATABASE: 80>, <TokenType.COLUMN: 81>, <TokenType.SCHEMA: 83>, <TokenType.TABLE: 84>, <TokenType.WAREHOUSE: 85>, <TokenType.STAGE: 86>, <TokenType.STREAM: 87>, <TokenType.STREAMLIT: 88>, <TokenType.VAR: 89>, <TokenType.BIT: 98>, <TokenType.BOOLEAN: 99>, <TokenType.TINYINT: 100>, <TokenType.UTINYINT: 101>, <TokenType.SMALLINT: 102>, <TokenType.USMALLINT: 103>, <TokenType.MEDIUMINT: 104>, <TokenType.UMEDIUMINT: 105>, <TokenType.INT: 106>, <TokenType.UINT: 107>, <TokenType.BIGINT: 108>, <TokenType.UBIGINT: 109>, <TokenType.BIGNUM: 110>, <TokenType.INT128: 111>, <TokenType.UINT128: 112>, <TokenType.INT256: 113>, <TokenType.UINT256: 114>, <TokenType.FLOAT: 115>, <TokenType.DOUBLE: 116>, <TokenType.UDOUBLE: 117>, <TokenType.DECIMAL: 118>, <TokenType.DECIMAL32: 119>, <TokenType.DECIMAL64: 120>, <TokenType.DECIMAL128: 121>, <TokenType.DECIMAL256: 122>, <TokenType.DECFLOAT: 123>, <TokenType.UDECIMAL: 124>, <TokenType.BIGDECIMAL: 125>, <TokenType.CHAR: 126>, <TokenType.NCHAR: 127>, <TokenType.VARCHAR: 128>, <TokenType.NVARCHAR: 129>, <TokenType.BPCHAR: 130>, <TokenType.TEXT: 131>, <TokenType.MEDIUMTEXT: 132>, <TokenType.LONGTEXT: 133>, <TokenType.BLOB: 134>, <TokenType.MEDIUMBLOB: 135>, <TokenType.LONGBLOB: 136>, <TokenType.TINYBLOB: 137>, <TokenType.TINYTEXT: 138>, <TokenType.NAME: 139>, <TokenType.BINARY: 140>, <TokenType.VARBINARY: 141>, <TokenType.JSON: 142>, <TokenType.JSONB: 143>, <TokenType.TIME: 144>, <TokenType.TIMETZ: 145>, <TokenType.TIME_NS: 146>, <TokenType.TIMESTAMP: 147>, <TokenType.TIMESTAMPTZ: 148>, <TokenType.TIMESTAMPLTZ: 149>, <TokenType.TIMESTAMPNTZ: 150>, <TokenType.TIMESTAMP_S: 151>, <TokenType.TIMESTAMP_MS: 152>, <TokenType.TIMESTAMP_NS: 153>, <TokenType.DATETIME: 154>, <TokenType.DATETIME2: 155>, <TokenType.DATETIME64: 156>, <TokenType.SMALLDATETIME: 157>, <TokenType.DATE: 158>, <TokenType.DATE32: 159>, <TokenType.INT4RANGE: 160>, <TokenType.INT4MULTIRANGE: 161>, <TokenType.INT8RANGE: 162>, <TokenType.INT8MULTIRANGE: 163>, <TokenType.NUMRANGE: 164>, <TokenType.NUMMULTIRANGE: 165>, <TokenType.TSRANGE: 166>, <TokenType.TSMULTIRANGE: 167>, <TokenType.TSTZRANGE: 168>, <TokenType.TSTZMULTIRANGE: 169>, <TokenType.DATERANGE: 170>, <TokenType.DATEMULTIRANGE: 171>, <TokenType.UUID: 172>, <TokenType.GEOGRAPHY: 173>, <TokenType.GEOGRAPHYPOINT: 174>, <TokenType.NULLABLE: 175>, <TokenType.GEOMETRY: 176>, <TokenType.POINT: 177>, <TokenType.RING: 178>, <TokenType.LINESTRING: 179>, <TokenType.LOCALTIME: 180>, <TokenType.LOCALTIMESTAMP: 181>, <TokenType.MULTILINESTRING: 183>, <TokenType.POLYGON: 184>, <TokenType.MULTIPOLYGON: 185>, <TokenType.HLLSKETCH: 186>, <TokenType.HSTORE: 187>, <TokenType.SUPER: 188>, <TokenType.SERIAL: 189>, <TokenType.SMALLSERIAL: 190>, <TokenType.BIGSERIAL: 191>, <TokenType.XML: 192>, <TokenType.YEAR: 193>, <TokenType.USERDEFINED: 194>, <TokenType.MONEY: 195>, <TokenType.SMALLMONEY: 196>, <TokenType.ROWVERSION: 197>, <TokenType.IMAGE: 198>, <TokenType.VARIANT: 199>, <TokenType.OBJECT: 200>, <TokenType.REF: 201>, <TokenType.INET: 202>, <TokenType.IPADDRESS: 203>, <TokenType.IPPREFIX: 204>, <TokenType.IPV4: 205>, <TokenType.IPV6: 206>, <TokenType.ENUM: 207>, <TokenType.ENUM8: 208>, <TokenType.ENUM16: 209>, <TokenType.FIXEDSTRING: 210>, <TokenType.LOWCARDINALITY: 211>, <TokenType.NESTED: 212>, <TokenType.AGGREGATEFUNCTION: 213>, <TokenType.SIMPLEAGGREGATEFUNCTION: 214>, <TokenType.TDIGEST: 215>, <TokenType.UNKNOWN: 216>, <TokenType.VECTOR: 217>, <TokenType.DYNAMIC: 218>, <TokenType.VOID: 219>, <TokenType.ALL: 222>, <TokenType.ANTI: 223>, <TokenType.ANY: 224>, <TokenType.APPLY: 225>, <TokenType.ARRAY: 226>, <TokenType.ASC: 227>, <TokenType.ASOF: 228>, <TokenType.ATTACH: 229>, <TokenType.AUTO_INCREMENT: 230>, <TokenType.BEGIN: 231>, <TokenType.CACHE: 234>, <TokenType.CASE: 235>, <TokenType.COLLATE: 238>, <TokenType.COMMAND: 239>, <TokenType.COMMENT: 240>, <TokenType.COMMIT: 241>, <TokenType.CONNECT: 242>, <TokenType.CONSTRAINT: 244>, <TokenType.COPY: 245>, <TokenType.CUBE: 248>, <TokenType.CURRENT_DATE: 249>, <TokenType.CURRENT_DATETIME: 250>, <TokenType.CURRENT_SCHEMA: 251>, <TokenType.CURRENT_TIME: 252>, <TokenType.CURRENT_TIMESTAMP: 253>, <TokenType.CURRENT_USER: 254>, <TokenType.CURRENT_ROLE: 256>, <TokenType.CURRENT_CATALOG: 257>, <TokenType.DECLARE: 258>, <TokenType.DEFAULT: 259>, <TokenType.DELETE: 260>, <TokenType.DESC: 261>, <TokenType.DESCRIBE: 262>, <TokenType.DETACH: 263>, <TokenType.DISCONNECT: 264>, <TokenType.DICTIONARY: 265>, <TokenType.DIV: 268>, <TokenType.END: 271>, <TokenType.ESCAPE: 272>, <TokenType.EXECUTE: 274>, <TokenType.EXISTS: 275>, <TokenType.FALSE: 276>, <TokenType.FILE: 278>, <TokenType.FILE_FORMAT: 279>, <TokenType.FILTER: 280>, <TokenType.FINAL: 281>, <TokenType.FIRST: 282>, <TokenType.FOREIGN_KEY: 285>, <TokenType.FORMAT: 286>, <TokenType.FULL: 288>, <TokenType.FUNCTION: 289>, <TokenType.GET: 290>, <TokenType.IN: 300>, <TokenType.INDEX: 301>, <TokenType.INTERVAL: 308>, <TokenType.IS: 312>, <TokenType.ISNULL: 313>, <TokenType.KEEP: 316>, <TokenType.KILL: 318>, <TokenType.LEFT: 321>, <TokenType.LIMIT: 323>, <TokenType.LIST: 324>, <TokenType.LOAD: 325>, <TokenType.LOCK: 326>, <TokenType.MAP: 327>, <TokenType.MATCH: 328>, <TokenType.MERGE: 332>, <TokenType.MODEL: 334>, <TokenType.NATURAL: 335>, <TokenType.NEXT: 336>, <TokenType.NOTHING: 337>, <TokenType.NULL: 339>, <TokenType.OBJECT_IDENTIFIER: 340>, <TokenType.OFFSET: 341>, <TokenType.OPERATOR: 344>, <TokenType.ORDINALITY: 348>, <TokenType.OUT: 349>, <TokenType.INOUT: 350>, <TokenType.OVER: 352>, <TokenType.OVERLAPS: 353>, <TokenType.OVERWRITE: 354>, <TokenType.PARTITION: 356>, <TokenType.PASTE: 358>, <TokenType.PERCENT: 359>, <TokenType.PIVOT: 360>, <TokenType.PRAGMA: 365>, <TokenType.PROCEDURE: 368>, <TokenType.PROJECTION: 370>, <TokenType.PSEUDO_TYPE: 371>, <TokenType.PUT: 372>, <TokenType.RANGE: 376>, <TokenType.RECURSIVE: 377>, <TokenType.REFRESH: 378>, <TokenType.RENAME: 379>, <TokenType.REPLACE: 380>, <TokenType.REFERENCES: 383>, <TokenType.RIGHT: 384>, <TokenType.ROLLUP: 388>, <TokenType.ROW: 389>, <TokenType.ROWS: 390>, <TokenType.SEMI: 393>, <TokenType.SEQUENCE: 395>, <TokenType.SET: 397>, <TokenType.SETTINGS: 398>, <TokenType.SHOW: 399>, <TokenType.SOME: 401>, <TokenType.STORAGE_INTEGRATION: 406>, <TokenType.STRUCT: 408>, <TokenType.TAG: 411>, <TokenType.TEMPORARY: 412>, <TokenType.TOP: 413>, <TokenType.TRUE: 415>, <TokenType.TRUNCATE: 416>, <TokenType.TRIGGER: 417>, <TokenType.TYPE: 418>, <TokenType.UNNEST: 422>, <TokenType.UNPIVOT: 423>, <TokenType.UPDATE: 424>, <TokenType.USE: 425>, <TokenType.VIEW: 429>, <TokenType.SEMANTIC_VIEW: 430>, <TokenType.VOLATILE: 431>, <TokenType.WINDOW: 435>, <TokenType.UNIQUE: 437>, <TokenType.SINK: 442>, <TokenType.SOURCE: 443>, <TokenType.ANALYZE: 444>, <TokenType.NAMESPACE: 445>, <TokenType.EXPORT: 446>}
FUNC_TOKENS = {<TokenType.SESSION_USER: 61>, <TokenType.XOR: 66>, <TokenType.IDENTIFIER: 79>, <TokenType.DATABASE: 80>, <TokenType.SCHEMA: 83>, <TokenType.TABLE: 84>, <TokenType.VAR: 89>, <TokenType.BIT: 98>, <TokenType.BOOLEAN: 99>, <TokenType.TINYINT: 100>, <TokenType.UTINYINT: 101>, <TokenType.SMALLINT: 102>, <TokenType.USMALLINT: 103>, <TokenType.MEDIUMINT: 104>, <TokenType.UMEDIUMINT: 105>, <TokenType.INT: 106>, <TokenType.UINT: 107>, <TokenType.BIGINT: 108>, <TokenType.UBIGINT: 109>, <TokenType.BIGNUM: 110>, <TokenType.INT128: 111>, <TokenType.UINT128: 112>, <TokenType.INT256: 113>, <TokenType.UINT256: 114>, <TokenType.FLOAT: 115>, <TokenType.DOUBLE: 116>, <TokenType.UDOUBLE: 117>, <TokenType.DECIMAL: 118>, <TokenType.DECIMAL32: 119>, <TokenType.DECIMAL64: 120>, <TokenType.DECIMAL128: 121>, <TokenType.DECIMAL256: 122>, <TokenType.DECFLOAT: 123>, <TokenType.UDECIMAL: 124>, <TokenType.BIGDECIMAL: 125>, <TokenType.CHAR: 126>, <TokenType.NCHAR: 127>, <TokenType.VARCHAR: 128>, <TokenType.NVARCHAR: 129>, <TokenType.BPCHAR: 130>, <TokenType.TEXT: 131>, <TokenType.MEDIUMTEXT: 132>, <TokenType.LONGTEXT: 133>, <TokenType.BLOB: 134>, <TokenType.MEDIUMBLOB: 135>, <TokenType.LONGBLOB: 136>, <TokenType.TINYBLOB: 137>, <TokenType.TINYTEXT: 138>, <TokenType.NAME: 139>, <TokenType.BINARY: 140>, <TokenType.VARBINARY: 141>, <TokenType.JSON: 142>, <TokenType.JSONB: 143>, <TokenType.TIME: 144>, <TokenType.TIMETZ: 145>, <TokenType.TIME_NS: 146>, <TokenType.TIMESTAMP: 147>, <TokenType.TIMESTAMPTZ: 148>, <TokenType.TIMESTAMPLTZ: 149>, <TokenType.TIMESTAMPNTZ: 150>, <TokenType.TIMESTAMP_S: 151>, <TokenType.TIMESTAMP_MS: 152>, <TokenType.TIMESTAMP_NS: 153>, <TokenType.DATETIME: 154>, <TokenType.DATETIME2: 155>, <TokenType.DATETIME64: 156>, <TokenType.SMALLDATETIME: 157>, <TokenType.DATE: 158>, <TokenType.DATE32: 159>, <TokenType.INT4RANGE: 160>, <TokenType.INT4MULTIRANGE: 161>, <TokenType.INT8RANGE: 162>, <TokenType.INT8MULTIRANGE: 163>, <TokenType.NUMRANGE: 164>, <TokenType.NUMMULTIRANGE: 165>, <TokenType.TSRANGE: 166>, <TokenType.TSMULTIRANGE: 167>, <TokenType.TSTZRANGE: 168>, <TokenType.TSTZMULTIRANGE: 169>, <TokenType.DATERANGE: 170>, <TokenType.DATEMULTIRANGE: 171>, <TokenType.UUID: 172>, <TokenType.GEOGRAPHY: 173>, <TokenType.GEOGRAPHYPOINT: 174>, <TokenType.NULLABLE: 175>, <TokenType.GEOMETRY: 176>, <TokenType.POINT: 177>, <TokenType.RING: 178>, <TokenType.LINESTRING: 179>, <TokenType.LOCALTIME: 180>, <TokenType.LOCALTIMESTAMP: 181>, <TokenType.MULTILINESTRING: 183>, <TokenType.POLYGON: 184>, <TokenType.MULTIPOLYGON: 185>, <TokenType.HLLSKETCH: 186>, <TokenType.HSTORE: 187>, <TokenType.SUPER: 188>, <TokenType.SERIAL: 189>, <TokenType.SMALLSERIAL: 190>, <TokenType.BIGSERIAL: 191>, <TokenType.XML: 192>, <TokenType.YEAR: 193>, <TokenType.USERDEFINED: 194>, <TokenType.MONEY: 195>, <TokenType.SMALLMONEY: 196>, <TokenType.ROWVERSION: 197>, <TokenType.IMAGE: 198>, <TokenType.VARIANT: 199>, <TokenType.OBJECT: 200>, <TokenType.REF: 201>, <TokenType.INET: 202>, <TokenType.IPADDRESS: 203>, <TokenType.IPPREFIX: 204>, <TokenType.IPV4: 205>, <TokenType.IPV6: 206>, <TokenType.ENUM: 207>, <TokenType.ENUM8: 208>, <TokenType.ENUM16: 209>, <TokenType.FIXEDSTRING: 210>, <TokenType.LOWCARDINALITY: 211>, <TokenType.NESTED: 212>, <TokenType.AGGREGATEFUNCTION: 213>, <TokenType.SIMPLEAGGREGATEFUNCTION: 214>, <TokenType.TDIGEST: 215>, <TokenType.UNKNOWN: 216>, <TokenType.VECTOR: 217>, <TokenType.DYNAMIC: 218>, <TokenType.VOID: 219>, <TokenType.ALL: 222>, <TokenType.ANY: 224>, <TokenType.ARRAY: 226>, <TokenType.CHARACTER_SET: 236>, <TokenType.COLLATE: 238>, <TokenType.COMMAND: 239>, <TokenType.CURRENT_DATE: 249>, <TokenType.CURRENT_DATETIME: 250>, <TokenType.CURRENT_SCHEMA: 251>, <TokenType.CURRENT_TIME: 252>, <TokenType.CURRENT_TIMESTAMP: 253>, <TokenType.CURRENT_USER: 254>, <TokenType.CURRENT_CATALOG: 257>, <TokenType.DECLARE: 258>, <TokenType.EXISTS: 275>, <TokenType.FILTER: 280>, <TokenType.FIRST: 282>, <TokenType.FORMAT: 286>, <TokenType.GET: 290>, <TokenType.GLOB: 291>, <TokenType.ILIKE: 299>, <TokenType.INDEX: 301>, <TokenType.INSERT: 304>, <TokenType.INTERVAL: 308>, <TokenType.ISNULL: 313>, <TokenType.LEFT: 321>, <TokenType.LIKE: 322>, <TokenType.LIST: 324>, <TokenType.MAP: 327>, <TokenType.MERGE: 332>, <TokenType.MOD: 333>, <TokenType.NEXT: 336>, <TokenType.NOTHING: 337>, <TokenType.NULL: 339>, <TokenType.OBJECT_IDENTIFIER: 340>, <TokenType.OFFSET: 341>, <TokenType.PRIMARY_KEY: 367>, <TokenType.PSEUDO_TYPE: 371>, <TokenType.RANGE: 376>, <TokenType.REPLACE: 380>, <TokenType.RIGHT: 384>, <TokenType.RLIKE: 385>, <TokenType.ROW: 389>, <TokenType.SEQUENCE: 395>, <TokenType.SOME: 401>, <TokenType.STRUCT: 408>, <TokenType.TRUNCATE: 416>, <TokenType.UNION: 421>, <TokenType.UNNEST: 422>, <TokenType.VALUES: 427>, <TokenType.WINDOW: 435>, <TokenType.UTC_DATE: 438>, <TokenType.UTC_TIME: 439>, <TokenType.UTC_TIMESTAMP: 440>}
CONJUNCTION = {<TokenType.AND: 34>: <class 'sqlglot.expressions.core.And'>, <TokenType.DAMP: 62>: <class 'sqlglot.expressions.core.And'>}
DISJUNCTION = {<TokenType.OR: 35>: <class 'sqlglot.expressions.core.Or'>, <TokenType.DPIPE: 37>: <class 'sqlglot.expressions.core.Or'>}
UNARY_PARSERS = {<TokenType.PLUS: 10>: <function Parser.<lambda>>, <TokenType.NOT: 27>: <function MySQLParser.<lambda>>, <TokenType.TILDE: 44>: <function Parser.<lambda>>, <TokenType.DASH: 9>: <function Parser.<lambda>>, <TokenType.PIPE_SLASH: 40>: <function Parser.<lambda>>, <TokenType.DPIPE_SLASH: 41>: <function Parser.<lambda>>}
EXPONENT = {<TokenType.CARET: 42>: <class 'sqlglot.expressions.core.BitwiseXor'>}
TABLE_ALIAS_TOKENS = {<TokenType.SESSION: 59>, <TokenType.SESSION_USER: 61>, <TokenType.IDENTIFIER: 79>, <TokenType.DATABASE: 80>, <TokenType.COLUMN: 81>, <TokenType.SCHEMA: 83>, <TokenType.TABLE: 84>, <TokenType.WAREHOUSE: 85>, <TokenType.STAGE: 86>, <TokenType.STREAM: 87>, <TokenType.STREAMLIT: 88>, <TokenType.VAR: 89>, <TokenType.BIT: 98>, <TokenType.BOOLEAN: 99>, <TokenType.TINYINT: 100>, <TokenType.UTINYINT: 101>, <TokenType.SMALLINT: 102>, <TokenType.USMALLINT: 103>, <TokenType.MEDIUMINT: 104>, <TokenType.UMEDIUMINT: 105>, <TokenType.INT: 106>, <TokenType.UINT: 107>, <TokenType.BIGINT: 108>, <TokenType.UBIGINT: 109>, <TokenType.BIGNUM: 110>, <TokenType.INT128: 111>, <TokenType.UINT128: 112>, <TokenType.INT256: 113>, <TokenType.UINT256: 114>, <TokenType.FLOAT: 115>, <TokenType.DOUBLE: 116>, <TokenType.UDOUBLE: 117>, <TokenType.DECIMAL: 118>, <TokenType.DECIMAL32: 119>, <TokenType.DECIMAL64: 120>, <TokenType.DECIMAL128: 121>, <TokenType.DECIMAL256: 122>, <TokenType.DECFLOAT: 123>, <TokenType.UDECIMAL: 124>, <TokenType.BIGDECIMAL: 125>, <TokenType.CHAR: 126>, <TokenType.NCHAR: 127>, <TokenType.VARCHAR: 128>, <TokenType.NVARCHAR: 129>, <TokenType.BPCHAR: 130>, <TokenType.TEXT: 131>, <TokenType.MEDIUMTEXT: 132>, <TokenType.LONGTEXT: 133>, <TokenType.BLOB: 134>, <TokenType.MEDIUMBLOB: 135>, <TokenType.LONGBLOB: 136>, <TokenType.TINYBLOB: 137>, <TokenType.TINYTEXT: 138>, <TokenType.NAME: 139>, <TokenType.BINARY: 140>, <TokenType.VARBINARY: 141>, <TokenType.JSON: 142>, <TokenType.JSONB: 143>, <TokenType.TIME: 144>, <TokenType.TIMETZ: 145>, <TokenType.TIME_NS: 146>, <TokenType.TIMESTAMP: 147>, <TokenType.TIMESTAMPTZ: 148>, <TokenType.TIMESTAMPLTZ: 149>, <TokenType.TIMESTAMPNTZ: 150>, <TokenType.TIMESTAMP_S: 151>, <TokenType.TIMESTAMP_MS: 152>, <TokenType.TIMESTAMP_NS: 153>, <TokenType.DATETIME: 154>, <TokenType.DATETIME2: 155>, <TokenType.DATETIME64: 156>, <TokenType.SMALLDATETIME: 157>, <TokenType.DATE: 158>, <TokenType.DATE32: 159>, <TokenType.INT4RANGE: 160>, <TokenType.INT4MULTIRANGE: 161>, <TokenType.INT8RANGE: 162>, <TokenType.INT8MULTIRANGE: 163>, <TokenType.NUMRANGE: 164>, <TokenType.NUMMULTIRANGE: 165>, <TokenType.TSRANGE: 166>, <TokenType.TSMULTIRANGE: 167>, <TokenType.TSTZRANGE: 168>, <TokenType.TSTZMULTIRANGE: 169>, <TokenType.DATERANGE: 170>, <TokenType.DATEMULTIRANGE: 171>, <TokenType.UUID: 172>, <TokenType.GEOGRAPHY: 173>, <TokenType.GEOGRAPHYPOINT: 174>, <TokenType.NULLABLE: 175>, <TokenType.GEOMETRY: 176>, <TokenType.POINT: 177>, <TokenType.RING: 178>, <TokenType.LINESTRING: 179>, <TokenType.LOCALTIME: 180>, <TokenType.LOCALTIMESTAMP: 181>, <TokenType.MULTILINESTRING: 183>, <TokenType.POLYGON: 184>, <TokenType.MULTIPOLYGON: 185>, <TokenType.HLLSKETCH: 186>, <TokenType.HSTORE: 187>, <TokenType.SUPER: 188>, <TokenType.SERIAL: 189>, <TokenType.SMALLSERIAL: 190>, <TokenType.BIGSERIAL: 191>, <TokenType.XML: 192>, <TokenType.YEAR: 193>, <TokenType.USERDEFINED: 194>, <TokenType.MONEY: 195>, <TokenType.SMALLMONEY: 196>, <TokenType.ROWVERSION: 197>, <TokenType.IMAGE: 198>, <TokenType.VARIANT: 199>, <TokenType.OBJECT: 200>, <TokenType.REF: 201>, <TokenType.INET: 202>, <TokenType.IPADDRESS: 203>, <TokenType.IPPREFIX: 204>, <TokenType.IPV4: 205>, <TokenType.IPV6: 206>, <TokenType.ENUM: 207>, <TokenType.ENUM8: 208>, <TokenType.ENUM16: 209>, <TokenType.FIXEDSTRING: 210>, <TokenType.LOWCARDINALITY: 211>, <TokenType.NESTED: 212>, <TokenType.AGGREGATEFUNCTION: 213>, <TokenType.SIMPLEAGGREGATEFUNCTION: 214>, <TokenType.TDIGEST: 215>, <TokenType.UNKNOWN: 216>, <TokenType.VECTOR: 217>, <TokenType.DYNAMIC: 218>, <TokenType.VOID: 219>, <TokenType.ALL: 222>, <TokenType.ANTI: 223>, <TokenType.ANY: 224>, <TokenType.APPLY: 225>, <TokenType.ARRAY: 226>, <TokenType.ASC: 227>, <TokenType.ATTACH: 229>, <TokenType.AUTO_INCREMENT: 230>, <TokenType.BEGIN: 231>, <TokenType.CACHE: 234>, <TokenType.CASE: 235>, <TokenType.COLLATE: 238>, <TokenType.COMMAND: 239>, <TokenType.COMMENT: 240>, <TokenType.COMMIT: 241>, <TokenType.CONNECT: 242>, <TokenType.CONSTRAINT: 244>, <TokenType.COPY: 245>, <TokenType.CUBE: 248>, <TokenType.CURRENT_DATE: 249>, <TokenType.CURRENT_DATETIME: 250>, <TokenType.CURRENT_SCHEMA: 251>, <TokenType.CURRENT_TIME: 252>, <TokenType.CURRENT_TIMESTAMP: 253>, <TokenType.CURRENT_USER: 254>, <TokenType.CURRENT_ROLE: 256>, <TokenType.CURRENT_CATALOG: 257>, <TokenType.DECLARE: 258>, <TokenType.DEFAULT: 259>, <TokenType.DELETE: 260>, <TokenType.DESC: 261>, <TokenType.DESCRIBE: 262>, <TokenType.DETACH: 263>, <TokenType.DISCONNECT: 264>, <TokenType.DICTIONARY: 265>, <TokenType.DIV: 268>, <TokenType.END: 271>, <TokenType.ESCAPE: 272>, <TokenType.EXECUTE: 274>, <TokenType.EXISTS: 275>, <TokenType.FALSE: 276>, <TokenType.FILE: 278>, <TokenType.FILE_FORMAT: 279>, <TokenType.FILTER: 280>, <TokenType.FINAL: 281>, <TokenType.FIRST: 282>, <TokenType.FOREIGN_KEY: 285>, <TokenType.FORMAT: 286>, <TokenType.FUNCTION: 289>, <TokenType.GET: 290>, <TokenType.IN: 300>, <TokenType.INDEX: 301>, <TokenType.INTERVAL: 308>, <TokenType.IS: 312>, <TokenType.ISNULL: 313>, <TokenType.KEEP: 316>, <TokenType.KILL: 318>, <TokenType.LIMIT: 323>, <TokenType.LIST: 324>, <TokenType.LOAD: 325>, <TokenType.MAP: 327>, <TokenType.MATCH: 328>, <TokenType.MERGE: 332>, <TokenType.MODEL: 334>, <TokenType.NEXT: 336>, <TokenType.NOTHING: 337>, <TokenType.NULL: 339>, <TokenType.OBJECT_IDENTIFIER: 340>, <TokenType.OFFSET: 341>, <TokenType.OPERATOR: 344>, <TokenType.ORDINALITY: 348>, <TokenType.OUT: 349>, <TokenType.INOUT: 350>, <TokenType.OVER: 352>, <TokenType.OVERLAPS: 353>, <TokenType.OVERWRITE: 354>, <TokenType.PARTITION: 356>, <TokenType.PASTE: 358>, <TokenType.PERCENT: 359>, <TokenType.PIVOT: 360>, <TokenType.PRAGMA: 365>, <TokenType.PROCEDURE: 368>, <TokenType.PROJECTION: 370>, <TokenType.PSEUDO_TYPE: 371>, <TokenType.PUT: 372>, <TokenType.RANGE: 376>, <TokenType.RECURSIVE: 377>, <TokenType.REFRESH: 378>, <TokenType.RENAME: 379>, <TokenType.REPLACE: 380>, <TokenType.REFERENCES: 383>, <TokenType.ROLLUP: 388>, <TokenType.ROW: 389>, <TokenType.ROWS: 390>, <TokenType.SEMI: 393>, <TokenType.SEQUENCE: 395>, <TokenType.SET: 397>, <TokenType.SETTINGS: 398>, <TokenType.SHOW: 399>, <TokenType.SOME: 401>, <TokenType.STORAGE_INTEGRATION: 406>, <TokenType.STRUCT: 408>, <TokenType.TAG: 411>, <TokenType.TEMPORARY: 412>, <TokenType.TOP: 413>, <TokenType.TRUE: 415>, <TokenType.TRUNCATE: 416>, <TokenType.TRIGGER: 417>, <TokenType.TYPE: 418>, <TokenType.UNNEST: 422>, <TokenType.UNPIVOT: 423>, <TokenType.UPDATE: 424>, <TokenType.VIEW: 429>, <TokenType.SEMANTIC_VIEW: 430>, <TokenType.VOLATILE: 431>, <TokenType.UNIQUE: 437>, <TokenType.SINK: 442>, <TokenType.SOURCE: 443>, <TokenType.ANALYZE: 444>, <TokenType.NAMESPACE: 445>, <TokenType.EXPORT: 446>}
RANGE_PARSERS = {<TokenType.AT_GT: 56>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.BETWEEN: 232>: <function Parser.<lambda>>, <TokenType.GLOB: 291>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.ILIKE: 299>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IN: 300>: <function Parser.<lambda>>, <TokenType.IRLIKE: 311>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IS: 312>: <function Parser.<lambda>>, <TokenType.LIKE: 322>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.LT_AT: 55>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OVERLAPS: 353>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.RLIKE: 385>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.SIMILAR_TO: 400>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.FOR: 283>: <function Parser.<lambda>>, <TokenType.QMARK_AMP: 68>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.QMARK_PIPE: 69>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.HASH_DASH: 70>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.AT_QMARK: 54>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.ADJACENT: 65>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OPERATOR: 344>: <function Parser.<lambda>>, <TokenType.AMP_LT: 63>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.AMP_GT: 64>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.CARET_AT: 43>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.MEMBER_OF: 331>: <function MySQLParser.<lambda>>}
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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.AnyValue'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArrayDistinct'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraySlice'>>, 'ARRAY_SORT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.ArraySort'>>, '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_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': <function MySQLParser.<lambda>>, 'DATE_ADD': <function build_date_delta_with_interval.<locals>._builder>, 'DATE_BIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateBin'>>, 'DATEDIFF': <function MySQLParser.<lambda>>, 'DATE_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateDiff'>>, '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_SUB': <function build_date_delta_with_interval.<locals>._builder>, 'DATE_TO_DATE_STR': <function Parser.<lambda>>, 'DATE_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateToDi'>>, 'DATE_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DateTrunc'>>, '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': <function MySQLParser.<lambda>>, 'DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfMonth'>>, 'DAYOFMONTH': <function MySQLParser.<lambda>>, 'DAY_OF_WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.DayOfWeek'>>, 'DAYOFWEEK': <function MySQLParser.<lambda>>, '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': <function MySQLParser.<lambda>>, 'DAYNAME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.Dayname'>>, 'DECODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Decode'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.Encode'>>, '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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.NumberToStr'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.array.GenerateSeries'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.Getbit'>>, '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': <function MySQLParser.<lambda>>, '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.array.List'>>, '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': <function MySQLParser.<lambda>>, 'MONTHNAME': <function MySQLParser.<lambda>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpExtract'>>, 'REGEXP_EXTRACT_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpExtractAll'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.string.RegexpReplace'>>, '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_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'>>, '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.StddevPop'>>, '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': <function _str_to_date>, '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.array.StringToArray'>>, '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': <function build_date_delta.<locals>._builder>, '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': <function MySQLParser.<lambda>>, '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': <function Parser.<lambda>>, '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.VariancePop'>>, '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': <function MySQLParser.<lambda>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.WeekOfYear'>>, 'WEEKOFYEAR': <function MySQLParser.<lambda>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.core.Xor'>>, 'YEAR': <function MySQLParser.<lambda>>, '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>>, 'GLOB': <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>, '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'>>, 'BIT_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.math.BitwiseCount'>>, 'CONVERT_TZ': <function MySQLParser.<lambda>>, 'CURDATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentDate'>>, 'CURTIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.CurrentTime'>>, 'DATE_FORMAT': <function MySQLParser.<lambda>>, 'FROM_UNIXTIME': <function build_formatted_time.<locals>._builder>, 'ISNULL': <function isnull_to_is_null>, 'MAKETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.temporal.TimeFromParts'>>, 'SCHEMA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSchema'>>, 'DATABASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentSchema'>>, 'STD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.aggregate.StddevPop'>>, 'TIMESTAMPADD': <function _build_timestampadd>, 'VERSION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.functions.CurrentVersion'>>}
FUNCTION_PARSERS = {'ARG_MAX': <function Parser.<dictcomp>.<lambda>>, 'ARGMAX': <function Parser.<dictcomp>.<lambda>>, 'MAX_BY': <function Parser.<dictcomp>.<lambda>>, 'ARG_MIN': <function Parser.<dictcomp>.<lambda>>, 'ARGMIN': <function Parser.<dictcomp>.<lambda>>, 'MIN_BY': <function Parser.<dictcomp>.<lambda>>, 'CAST': <function Parser.<lambda>>, 'CEIL': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'CHAR': <function Parser.<lambda>>, 'CHR': <function Parser.<lambda>>, 'DECODE': <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 MySQLParser.<lambda>>, 'VALUES': <function MySQLParser.<lambda>>, 'JSON_VALUE': <function MySQLParser.<lambda>>, 'SUBSTR': <function MySQLParser.<lambda>>}
STATEMENT_PARSERS = {<TokenType.ALTER: 221>: <function Parser.<lambda>>, <TokenType.ANALYZE: 444>: <function Parser.<lambda>>, <TokenType.BEGIN: 231>: <function Parser.<lambda>>, <TokenType.CACHE: 234>: <function Parser.<lambda>>, <TokenType.COMMENT: 240>: <function Parser.<lambda>>, <TokenType.COMMIT: 241>: <function Parser.<lambda>>, <TokenType.COPY: 245>: <function Parser.<lambda>>, <TokenType.CREATE: 246>: <function Parser.<lambda>>, <TokenType.DECLARE: 258>: <function Parser.<lambda>>, <TokenType.DELETE: 260>: <function Parser.<lambda>>, <TokenType.DESC: 261>: <function Parser.<lambda>>, <TokenType.DESCRIBE: 262>: <function Parser.<lambda>>, <TokenType.DROP: 269>: <function Parser.<lambda>>, <TokenType.GRANT: 293>: <function Parser.<lambda>>, <TokenType.REVOKE: 382>: <function Parser.<lambda>>, <TokenType.INSERT: 304>: <function Parser.<lambda>>, <TokenType.KILL: 318>: <function Parser.<lambda>>, <TokenType.LOAD: 325>: <function Parser.<lambda>>, <TokenType.MERGE: 332>: <function Parser.<lambda>>, <TokenType.PIVOT: 360>: <function Parser.<lambda>>, <TokenType.PRAGMA: 365>: <function Parser.<lambda>>, <TokenType.REFRESH: 378>: <function Parser.<lambda>>, <TokenType.ROLLBACK: 387>: <function Parser.<lambda>>, <TokenType.SET: 397>: <function Parser.<lambda>>, <TokenType.TRUNCATE: 416>: <function Parser.<lambda>>, <TokenType.UNCACHE: 419>: <function Parser.<lambda>>, <TokenType.UNPIVOT: 423>: <function Parser.<lambda>>, <TokenType.UPDATE: 424>: <function Parser.<lambda>>, <TokenType.USE: 425>: <function Parser.<lambda>>, <TokenType.SEMICOLON: 19>: <function Parser.<lambda>>, <TokenType.SHOW: 399>: <function MySQLParser.<lambda>>}
SHOW_PARSERS = {'BINARY LOGS': <function _show_parser.<locals>._parse>, 'MASTER LOGS': <function _show_parser.<locals>._parse>, 'BINLOG EVENTS': <function _show_parser.<locals>._parse>, 'CHARACTER SET': <function _show_parser.<locals>._parse>, 'CHARSET': <function _show_parser.<locals>._parse>, 'COLLATION': <function _show_parser.<locals>._parse>, 'FULL COLUMNS': <function _show_parser.<locals>._parse>, 'COLUMNS': <function _show_parser.<locals>._parse>, 'CREATE DATABASE': <function _show_parser.<locals>._parse>, 'CREATE EVENT': <function _show_parser.<locals>._parse>, 'CREATE FUNCTION': <function _show_parser.<locals>._parse>, 'CREATE PROCEDURE': <function _show_parser.<locals>._parse>, 'CREATE TABLE': <function _show_parser.<locals>._parse>, 'CREATE TRIGGER': <function _show_parser.<locals>._parse>, 'CREATE VIEW': <function _show_parser.<locals>._parse>, 'DATABASES': <function _show_parser.<locals>._parse>, 'SCHEMAS': <function _show_parser.<locals>._parse>, 'ENGINE': <function _show_parser.<locals>._parse>, 'STORAGE ENGINES': <function _show_parser.<locals>._parse>, 'ENGINES': <function _show_parser.<locals>._parse>, 'ERRORS': <function _show_parser.<locals>._parse>, 'EVENTS': <function _show_parser.<locals>._parse>, 'FUNCTION CODE': <function _show_parser.<locals>._parse>, 'FUNCTION STATUS': <function _show_parser.<locals>._parse>, 'GRANTS': <function _show_parser.<locals>._parse>, 'INDEX': <function _show_parser.<locals>._parse>, 'MASTER STATUS': <function _show_parser.<locals>._parse>, 'OPEN TABLES': <function _show_parser.<locals>._parse>, 'PLUGINS': <function _show_parser.<locals>._parse>, 'PROCEDURE CODE': <function _show_parser.<locals>._parse>, 'PROCEDURE STATUS': <function _show_parser.<locals>._parse>, 'PRIVILEGES': <function _show_parser.<locals>._parse>, 'FULL PROCESSLIST': <function _show_parser.<locals>._parse>, 'PROCESSLIST': <function _show_parser.<locals>._parse>, 'PROFILE': <function _show_parser.<locals>._parse>, 'PROFILES': <function _show_parser.<locals>._parse>, 'RELAYLOG EVENTS': <function _show_parser.<locals>._parse>, 'REPLICAS': <function _show_parser.<locals>._parse>, 'SLAVE HOSTS': <function _show_parser.<locals>._parse>, 'REPLICA STATUS': <function _show_parser.<locals>._parse>, 'SLAVE STATUS': <function _show_parser.<locals>._parse>, 'GLOBAL STATUS': <function _show_parser.<locals>._parse>, 'SESSION STATUS': <function _show_parser.<locals>._parse>, 'STATUS': <function _show_parser.<locals>._parse>, 'TABLE STATUS': <function _show_parser.<locals>._parse>, 'FULL TABLES': <function _show_parser.<locals>._parse>, 'TABLES': <function _show_parser.<locals>._parse>, 'TRIGGERS': <function _show_parser.<locals>._parse>, 'GLOBAL VARIABLES': <function _show_parser.<locals>._parse>, 'SESSION VARIABLES': <function _show_parser.<locals>._parse>, 'VARIABLES': <function _show_parser.<locals>._parse>, 'WARNINGS': <function _show_parser.<locals>._parse>}
PROPERTY_PARSERS = {'ALLOWED_VALUES': <function Parser.<lambda>>, 'ALGORITHM': <function Parser.<lambda>>, 'AUTO': <function Parser.<lambda>>, 'AUTO_INCREMENT': <function Parser.<lambda>>, 'BACKUP': <function Parser.<lambda>>, 'BLOCKCOMPRESSION': <function Parser.<lambda>>, 'CALLED': <function Parser.<lambda>>, 'CHARSET': <function Parser.<lambda>>, 'CHECKSUM': <function Parser.<lambda>>, 'CLUSTER BY': <function Parser.<lambda>>, 'CLUSTERED': <function Parser.<lambda>>, 'COLLATE': <function Parser.<lambda>>, 'COMMENT': <function Parser.<lambda>>, 'CONTAINS': <function Parser.<lambda>>, 'COPY': <function Parser.<lambda>>, 'DATABLOCKSIZE': <function Parser.<lambda>>, 'DATA_DELETION': <function Parser.<lambda>>, 'DEFINER': <function Parser.<lambda>>, 'DETERMINISTIC': <function Parser.<lambda>>, 'DISTRIBUTED': <function Parser.<lambda>>, 'DUPLICATE': <function Parser.<lambda>>, 'DYNAMIC': <function Parser.<lambda>>, 'DISTKEY': <function Parser.<lambda>>, 'DISTSTYLE': <function Parser.<lambda>>, 'EMPTY': <function Parser.<lambda>>, 'ENGINE': <function Parser.<lambda>>, 'ENVIRONMENT': <function Parser.<lambda>>, 'HANDLER': <function Parser.<lambda>>, 'EXECUTE': <function Parser.<lambda>>, 'EXTERNAL': <function Parser.<lambda>>, 'FALLBACK': <function Parser.<lambda>>, 'FORMAT': <function Parser.<lambda>>, 'FREESPACE': <function Parser.<lambda>>, 'GLOBAL': <function Parser.<lambda>>, 'HEAP': <function Parser.<lambda>>, 'ICEBERG': <function Parser.<lambda>>, 'IMMUTABLE': <function Parser.<lambda>>, 'INHERITS': <function Parser.<lambda>>, 'INPUT': <function Parser.<lambda>>, 'JOURNAL': <function Parser.<lambda>>, 'LANGUAGE': <function Parser.<lambda>>, 'LAYOUT': <function Parser.<lambda>>, 'LIFETIME': <function Parser.<lambda>>, 'LIKE': <function Parser.<lambda>>, 'LOCATION': <function Parser.<lambda>>, 'LOCK': <function MySQLParser.<lambda>>, 'LOCKING': <function Parser.<lambda>>, 'LOG': <function Parser.<lambda>>, 'MATERIALIZED': <function Parser.<lambda>>, 'MERGEBLOCKRATIO': <function Parser.<lambda>>, 'MODIFIES': <function Parser.<lambda>>, 'MULTISET': <function Parser.<lambda>>, 'NO': <function Parser.<lambda>>, 'ON': <function Parser.<lambda>>, 'ORDER BY': <function Parser.<lambda>>, 'OUTPUT': <function Parser.<lambda>>, 'PARTITION': <function Parser.<lambda>>, 'PARTITION BY': <function MySQLParser.<lambda>>, 'PARTITIONED BY': <function Parser.<lambda>>, 'PARTITIONED_BY': <function Parser.<lambda>>, 'PRIMARY KEY': <function Parser.<lambda>>, 'RANGE': <function Parser.<lambda>>, 'READS': <function Parser.<lambda>>, 'REMOTE': <function Parser.<lambda>>, 'RETURNS': <function Parser.<lambda>>, 'STRICT': <function Parser.<lambda>>, 'STREAMING': <function Parser.<lambda>>, 'ROW': <function Parser.<lambda>>, 'ROW_FORMAT': <function Parser.<lambda>>, 'SAMPLE': <function Parser.<lambda>>, 'SECURE': <function Parser.<lambda>>, 'SECURITY': <function Parser.<lambda>>, 'SQL SECURITY': <function Parser.<lambda>>, 'SET': <function Parser.<lambda>>, 'SETTINGS': <function Parser.<lambda>>, 'SHARING': <function Parser.<lambda>>, 'SORTKEY': <function Parser.<lambda>>, 'SOURCE': <function Parser.<lambda>>, 'STABLE': <function Parser.<lambda>>, 'STORED': <function Parser.<lambda>>, 'SYSTEM_VERSIONING': <function Parser.<lambda>>, 'TBLPROPERTIES': <function Parser.<lambda>>, 'TEMP': <function Parser.<lambda>>, 'TEMPORARY': <function Parser.<lambda>>, 'TO': <function Parser.<lambda>>, 'TRANSIENT': <function Parser.<lambda>>, 'TRANSFORM': <function Parser.<lambda>>, 'TTL': <function Parser.<lambda>>, 'USING': <function Parser.<lambda>>, 'UNLOGGED': <function Parser.<lambda>>, 'VOLATILE': <function Parser.<lambda>>, 'WITH': <function Parser.<lambda>>}
SET_PARSERS = {'GLOBAL': <function Parser.<lambda>>, 'LOCAL': <function Parser.<lambda>>, 'SESSION': <function Parser.<lambda>>, 'TRANSACTION': <function Parser.<lambda>>, 'PERSIST': <function MySQLParser.<lambda>>, 'PERSIST_ONLY': <function MySQLParser.<lambda>>, 'CHARACTER SET': <function MySQLParser.<lambda>>, 'CHARSET': <function MySQLParser.<lambda>>, 'NAMES': <function MySQLParser.<lambda>>}
SHOW_TRIE = {'BINARY': {'LOGS': {0: True}}, 'MASTER': {'LOGS': {0: True}, 'STATUS': {0: True}}, 'BINLOG': {'EVENTS': {0: True}}, 'CHARACTER': {'SET': {0: True}}, 'CHARSET': {0: True}, 'COLLATION': {0: True}, 'FULL': {'COLUMNS': {0: True}, 'PROCESSLIST': {0: True}, 'TABLES': {0: True}}, 'COLUMNS': {0: True}, 'CREATE': {'DATABASE': {0: True}, 'EVENT': {0: True}, 'FUNCTION': {0: True}, 'PROCEDURE': {0: True}, 'TABLE': {0: True}, 'TRIGGER': {0: True}, 'VIEW': {0: True}}, 'DATABASES': {0: True}, 'SCHEMAS': {0: True}, 'ENGINE': {0: True}, 'STORAGE': {'ENGINES': {0: True}}, 'ENGINES': {0: True}, 'ERRORS': {0: True}, 'EVENTS': {0: True}, 'FUNCTION': {'CODE': {0: True}, 'STATUS': {0: True}}, 'GRANTS': {0: True}, 'INDEX': {0: True}, 'OPEN': {'TABLES': {0: True}}, 'PLUGINS': {0: True}, 'PROCEDURE': {'CODE': {0: True}, 'STATUS': {0: True}}, 'PRIVILEGES': {0: True}, 'PROCESSLIST': {0: True}, 'PROFILE': {0: True}, 'PROFILES': {0: True}, 'RELAYLOG': {'EVENTS': {0: True}}, 'REPLICAS': {0: True}, 'SLAVE': {'HOSTS': {0: True}, 'STATUS': {0: True}}, 'REPLICA': {'STATUS': {0: True}}, 'GLOBAL': {'STATUS': {0: True}, 'VARIABLES': {0: True}}, 'SESSION': {'STATUS': {0: True}, 'VARIABLES': {0: True}}, 'STATUS': {0: True}, 'TABLE': {'STATUS': {0: True}}, 'TABLES': {0: True}, 'TRIGGERS': {0: True}, 'VARIABLES': {0: True}, 'WARNINGS': {0: True}}
SET_TRIE = {'GLOBAL': {0: True}, 'LOCAL': {0: True}, 'SESSION': {0: True}, 'TRANSACTION': {0: True}, 'PERSIST': {0: True}, 'PERSIST_ONLY': {0: True}, 'CHARACTER': {'SET': {0: True}}, 'CHARSET': {0: True}, 'NAMES': {0: True}}
CONSTRAINT_PARSERS = {'AUTOINCREMENT': <function Parser.<lambda>>, 'AUTO_INCREMENT': <function Parser.<lambda>>, 'CASESPECIFIC': <function Parser.<lambda>>, 'CHECK': <function Parser.<lambda>>, 'COLLATE': <function Parser.<lambda>>, 'COMMENT': <function Parser.<lambda>>, 'COMPRESS': <function Parser.<lambda>>, 'CLUSTERED': <function Parser.<lambda>>, 'NONCLUSTERED': <function Parser.<lambda>>, 'DEFAULT': <function Parser.<lambda>>, 'ENCODE': <function Parser.<lambda>>, 'EPHEMERAL': <function Parser.<lambda>>, 'EXCLUDE': <function Parser.<lambda>>, 'FOREIGN KEY': <function Parser.<lambda>>, 'FORMAT': <function Parser.<lambda>>, 'GENERATED': <function Parser.<lambda>>, 'IDENTITY': <function Parser.<lambda>>, 'INLINE': <function Parser.<lambda>>, 'LIKE': <function Parser.<lambda>>, 'NOT': <function Parser.<lambda>>, 'NULL': <function Parser.<lambda>>, 'ON': <function Parser.<lambda>>, 'PATH': <function Parser.<lambda>>, 'PERIOD': <function Parser.<lambda>>, 'PRIMARY KEY': <function Parser.<lambda>>, 'REFERENCES': <function Parser.<lambda>>, 'TITLE': <function Parser.<lambda>>, 'TTL': <function Parser.<lambda>>, 'UNIQUE': <function Parser.<lambda>>, 'UPPERCASE': <function Parser.<lambda>>, 'WITH': <function Parser.<lambda>>, 'BUCKET': <function Parser.<lambda>>, 'TRUNCATE': <function Parser.<lambda>>, 'BINARY': <function MySQLParser.<lambda>>, 'FULLTEXT': <function MySQLParser.<lambda>>, 'INDEX': <function MySQLParser.<lambda>>, 'KEY': <function MySQLParser.<lambda>>, 'SPATIAL': <function MySQLParser.<lambda>>, 'ZEROFILL': <function MySQLParser.<lambda>>, 'INVISIBLE': <function MySQLParser.<lambda>>, 'ASCII': <function MySQLParser.<lambda>>, 'UNICODE': <function MySQLParser.<lambda>>}
ALTER_PARSERS = {'ADD': <function Parser.<lambda>>, 'AS': <function Parser.<lambda>>, 'ALTER': <function Parser.<lambda>>, 'CLUSTER BY': <function Parser.<lambda>>, 'DELETE': <function Parser.<lambda>>, 'DROP': <function Parser.<lambda>>, 'RENAME': <function Parser.<lambda>>, 'SET': <function Parser.<lambda>>, 'SWAP': <function Parser.<lambda>>, 'CHANGE': <function MySQLParser.<lambda>>, 'MODIFY': <function MySQLParser.<lambda>>, 'FORCE': <function MySQLParser.<lambda>>}
ALTER_ALTER_PARSERS = {'DISTKEY': <function Parser.<lambda>>, 'DISTSTYLE': <function Parser.<lambda>>, 'SORTKEY': <function Parser.<lambda>>, 'COMPOUND': <function Parser.<lambda>>, 'INDEX': <function MySQLParser.<lambda>>}
ADD_CONSTRAINT_KEYWORDS = {'SPATIAL', 'FULLTEXT'}
RESERVED_CONSTRAINT_KINDS = {'CHECK', 'FOREIGN KEY', 'PRIMARY KEY', 'UNIQUE'}
SCHEMA_UNNAMED_CONSTRAINTS = {'FOREIGN KEY', 'UNIQUE', 'CHECK', 'PRIMARY KEY', 'EXCLUDE', 'SPATIAL', 'PERIOD', 'BUCKET', 'LIKE', 'TRUNCATE', 'INDEX', 'KEY', 'FULLTEXT'}
PROFILE_TYPES: ClassVar[dict[str, Sequence[Union[Sequence[str], str]]]] = {'ALL': (), 'CPU': (), 'IPC': (), 'MEMORY': (), 'SOURCE': (), 'SWAPS': (), 'BLOCK': ('IO',), 'CONTEXT': ('SWITCHES',), 'PAGE': ('FAULTS',)}
TYPE_TOKENS = {<TokenType.BIT: 98>, <TokenType.BOOLEAN: 99>, <TokenType.TINYINT: 100>, <TokenType.UTINYINT: 101>, <TokenType.SMALLINT: 102>, <TokenType.USMALLINT: 103>, <TokenType.MEDIUMINT: 104>, <TokenType.UMEDIUMINT: 105>, <TokenType.INT: 106>, <TokenType.UINT: 107>, <TokenType.BIGINT: 108>, <TokenType.UBIGINT: 109>, <TokenType.BIGNUM: 110>, <TokenType.INT128: 111>, <TokenType.UINT128: 112>, <TokenType.INT256: 113>, <TokenType.UINT256: 114>, <TokenType.FLOAT: 115>, <TokenType.DOUBLE: 116>, <TokenType.UDOUBLE: 117>, <TokenType.DECIMAL: 118>, <TokenType.DECIMAL32: 119>, <TokenType.DECIMAL64: 120>, <TokenType.DECIMAL128: 121>, <TokenType.DECIMAL256: 122>, <TokenType.DECFLOAT: 123>, <TokenType.UDECIMAL: 124>, <TokenType.BIGDECIMAL: 125>, <TokenType.CHAR: 126>, <TokenType.NCHAR: 127>, <TokenType.VARCHAR: 128>, <TokenType.NVARCHAR: 129>, <TokenType.BPCHAR: 130>, <TokenType.TEXT: 131>, <TokenType.MEDIUMTEXT: 132>, <TokenType.LONGTEXT: 133>, <TokenType.BLOB: 134>, <TokenType.MEDIUMBLOB: 135>, <TokenType.LONGBLOB: 136>, <TokenType.TINYBLOB: 137>, <TokenType.TINYTEXT: 138>, <TokenType.NAME: 139>, <TokenType.BINARY: 140>, <TokenType.VARBINARY: 141>, <TokenType.JSON: 142>, <TokenType.JSONB: 143>, <TokenType.TIME: 144>, <TokenType.TIMETZ: 145>, <TokenType.TIME_NS: 146>, <TokenType.TIMESTAMP: 147>, <TokenType.TIMESTAMPTZ: 148>, <TokenType.TIMESTAMPLTZ: 149>, <TokenType.TIMESTAMPNTZ: 150>, <TokenType.TIMESTAMP_S: 151>, <TokenType.TIMESTAMP_MS: 152>, <TokenType.TIMESTAMP_NS: 153>, <TokenType.DATETIME: 154>, <TokenType.DATETIME2: 155>, <TokenType.DATETIME64: 156>, <TokenType.SMALLDATETIME: 157>, <TokenType.DATE: 158>, <TokenType.DATE32: 159>, <TokenType.INT4RANGE: 160>, <TokenType.INT4MULTIRANGE: 161>, <TokenType.INT8RANGE: 162>, <TokenType.INT8MULTIRANGE: 163>, <TokenType.NUMRANGE: 164>, <TokenType.NUMMULTIRANGE: 165>, <TokenType.TSRANGE: 166>, <TokenType.TSMULTIRANGE: 167>, <TokenType.TSTZRANGE: 168>, <TokenType.TSTZMULTIRANGE: 169>, <TokenType.DATERANGE: 170>, <TokenType.DATEMULTIRANGE: 171>, <TokenType.UUID: 172>, <TokenType.GEOGRAPHY: 173>, <TokenType.GEOGRAPHYPOINT: 174>, <TokenType.NULLABLE: 175>, <TokenType.GEOMETRY: 176>, <TokenType.POINT: 177>, <TokenType.RING: 178>, <TokenType.LINESTRING: 179>, <TokenType.MULTILINESTRING: 183>, <TokenType.POLYGON: 184>, <TokenType.MULTIPOLYGON: 185>, <TokenType.HLLSKETCH: 186>, <TokenType.HSTORE: 187>, <TokenType.SUPER: 188>, <TokenType.SERIAL: 189>, <TokenType.SMALLSERIAL: 190>, <TokenType.BIGSERIAL: 191>, <TokenType.XML: 192>, <TokenType.YEAR: 193>, <TokenType.USERDEFINED: 194>, <TokenType.MONEY: 195>, <TokenType.SMALLMONEY: 196>, <TokenType.ROWVERSION: 197>, <TokenType.IMAGE: 198>, <TokenType.VARIANT: 199>, <TokenType.OBJECT: 200>, <TokenType.REF: 201>, <TokenType.INET: 202>, <TokenType.IPADDRESS: 203>, <TokenType.IPPREFIX: 204>, <TokenType.IPV4: 205>, <TokenType.IPV6: 206>, <TokenType.ENUM: 207>, <TokenType.ENUM8: 208>, <TokenType.ENUM16: 209>, <TokenType.FIXEDSTRING: 210>, <TokenType.LOWCARDINALITY: 211>, <TokenType.NESTED: 212>, <TokenType.AGGREGATEFUNCTION: 213>, <TokenType.SIMPLEAGGREGATEFUNCTION: 214>, <TokenType.TDIGEST: 215>, <TokenType.UNKNOWN: 216>, <TokenType.VECTOR: 217>, <TokenType.DYNAMIC: 218>, <TokenType.VOID: 219>, <TokenType.ARRAY: 226>, <TokenType.INTERVAL: 308>, <TokenType.LIST: 324>, <TokenType.MAP: 327>, <TokenType.NOTHING: 337>, <TokenType.NULL: 339>, <TokenType.OBJECT_IDENTIFIER: 340>, <TokenType.PSEUDO_TYPE: 371>, <TokenType.RANGE: 376>, <TokenType.SET: 397>, <TokenType.STRUCT: 408>, <TokenType.UNION: 421>}
ENUM_TYPE_TOKENS = {<TokenType.SET: 397>, <TokenType.ENUM: 207>, <TokenType.ENUM8: 208>, <TokenType.ENUM16: 209>, <TokenType.DYNAMIC: 218>}
OPERATION_MODIFIERS = {'SQL_BUFFER_RESULT', 'SQL_CALC_FOUND_ROWS', 'SQL_NO_CACHE', 'HIGH_PRIORITY', 'SQL_SMALL_RESULT', 'SQL_BIG_RESULT', 'STRAIGHT_JOIN'}
ALTER_DROP_REQUIRES_COLUMN = False
ALTER_TABLE_MIXED_ACTIONS = True
ALTER_TABLE_REQUIRES_ACTION = False
LOG_DEFAULTS_TO_LN = True
STRING_ALIASES = True
VALUES_FOLLOWED_BY_PAREN = False
SUPPORTS_PARTITION_SELECTION = True
Inherited Members
sqlglot.parser.Parser
Parser
STRUCT_TYPE_TOKENS
NESTED_TYPE_TOKENS
AGGREGATE_TYPE_TOKENS
SIGNED_TO_UNSIGNED_TYPE_TOKEN
SUBQUERY_PREDICATES
SUBQUERY_TOKENS
RESERVED_TOKENS
TEXT_MATCH_EXCLUDED_TOKENS
DB_CREATABLES
CREATABLES
TRIGGER_EVENTS
ALTERABLES
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
ASSIGNMENT
EQUALITY
COMPARISON
BITWISE
TERM
FACTOR
TIMES
TIMESTAMPS
SET_OPERATIONS
JOIN_METHODS
JOIN_SIDES
JOIN_KINDS
JOIN_HINTS
SUPPORTS_DIRECTED_JOIN
TABLE_TERMINATORS
LAMBDAS
TYPED_LAMBDA_ARGS
LAMBDA_ARG_TERMINATORS
COLUMN_OPERATORS
JSON_OPERATORS
CAST_COLUMN_OPERATORS
EXPRESSION_PARSERS
STRING_PARSERS
NUMERIC_PARSERS
PRIMARY_PARSERS
PLACEHOLDER_PARSERS
PIPE_SYNTAX_TRANSFORM_PARSERS
NO_PAREN_FUNCTION_PARSERS
INVALID_FUNC_NAME_TOKENS
FUNCTIONS_WITH_ALIASED_ARGS
KEY_VALUE_DEFINITIONS
QUERY_MODIFIER_PARSERS
QUERY_MODIFIER_TOKENS
TYPE_LITERAL_PARSERS
TYPE_CONVERTERS
DDL_SELECT_TOKENS
PRE_VOLATILE_TOKENS
TRANSACTION_KIND
TRANSACTION_CHARACTERISTICS
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
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
RECURSIVE_CTE_SEARCH_KIND
SECURITY_PROPERTY_KEYWORDS
MODIFIABLES
STRICT_CAST
PREFIXED_PIVOT_COLUMNS
IDENTIFY_PIVOT_STRINGS
UNPIVOT_VALUE_COLUMNS_FIRST
PIVOT_COLUMN_NAMING
TABLESAMPLE_CSV
DEFAULT_SAMPLING_METHOD
SET_REQUIRES_ASSIGNMENT_DELIMITER
TRIM_PATTERN_FIRST
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
SUPPORTS_IMPLICIT_UNNEST
SUPPORTS_DIGIT_PREFIXED_FIELD_NAMES
INTERVAL_SPANS
WRAPPED_TRANSFORM_COLUMN_CONSTRAINT
OPTIONAL_ALIAS_TOKEN_CTE
ALTER_RENAME_REQUIRES_COLUMN
ALTER_TABLE_PARTITIONS
ALTER_COLUMN_TYPE_REQUIRES_KEYWORD
JOINS_HAVE_EQUAL_PRECEDENCE
ZONE_AWARE_TIMESTAMP_CONSTRUCTOR
MAP_KEYS_ARE_ARBITRARY_EXPRESSIONS
JSON_EXTRACT_REQUIRES_JSON_EXPRESSION
ADD_JOIN_ON_TRUE
SUPPORTS_OMITTED_INTERVAL_SPAN_UNIT
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