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