sqlglot.dialects.singlestore
1from sqlglot import TokenType 2import typing as t 3 4from sqlglot import exp 5from sqlglot.dialects.dialect import build_formatted_time 6from sqlglot.dialects.mysql import MySQL 7from sqlglot.helper import seq_get 8 9 10class SingleStore(MySQL): 11 SUPPORTS_ORDER_BY_ALL = True 12 13 TIME_MAPPING: t.Dict[str, str] = { 14 "D": "%u", # Day of week (1-7) 15 "DD": "%d", # day of month (01-31) 16 "DY": "%a", # abbreviated name of day 17 "HH": "%I", # Hour of day (01-12) 18 "HH12": "%I", # alias for HH 19 "HH24": "%H", # Hour of day (00-23) 20 "MI": "%M", # Minute (00-59) 21 "MM": "%m", # Month (01-12; January = 01) 22 "MON": "%b", # Abbreviated name of month 23 "MONTH": "%B", # Name of month 24 "SS": "%S", # Second (00-59) 25 "RR": "%y", # 15 26 "YY": "%y", # 15 27 "YYYY": "%Y", # 2015 28 "FF6": "%f", # only 6 digits are supported in python formats 29 } 30 31 class Tokenizer(MySQL.Tokenizer): 32 BYTE_STRINGS = [("e'", "'"), ("E'", "'")] 33 34 KEYWORDS = { 35 **MySQL.Tokenizer.KEYWORDS, 36 "BSON": TokenType.JSONB, 37 "GEOGRAPHYPOINT": TokenType.GEOGRAPHYPOINT, 38 ":>": TokenType.COLON_GT, 39 "!:>": TokenType.NCOLON_GT, 40 "::$": TokenType.DCOLONDOLLAR, 41 "::%": TokenType.DCOLONPERCENT, 42 } 43 44 class Parser(MySQL.Parser): 45 FUNCTIONS = { 46 **MySQL.Parser.FUNCTIONS, 47 "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "singlestore"), 48 "TO_TIMESTAMP": build_formatted_time(exp.StrToTime, "singlestore"), 49 "TO_CHAR": build_formatted_time(exp.ToChar, "singlestore"), 50 "STR_TO_DATE": build_formatted_time(exp.StrToDate, "mysql"), 51 "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "mysql"), 52 "TIME_FORMAT": lambda args: exp.TimeToStr( 53 # The first argument is converted to TIME(6) 54 # This is needed because exp.TimeToStr is converted to DATE_FORMAT 55 # which interprets the first argument as DATETIME and fails to parse 56 # string literals like '12:05:47' without a date part. 57 this=exp.Cast( 58 this=seq_get(args, 0), 59 to=exp.DataType.build( 60 exp.DataType.Type.TIME, 61 expressions=[exp.DataTypeParam(this=exp.Literal.number(6))], 62 ), 63 ), 64 format=MySQL.format_time(seq_get(args, 1)), 65 ), 66 } 67 68 class Generator(MySQL.Generator): 69 TRANSFORMS = { 70 **MySQL.Generator.TRANSFORMS, 71 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 72 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 73 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 74 exp.StrToDate: lambda self, e: self.func( 75 "STR_TO_DATE", 76 e.this, 77 self.format_time( 78 e, 79 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 80 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 81 ), 82 ), 83 exp.TimeToStr: lambda self, e: self.func( 84 "DATE_FORMAT", 85 e.this, 86 self.format_time( 87 e, 88 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 89 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 90 ), 91 ), 92 } 93 94 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 95 RESERVED_KEYWORDS = { 96 "abs", 97 "absolute", 98 "access", 99 "account", 100 "acos", 101 "action", 102 "add", 103 "adddate", 104 "addtime", 105 "admin", 106 "aes_decrypt", 107 "aes_encrypt", 108 "after", 109 "against", 110 "aggregate", 111 "aggregates", 112 "aggregator", 113 "aggregator_id", 114 "aggregator_plan_hash", 115 "aggregators", 116 "algorithm", 117 "all", 118 "also", 119 "alter", 120 "always", 121 "analyse", 122 "analyze", 123 "and", 124 "anti_join", 125 "any", 126 "any_value", 127 "approx_count_distinct", 128 "approx_count_distinct_accumulate", 129 "approx_count_distinct_combine", 130 "approx_count_distinct_estimate", 131 "approx_geography_intersects", 132 "approx_percentile", 133 "arghistory", 134 "arrange", 135 "arrangement", 136 "array", 137 "as", 138 "asc", 139 "ascii", 140 "asensitive", 141 "asin", 142 "asm", 143 "assertion", 144 "assignment", 145 "ast", 146 "asymmetric", 147 "async", 148 "at", 149 "atan", 150 "atan2", 151 "attach", 152 "attribute", 153 "authorization", 154 "auto", 155 "auto_increment", 156 "auto_reprovision", 157 "autostats", 158 "autostats_cardinality_mode", 159 "autostats_enabled", 160 "autostats_histogram_mode", 161 "autostats_sampling", 162 "availability", 163 "avg", 164 "avg_row_length", 165 "avro", 166 "azure", 167 "background", 168 "_background_threads_for_cleanup", 169 "backup", 170 "backup_history", 171 "backup_id", 172 "backward", 173 "batch", 174 "batches", 175 "batch_interval", 176 "_batch_size_limit", 177 "before", 178 "begin", 179 "between", 180 "bigint", 181 "bin", 182 "binary", 183 "_binary", 184 "bit", 185 "bit_and", 186 "bit_count", 187 "bit_or", 188 "bit_xor", 189 "blob", 190 "bool", 191 "boolean", 192 "bootstrap", 193 "both", 194 "_bt", 195 "btree", 196 "bucket_count", 197 "by", 198 "byte", 199 "byte_length", 200 "cache", 201 "call", 202 "call_for_pipeline", 203 "called", 204 "capture", 205 "cascade", 206 "cascaded", 207 "case", 208 "cast", 209 "catalog", 210 "ceil", 211 "ceiling", 212 "chain", 213 "change", 214 "char", 215 "character", 216 "characteristics", 217 "character_length", 218 "char_length", 219 "charset", 220 "check", 221 "checkpoint", 222 "_check_can_connect", 223 "_check_consistency", 224 "checksum", 225 "_checksum", 226 "class", 227 "clear", 228 "client", 229 "client_found_rows", 230 "close", 231 "cluster", 232 "clustered", 233 "cnf", 234 "coalesce", 235 "coercibility", 236 "collate", 237 "collation", 238 "collect", 239 "column", 240 "columnar", 241 "columns", 242 "columnstore", 243 "columnstore_segment_rows", 244 "comment", 245 "comments", 246 "commit", 247 "committed", 248 "_commit_log_tail", 249 "committed", 250 "compact", 251 "compile", 252 "compressed", 253 "compression", 254 "concat", 255 "concat_ws", 256 "concurrent", 257 "concurrently", 258 "condition", 259 "configuration", 260 "connection", 261 "connection_id", 262 "connections", 263 "config", 264 "constraint", 265 "constraints", 266 "content", 267 "continue", 268 "_continue_replay", 269 "conv", 270 "conversion", 271 "convert", 272 "convert_tz", 273 "copy", 274 "_core", 275 "cos", 276 "cost", 277 "cot", 278 "count", 279 "create", 280 "credentials", 281 "cross", 282 "cube", 283 "csv", 284 "cume_dist", 285 "curdate", 286 "current", 287 "current_catalog", 288 "current_date", 289 "current_role", 290 "current_schema", 291 "current_security_groups", 292 "current_security_roles", 293 "current_time", 294 "current_timestamp", 295 "current_user", 296 "cursor", 297 "curtime", 298 "cycle", 299 "data", 300 "database", 301 "databases", 302 "date", 303 "date_add", 304 "datediff", 305 "date_format", 306 "date_sub", 307 "date_trunc", 308 "datetime", 309 "day", 310 "day_hour", 311 "day_microsecond", 312 "day_minute", 313 "dayname", 314 "dayofmonth", 315 "dayofweek", 316 "dayofyear", 317 "day_second", 318 "deallocate", 319 "dec", 320 "decimal", 321 "declare", 322 "decode", 323 "default", 324 "defaults", 325 "deferrable", 326 "deferred", 327 "defined", 328 "definer", 329 "degrees", 330 "delayed", 331 "delay_key_write", 332 "delete", 333 "delimiter", 334 "delimiters", 335 "dense_rank", 336 "desc", 337 "describe", 338 "detach", 339 "deterministic", 340 "dictionary", 341 "differential", 342 "directory", 343 "disable", 344 "discard", 345 "_disconnect", 346 "disk", 347 "distinct", 348 "distinctrow", 349 "distributed_joins", 350 "div", 351 "do", 352 "document", 353 "domain", 354 "dot_product", 355 "double", 356 "drop", 357 "_drop_profile", 358 "dual", 359 "dump", 360 "duplicate", 361 "dynamic", 362 "earliest", 363 "each", 364 "echo", 365 "election", 366 "else", 367 "elseif", 368 "elt", 369 "enable", 370 "enclosed", 371 "encoding", 372 "encrypted", 373 "end", 374 "engine", 375 "engines", 376 "enum", 377 "errors", 378 "escape", 379 "escaped", 380 "estimate", 381 "euclidean_distance", 382 "event", 383 "events", 384 "except", 385 "exclude", 386 "excluding", 387 "exclusive", 388 "execute", 389 "exists", 390 "exit", 391 "exp", 392 "explain", 393 "extended", 394 "extension", 395 "external", 396 "external_host", 397 "external_port", 398 "extract", 399 "extractor", 400 "extractors", 401 "extra_join", 402 "_failover", 403 "failed_login_attempts", 404 "failure", 405 "false", 406 "family", 407 "fault", 408 "fetch", 409 "field", 410 "fields", 411 "file", 412 "files", 413 "fill", 414 "first", 415 "first_value", 416 "fix_alter", 417 "fixed", 418 "float", 419 "float4", 420 "float8", 421 "floor", 422 "flush", 423 "following", 424 "for", 425 "force", 426 "force_compiled_mode", 427 "force_interpreter_mode", 428 "foreground", 429 "foreign", 430 "format", 431 "forward", 432 "found_rows", 433 "freeze", 434 "from", 435 "from_base64", 436 "from_days", 437 "from_unixtime", 438 "fs", 439 "_fsync", 440 "full", 441 "fulltext", 442 "function", 443 "functions", 444 "gc", 445 "gcs", 446 "get_format", 447 "_gc", 448 "_gcx", 449 "generate", 450 "geography", 451 "geography_area", 452 "geography_contains", 453 "geography_distance", 454 "geography_intersects", 455 "geography_latitude", 456 "geography_length", 457 "geography_longitude", 458 "geographypoint", 459 "geography_point", 460 "geography_within_distance", 461 "geometry", 462 "geometry_area", 463 "geometry_contains", 464 "geometry_distance", 465 "geometry_filter", 466 "geometry_intersects", 467 "geometry_length", 468 "geometrypoint", 469 "geometry_point", 470 "geometry_within_distance", 471 "geometry_x", 472 "geometry_y", 473 "global", 474 "_global_version_timestamp", 475 "grant", 476 "granted", 477 "grants", 478 "greatest", 479 "group", 480 "grouping", 481 "groups", 482 "group_concat", 483 "gzip", 484 "handle", 485 "handler", 486 "hard_cpu_limit_percentage", 487 "hash", 488 "has_temp_tables", 489 "having", 490 "hdfs", 491 "header", 492 "heartbeat_no_logging", 493 "hex", 494 "highlight", 495 "high_priority", 496 "hold", 497 "holding", 498 "host", 499 "hosts", 500 "hour", 501 "hour_microsecond", 502 "hour_minute", 503 "hour_second", 504 "identified", 505 "identity", 506 "if", 507 "ifnull", 508 "ignore", 509 "ilike", 510 "immediate", 511 "immutable", 512 "implicit", 513 "import", 514 "in", 515 "including", 516 "increment", 517 "incremental", 518 "index", 519 "indexes", 520 "inet_aton", 521 "inet_ntoa", 522 "inet6_aton", 523 "inet6_ntoa", 524 "infile", 525 "inherit", 526 "inherits", 527 "_init_profile", 528 "init", 529 "initcap", 530 "initialize", 531 "initially", 532 "inject", 533 "inline", 534 "inner", 535 "inout", 536 "input", 537 "insensitive", 538 "insert", 539 "insert_method", 540 "instance", 541 "instead", 542 "instr", 543 "int", 544 "int1", 545 "int2", 546 "int3", 547 "int4", 548 "int8", 549 "integer", 550 "_internal_dynamic_typecast", 551 "interpreter_mode", 552 "intersect", 553 "interval", 554 "into", 555 "invoker", 556 "is", 557 "isnull", 558 "isolation", 559 "iterate", 560 "join", 561 "json", 562 "json_agg", 563 "json_array_contains_double", 564 "json_array_contains_json", 565 "json_array_contains_string", 566 "json_array_push_double", 567 "json_array_push_json", 568 "json_array_push_string", 569 "json_delete_key", 570 "json_extract_double", 571 "json_extract_json", 572 "json_extract_string", 573 "json_extract_bigint", 574 "json_get_type", 575 "json_length", 576 "json_set_double", 577 "json_set_json", 578 "json_set_string", 579 "json_splice_double", 580 "json_splice_json", 581 "json_splice_string", 582 "kafka", 583 "key", 584 "key_block_size", 585 "keys", 586 "kill", 587 "killall", 588 "label", 589 "lag", 590 "language", 591 "large", 592 "last", 593 "last_day", 594 "last_insert_id", 595 "last_value", 596 "lateral", 597 "latest", 598 "lc_collate", 599 "lc_ctype", 600 "lcase", 601 "lead", 602 "leading", 603 "leaf", 604 "leakproof", 605 "least", 606 "leave", 607 "leaves", 608 "left", 609 "length", 610 "level", 611 "license", 612 "like", 613 "limit", 614 "lines", 615 "listen", 616 "llvm", 617 "ln", 618 "load", 619 "loaddata_where", 620 "_load", 621 "local", 622 "localtime", 623 "localtimestamp", 624 "locate", 625 "location", 626 "lock", 627 "log", 628 "log10", 629 "log2", 630 "long", 631 "longblob", 632 "longtext", 633 "loop", 634 "lower", 635 "low_priority", 636 "lpad", 637 "_ls", 638 "ltrim", 639 "lz4", 640 "management", 641 "_management_thread", 642 "mapping", 643 "master", 644 "match", 645 "materialized", 646 "max", 647 "maxvalue", 648 "max_concurrency", 649 "max_errors", 650 "max_partitions_per_batch", 651 "max_queue_depth", 652 "max_retries_per_batch_partition", 653 "max_rows", 654 "mbc", 655 "md5", 656 "mpl", 657 "median", 658 "mediumblob", 659 "mediumint", 660 "mediumtext", 661 "member", 662 "memory", 663 "memory_percentage", 664 "_memsql_table_id_lookup", 665 "memsql", 666 "memsql_deserialize", 667 "memsql_imitating_kafka", 668 "memsql_serialize", 669 "merge", 670 "metadata", 671 "microsecond", 672 "middleint", 673 "min", 674 "min_rows", 675 "minus", 676 "minute", 677 "minute_microsecond", 678 "minute_second", 679 "minvalue", 680 "mod", 681 "mode", 682 "model", 683 "modifies", 684 "modify", 685 "month", 686 "monthname", 687 "months_between", 688 "move", 689 "mpl", 690 "names", 691 "named", 692 "namespace", 693 "national", 694 "natural", 695 "nchar", 696 "next", 697 "no", 698 "node", 699 "none", 700 "no_query_rewrite", 701 "noparam", 702 "not", 703 "nothing", 704 "notify", 705 "now", 706 "nowait", 707 "no_write_to_binlog", 708 "no_query_rewrite", 709 "norely", 710 "nth_value", 711 "ntile", 712 "null", 713 "nullcols", 714 "nullif", 715 "nulls", 716 "numeric", 717 "nvarchar", 718 "object", 719 "octet_length", 720 "of", 721 "off", 722 "offline", 723 "offset", 724 "offsets", 725 "oids", 726 "on", 727 "online", 728 "only", 729 "open", 730 "operator", 731 "optimization", 732 "optimize", 733 "optimizer", 734 "optimizer_state", 735 "option", 736 "options", 737 "optionally", 738 "or", 739 "order", 740 "ordered_serialize", 741 "orphan", 742 "out", 743 "out_of_order", 744 "outer", 745 "outfile", 746 "over", 747 "overlaps", 748 "overlay", 749 "owned", 750 "owner", 751 "pack_keys", 752 "paired", 753 "parser", 754 "parquet", 755 "partial", 756 "partition", 757 "partition_id", 758 "partitioning", 759 "partitions", 760 "passing", 761 "password", 762 "password_lock_time", 763 "parser", 764 "pause", 765 "_pause_replay", 766 "percent_rank", 767 "percentile_cont", 768 "percentile_disc", 769 "periodic", 770 "persisted", 771 "pi", 772 "pipeline", 773 "pipelines", 774 "pivot", 775 "placing", 776 "plan", 777 "plans", 778 "plancache", 779 "plugins", 780 "pool", 781 "pools", 782 "port", 783 "position", 784 "pow", 785 "power", 786 "preceding", 787 "precision", 788 "prepare", 789 "prepared", 790 "preserve", 791 "primary", 792 "prior", 793 "privileges", 794 "procedural", 795 "procedure", 796 "procedures", 797 "process", 798 "processlist", 799 "profile", 800 "profiles", 801 "program", 802 "promote", 803 "proxy", 804 "purge", 805 "quarter", 806 "queries", 807 "query", 808 "query_timeout", 809 "queue", 810 "quote", 811 "radians", 812 "rand", 813 "range", 814 "rank", 815 "read", 816 "_read", 817 "reads", 818 "real", 819 "reassign", 820 "rebalance", 821 "recheck", 822 "record", 823 "recursive", 824 "redundancy", 825 "redundant", 826 "ref", 827 "reference", 828 "references", 829 "refresh", 830 "regexp", 831 "reindex", 832 "relative", 833 "release", 834 "reload", 835 "rely", 836 "remote", 837 "remove", 838 "rename", 839 "repair", 840 "_repair_table", 841 "repeat", 842 "repeatable", 843 "_repl", 844 "_reprovisioning", 845 "replace", 846 "replica", 847 "replicate", 848 "replicating", 849 "replication", 850 "durability", 851 "require", 852 "resource", 853 "resource_pool", 854 "reset", 855 "restart", 856 "restore", 857 "restrict", 858 "result", 859 "_resurrect", 860 "retry", 861 "return", 862 "returning", 863 "returns", 864 "reverse", 865 "revoke", 866 "rg_pool", 867 "right", 868 "right_anti_join", 869 "right_semi_join", 870 "right_straight_join", 871 "rlike", 872 "role", 873 "roles", 874 "rollback", 875 "rollup", 876 "round", 877 "routine", 878 "row", 879 "row_count", 880 "row_format", 881 "row_number", 882 "rows", 883 "rowstore", 884 "rule", 885 "rpad", 886 "_rpc", 887 "rtrim", 888 "running", 889 "s3", 890 "safe", 891 "save", 892 "savepoint", 893 "scalar", 894 "schema", 895 "schemas", 896 "schema_binding", 897 "scroll", 898 "search", 899 "second", 900 "second_microsecond", 901 "sec_to_time", 902 "security", 903 "select", 904 "semi_join", 905 "_send_threads", 906 "sensitive", 907 "separator", 908 "sequence", 909 "sequences", 910 "serial", 911 "serializable", 912 "series", 913 "service_user", 914 "server", 915 "session", 916 "session_user", 917 "set", 918 "setof", 919 "security_lists_intersect", 920 "sha", 921 "sha1", 922 "sha2", 923 "shard", 924 "sharded", 925 "sharded_id", 926 "share", 927 "show", 928 "shutdown", 929 "sigmoid", 930 "sign", 931 "signal", 932 "similar", 933 "simple", 934 "site", 935 "signed", 936 "sin", 937 "skip", 938 "skipped_batches", 939 "sleep", 940 "_sleep", 941 "smallint", 942 "snapshot", 943 "_snapshot", 944 "_snapshots", 945 "soft_cpu_limit_percentage", 946 "some", 947 "soname", 948 "sparse", 949 "spatial", 950 "spatial_check_index", 951 "specific", 952 "split", 953 "sql", 954 "sql_big_result", 955 "sql_buffer_result", 956 "sql_cache", 957 "sql_calc_found_rows", 958 "sqlexception", 959 "sql_mode", 960 "sql_no_cache", 961 "sql_no_logging", 962 "sql_small_result", 963 "sqlstate", 964 "sqlwarning", 965 "sqrt", 966 "ssl", 967 "stable", 968 "standalone", 969 "start", 970 "starting", 971 "state", 972 "statement", 973 "statistics", 974 "stats", 975 "status", 976 "std", 977 "stddev", 978 "stddev_pop", 979 "stddev_samp", 980 "stdin", 981 "stdout", 982 "stop", 983 "storage", 984 "str_to_date", 985 "straight_join", 986 "strict", 987 "string", 988 "strip", 989 "subdate", 990 "substr", 991 "substring", 992 "substring_index", 993 "success", 994 "sum", 995 "super", 996 "symmetric", 997 "sync_snapshot", 998 "sync", 999 "_sync", 1000 "_sync2", 1001 "_sync_partitions", 1002 "_sync_snapshot", 1003 "synchronize", 1004 "sysid", 1005 "system", 1006 "table", 1007 "table_checksum", 1008 "tables", 1009 "tablespace", 1010 "tags", 1011 "tan", 1012 "target_size", 1013 "task", 1014 "temp", 1015 "template", 1016 "temporary", 1017 "temptable", 1018 "_term_bump", 1019 "terminate", 1020 "terminated", 1021 "test", 1022 "text", 1023 "then", 1024 "time", 1025 "timediff", 1026 "time_bucket", 1027 "time_format", 1028 "timeout", 1029 "timestamp", 1030 "timestampadd", 1031 "timestampdiff", 1032 "timezone", 1033 "time_to_sec", 1034 "tinyblob", 1035 "tinyint", 1036 "tinytext", 1037 "to", 1038 "to_base64", 1039 "to_char", 1040 "to_date", 1041 "to_days", 1042 "to_json", 1043 "to_number", 1044 "to_seconds", 1045 "to_timestamp", 1046 "tracelogs", 1047 "traditional", 1048 "trailing", 1049 "transform", 1050 "transaction", 1051 "_transactions_experimental", 1052 "treat", 1053 "trigger", 1054 "triggers", 1055 "trim", 1056 "true", 1057 "trunc", 1058 "truncate", 1059 "trusted", 1060 "two_phase", 1061 "_twopcid", 1062 "type", 1063 "types", 1064 "ucase", 1065 "unbounded", 1066 "uncommitted", 1067 "undefined", 1068 "undo", 1069 "unencrypted", 1070 "unenforced", 1071 "unhex", 1072 "unhold", 1073 "unicode", 1074 "union", 1075 "unique", 1076 "_unittest", 1077 "unix_timestamp", 1078 "unknown", 1079 "unlisten", 1080 "_unload", 1081 "unlock", 1082 "unlogged", 1083 "unpivot", 1084 "unsigned", 1085 "until", 1086 "update", 1087 "upgrade", 1088 "upper", 1089 "usage", 1090 "use", 1091 "user", 1092 "users", 1093 "using", 1094 "utc_date", 1095 "utc_time", 1096 "utc_timestamp", 1097 "_utf8", 1098 "vacuum", 1099 "valid", 1100 "validate", 1101 "validator", 1102 "value", 1103 "values", 1104 "varbinary", 1105 "varchar", 1106 "varcharacter", 1107 "variables", 1108 "variadic", 1109 "variance", 1110 "var_pop", 1111 "var_samp", 1112 "varying", 1113 "vector_sub", 1114 "verbose", 1115 "version", 1116 "view", 1117 "void", 1118 "volatile", 1119 "voting", 1120 "wait", 1121 "_wake", 1122 "warnings", 1123 "week", 1124 "weekday", 1125 "weekofyear", 1126 "when", 1127 "where", 1128 "while", 1129 "whitespace", 1130 "window", 1131 "with", 1132 "without", 1133 "within", 1134 "_wm_heartbeat", 1135 "work", 1136 "workload", 1137 "wrapper", 1138 "write", 1139 "xact_id", 1140 "xor", 1141 "year", 1142 "year_month", 1143 "yes", 1144 "zerofill", 1145 "zone", 1146 }
11class SingleStore(MySQL): 12 SUPPORTS_ORDER_BY_ALL = True 13 14 TIME_MAPPING: t.Dict[str, str] = { 15 "D": "%u", # Day of week (1-7) 16 "DD": "%d", # day of month (01-31) 17 "DY": "%a", # abbreviated name of day 18 "HH": "%I", # Hour of day (01-12) 19 "HH12": "%I", # alias for HH 20 "HH24": "%H", # Hour of day (00-23) 21 "MI": "%M", # Minute (00-59) 22 "MM": "%m", # Month (01-12; January = 01) 23 "MON": "%b", # Abbreviated name of month 24 "MONTH": "%B", # Name of month 25 "SS": "%S", # Second (00-59) 26 "RR": "%y", # 15 27 "YY": "%y", # 15 28 "YYYY": "%Y", # 2015 29 "FF6": "%f", # only 6 digits are supported in python formats 30 } 31 32 class Tokenizer(MySQL.Tokenizer): 33 BYTE_STRINGS = [("e'", "'"), ("E'", "'")] 34 35 KEYWORDS = { 36 **MySQL.Tokenizer.KEYWORDS, 37 "BSON": TokenType.JSONB, 38 "GEOGRAPHYPOINT": TokenType.GEOGRAPHYPOINT, 39 ":>": TokenType.COLON_GT, 40 "!:>": TokenType.NCOLON_GT, 41 "::$": TokenType.DCOLONDOLLAR, 42 "::%": TokenType.DCOLONPERCENT, 43 } 44 45 class Parser(MySQL.Parser): 46 FUNCTIONS = { 47 **MySQL.Parser.FUNCTIONS, 48 "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "singlestore"), 49 "TO_TIMESTAMP": build_formatted_time(exp.StrToTime, "singlestore"), 50 "TO_CHAR": build_formatted_time(exp.ToChar, "singlestore"), 51 "STR_TO_DATE": build_formatted_time(exp.StrToDate, "mysql"), 52 "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "mysql"), 53 "TIME_FORMAT": lambda args: exp.TimeToStr( 54 # The first argument is converted to TIME(6) 55 # This is needed because exp.TimeToStr is converted to DATE_FORMAT 56 # which interprets the first argument as DATETIME and fails to parse 57 # string literals like '12:05:47' without a date part. 58 this=exp.Cast( 59 this=seq_get(args, 0), 60 to=exp.DataType.build( 61 exp.DataType.Type.TIME, 62 expressions=[exp.DataTypeParam(this=exp.Literal.number(6))], 63 ), 64 ), 65 format=MySQL.format_time(seq_get(args, 1)), 66 ), 67 } 68 69 class Generator(MySQL.Generator): 70 TRANSFORMS = { 71 **MySQL.Generator.TRANSFORMS, 72 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 73 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 74 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 75 exp.StrToDate: lambda self, e: self.func( 76 "STR_TO_DATE", 77 e.this, 78 self.format_time( 79 e, 80 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 81 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 82 ), 83 ), 84 exp.TimeToStr: lambda self, e: self.func( 85 "DATE_FORMAT", 86 e.this, 87 self.format_time( 88 e, 89 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 90 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 91 ), 92 ), 93 } 94 95 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 96 RESERVED_KEYWORDS = { 97 "abs", 98 "absolute", 99 "access", 100 "account", 101 "acos", 102 "action", 103 "add", 104 "adddate", 105 "addtime", 106 "admin", 107 "aes_decrypt", 108 "aes_encrypt", 109 "after", 110 "against", 111 "aggregate", 112 "aggregates", 113 "aggregator", 114 "aggregator_id", 115 "aggregator_plan_hash", 116 "aggregators", 117 "algorithm", 118 "all", 119 "also", 120 "alter", 121 "always", 122 "analyse", 123 "analyze", 124 "and", 125 "anti_join", 126 "any", 127 "any_value", 128 "approx_count_distinct", 129 "approx_count_distinct_accumulate", 130 "approx_count_distinct_combine", 131 "approx_count_distinct_estimate", 132 "approx_geography_intersects", 133 "approx_percentile", 134 "arghistory", 135 "arrange", 136 "arrangement", 137 "array", 138 "as", 139 "asc", 140 "ascii", 141 "asensitive", 142 "asin", 143 "asm", 144 "assertion", 145 "assignment", 146 "ast", 147 "asymmetric", 148 "async", 149 "at", 150 "atan", 151 "atan2", 152 "attach", 153 "attribute", 154 "authorization", 155 "auto", 156 "auto_increment", 157 "auto_reprovision", 158 "autostats", 159 "autostats_cardinality_mode", 160 "autostats_enabled", 161 "autostats_histogram_mode", 162 "autostats_sampling", 163 "availability", 164 "avg", 165 "avg_row_length", 166 "avro", 167 "azure", 168 "background", 169 "_background_threads_for_cleanup", 170 "backup", 171 "backup_history", 172 "backup_id", 173 "backward", 174 "batch", 175 "batches", 176 "batch_interval", 177 "_batch_size_limit", 178 "before", 179 "begin", 180 "between", 181 "bigint", 182 "bin", 183 "binary", 184 "_binary", 185 "bit", 186 "bit_and", 187 "bit_count", 188 "bit_or", 189 "bit_xor", 190 "blob", 191 "bool", 192 "boolean", 193 "bootstrap", 194 "both", 195 "_bt", 196 "btree", 197 "bucket_count", 198 "by", 199 "byte", 200 "byte_length", 201 "cache", 202 "call", 203 "call_for_pipeline", 204 "called", 205 "capture", 206 "cascade", 207 "cascaded", 208 "case", 209 "cast", 210 "catalog", 211 "ceil", 212 "ceiling", 213 "chain", 214 "change", 215 "char", 216 "character", 217 "characteristics", 218 "character_length", 219 "char_length", 220 "charset", 221 "check", 222 "checkpoint", 223 "_check_can_connect", 224 "_check_consistency", 225 "checksum", 226 "_checksum", 227 "class", 228 "clear", 229 "client", 230 "client_found_rows", 231 "close", 232 "cluster", 233 "clustered", 234 "cnf", 235 "coalesce", 236 "coercibility", 237 "collate", 238 "collation", 239 "collect", 240 "column", 241 "columnar", 242 "columns", 243 "columnstore", 244 "columnstore_segment_rows", 245 "comment", 246 "comments", 247 "commit", 248 "committed", 249 "_commit_log_tail", 250 "committed", 251 "compact", 252 "compile", 253 "compressed", 254 "compression", 255 "concat", 256 "concat_ws", 257 "concurrent", 258 "concurrently", 259 "condition", 260 "configuration", 261 "connection", 262 "connection_id", 263 "connections", 264 "config", 265 "constraint", 266 "constraints", 267 "content", 268 "continue", 269 "_continue_replay", 270 "conv", 271 "conversion", 272 "convert", 273 "convert_tz", 274 "copy", 275 "_core", 276 "cos", 277 "cost", 278 "cot", 279 "count", 280 "create", 281 "credentials", 282 "cross", 283 "cube", 284 "csv", 285 "cume_dist", 286 "curdate", 287 "current", 288 "current_catalog", 289 "current_date", 290 "current_role", 291 "current_schema", 292 "current_security_groups", 293 "current_security_roles", 294 "current_time", 295 "current_timestamp", 296 "current_user", 297 "cursor", 298 "curtime", 299 "cycle", 300 "data", 301 "database", 302 "databases", 303 "date", 304 "date_add", 305 "datediff", 306 "date_format", 307 "date_sub", 308 "date_trunc", 309 "datetime", 310 "day", 311 "day_hour", 312 "day_microsecond", 313 "day_minute", 314 "dayname", 315 "dayofmonth", 316 "dayofweek", 317 "dayofyear", 318 "day_second", 319 "deallocate", 320 "dec", 321 "decimal", 322 "declare", 323 "decode", 324 "default", 325 "defaults", 326 "deferrable", 327 "deferred", 328 "defined", 329 "definer", 330 "degrees", 331 "delayed", 332 "delay_key_write", 333 "delete", 334 "delimiter", 335 "delimiters", 336 "dense_rank", 337 "desc", 338 "describe", 339 "detach", 340 "deterministic", 341 "dictionary", 342 "differential", 343 "directory", 344 "disable", 345 "discard", 346 "_disconnect", 347 "disk", 348 "distinct", 349 "distinctrow", 350 "distributed_joins", 351 "div", 352 "do", 353 "document", 354 "domain", 355 "dot_product", 356 "double", 357 "drop", 358 "_drop_profile", 359 "dual", 360 "dump", 361 "duplicate", 362 "dynamic", 363 "earliest", 364 "each", 365 "echo", 366 "election", 367 "else", 368 "elseif", 369 "elt", 370 "enable", 371 "enclosed", 372 "encoding", 373 "encrypted", 374 "end", 375 "engine", 376 "engines", 377 "enum", 378 "errors", 379 "escape", 380 "escaped", 381 "estimate", 382 "euclidean_distance", 383 "event", 384 "events", 385 "except", 386 "exclude", 387 "excluding", 388 "exclusive", 389 "execute", 390 "exists", 391 "exit", 392 "exp", 393 "explain", 394 "extended", 395 "extension", 396 "external", 397 "external_host", 398 "external_port", 399 "extract", 400 "extractor", 401 "extractors", 402 "extra_join", 403 "_failover", 404 "failed_login_attempts", 405 "failure", 406 "false", 407 "family", 408 "fault", 409 "fetch", 410 "field", 411 "fields", 412 "file", 413 "files", 414 "fill", 415 "first", 416 "first_value", 417 "fix_alter", 418 "fixed", 419 "float", 420 "float4", 421 "float8", 422 "floor", 423 "flush", 424 "following", 425 "for", 426 "force", 427 "force_compiled_mode", 428 "force_interpreter_mode", 429 "foreground", 430 "foreign", 431 "format", 432 "forward", 433 "found_rows", 434 "freeze", 435 "from", 436 "from_base64", 437 "from_days", 438 "from_unixtime", 439 "fs", 440 "_fsync", 441 "full", 442 "fulltext", 443 "function", 444 "functions", 445 "gc", 446 "gcs", 447 "get_format", 448 "_gc", 449 "_gcx", 450 "generate", 451 "geography", 452 "geography_area", 453 "geography_contains", 454 "geography_distance", 455 "geography_intersects", 456 "geography_latitude", 457 "geography_length", 458 "geography_longitude", 459 "geographypoint", 460 "geography_point", 461 "geography_within_distance", 462 "geometry", 463 "geometry_area", 464 "geometry_contains", 465 "geometry_distance", 466 "geometry_filter", 467 "geometry_intersects", 468 "geometry_length", 469 "geometrypoint", 470 "geometry_point", 471 "geometry_within_distance", 472 "geometry_x", 473 "geometry_y", 474 "global", 475 "_global_version_timestamp", 476 "grant", 477 "granted", 478 "grants", 479 "greatest", 480 "group", 481 "grouping", 482 "groups", 483 "group_concat", 484 "gzip", 485 "handle", 486 "handler", 487 "hard_cpu_limit_percentage", 488 "hash", 489 "has_temp_tables", 490 "having", 491 "hdfs", 492 "header", 493 "heartbeat_no_logging", 494 "hex", 495 "highlight", 496 "high_priority", 497 "hold", 498 "holding", 499 "host", 500 "hosts", 501 "hour", 502 "hour_microsecond", 503 "hour_minute", 504 "hour_second", 505 "identified", 506 "identity", 507 "if", 508 "ifnull", 509 "ignore", 510 "ilike", 511 "immediate", 512 "immutable", 513 "implicit", 514 "import", 515 "in", 516 "including", 517 "increment", 518 "incremental", 519 "index", 520 "indexes", 521 "inet_aton", 522 "inet_ntoa", 523 "inet6_aton", 524 "inet6_ntoa", 525 "infile", 526 "inherit", 527 "inherits", 528 "_init_profile", 529 "init", 530 "initcap", 531 "initialize", 532 "initially", 533 "inject", 534 "inline", 535 "inner", 536 "inout", 537 "input", 538 "insensitive", 539 "insert", 540 "insert_method", 541 "instance", 542 "instead", 543 "instr", 544 "int", 545 "int1", 546 "int2", 547 "int3", 548 "int4", 549 "int8", 550 "integer", 551 "_internal_dynamic_typecast", 552 "interpreter_mode", 553 "intersect", 554 "interval", 555 "into", 556 "invoker", 557 "is", 558 "isnull", 559 "isolation", 560 "iterate", 561 "join", 562 "json", 563 "json_agg", 564 "json_array_contains_double", 565 "json_array_contains_json", 566 "json_array_contains_string", 567 "json_array_push_double", 568 "json_array_push_json", 569 "json_array_push_string", 570 "json_delete_key", 571 "json_extract_double", 572 "json_extract_json", 573 "json_extract_string", 574 "json_extract_bigint", 575 "json_get_type", 576 "json_length", 577 "json_set_double", 578 "json_set_json", 579 "json_set_string", 580 "json_splice_double", 581 "json_splice_json", 582 "json_splice_string", 583 "kafka", 584 "key", 585 "key_block_size", 586 "keys", 587 "kill", 588 "killall", 589 "label", 590 "lag", 591 "language", 592 "large", 593 "last", 594 "last_day", 595 "last_insert_id", 596 "last_value", 597 "lateral", 598 "latest", 599 "lc_collate", 600 "lc_ctype", 601 "lcase", 602 "lead", 603 "leading", 604 "leaf", 605 "leakproof", 606 "least", 607 "leave", 608 "leaves", 609 "left", 610 "length", 611 "level", 612 "license", 613 "like", 614 "limit", 615 "lines", 616 "listen", 617 "llvm", 618 "ln", 619 "load", 620 "loaddata_where", 621 "_load", 622 "local", 623 "localtime", 624 "localtimestamp", 625 "locate", 626 "location", 627 "lock", 628 "log", 629 "log10", 630 "log2", 631 "long", 632 "longblob", 633 "longtext", 634 "loop", 635 "lower", 636 "low_priority", 637 "lpad", 638 "_ls", 639 "ltrim", 640 "lz4", 641 "management", 642 "_management_thread", 643 "mapping", 644 "master", 645 "match", 646 "materialized", 647 "max", 648 "maxvalue", 649 "max_concurrency", 650 "max_errors", 651 "max_partitions_per_batch", 652 "max_queue_depth", 653 "max_retries_per_batch_partition", 654 "max_rows", 655 "mbc", 656 "md5", 657 "mpl", 658 "median", 659 "mediumblob", 660 "mediumint", 661 "mediumtext", 662 "member", 663 "memory", 664 "memory_percentage", 665 "_memsql_table_id_lookup", 666 "memsql", 667 "memsql_deserialize", 668 "memsql_imitating_kafka", 669 "memsql_serialize", 670 "merge", 671 "metadata", 672 "microsecond", 673 "middleint", 674 "min", 675 "min_rows", 676 "minus", 677 "minute", 678 "minute_microsecond", 679 "minute_second", 680 "minvalue", 681 "mod", 682 "mode", 683 "model", 684 "modifies", 685 "modify", 686 "month", 687 "monthname", 688 "months_between", 689 "move", 690 "mpl", 691 "names", 692 "named", 693 "namespace", 694 "national", 695 "natural", 696 "nchar", 697 "next", 698 "no", 699 "node", 700 "none", 701 "no_query_rewrite", 702 "noparam", 703 "not", 704 "nothing", 705 "notify", 706 "now", 707 "nowait", 708 "no_write_to_binlog", 709 "no_query_rewrite", 710 "norely", 711 "nth_value", 712 "ntile", 713 "null", 714 "nullcols", 715 "nullif", 716 "nulls", 717 "numeric", 718 "nvarchar", 719 "object", 720 "octet_length", 721 "of", 722 "off", 723 "offline", 724 "offset", 725 "offsets", 726 "oids", 727 "on", 728 "online", 729 "only", 730 "open", 731 "operator", 732 "optimization", 733 "optimize", 734 "optimizer", 735 "optimizer_state", 736 "option", 737 "options", 738 "optionally", 739 "or", 740 "order", 741 "ordered_serialize", 742 "orphan", 743 "out", 744 "out_of_order", 745 "outer", 746 "outfile", 747 "over", 748 "overlaps", 749 "overlay", 750 "owned", 751 "owner", 752 "pack_keys", 753 "paired", 754 "parser", 755 "parquet", 756 "partial", 757 "partition", 758 "partition_id", 759 "partitioning", 760 "partitions", 761 "passing", 762 "password", 763 "password_lock_time", 764 "parser", 765 "pause", 766 "_pause_replay", 767 "percent_rank", 768 "percentile_cont", 769 "percentile_disc", 770 "periodic", 771 "persisted", 772 "pi", 773 "pipeline", 774 "pipelines", 775 "pivot", 776 "placing", 777 "plan", 778 "plans", 779 "plancache", 780 "plugins", 781 "pool", 782 "pools", 783 "port", 784 "position", 785 "pow", 786 "power", 787 "preceding", 788 "precision", 789 "prepare", 790 "prepared", 791 "preserve", 792 "primary", 793 "prior", 794 "privileges", 795 "procedural", 796 "procedure", 797 "procedures", 798 "process", 799 "processlist", 800 "profile", 801 "profiles", 802 "program", 803 "promote", 804 "proxy", 805 "purge", 806 "quarter", 807 "queries", 808 "query", 809 "query_timeout", 810 "queue", 811 "quote", 812 "radians", 813 "rand", 814 "range", 815 "rank", 816 "read", 817 "_read", 818 "reads", 819 "real", 820 "reassign", 821 "rebalance", 822 "recheck", 823 "record", 824 "recursive", 825 "redundancy", 826 "redundant", 827 "ref", 828 "reference", 829 "references", 830 "refresh", 831 "regexp", 832 "reindex", 833 "relative", 834 "release", 835 "reload", 836 "rely", 837 "remote", 838 "remove", 839 "rename", 840 "repair", 841 "_repair_table", 842 "repeat", 843 "repeatable", 844 "_repl", 845 "_reprovisioning", 846 "replace", 847 "replica", 848 "replicate", 849 "replicating", 850 "replication", 851 "durability", 852 "require", 853 "resource", 854 "resource_pool", 855 "reset", 856 "restart", 857 "restore", 858 "restrict", 859 "result", 860 "_resurrect", 861 "retry", 862 "return", 863 "returning", 864 "returns", 865 "reverse", 866 "revoke", 867 "rg_pool", 868 "right", 869 "right_anti_join", 870 "right_semi_join", 871 "right_straight_join", 872 "rlike", 873 "role", 874 "roles", 875 "rollback", 876 "rollup", 877 "round", 878 "routine", 879 "row", 880 "row_count", 881 "row_format", 882 "row_number", 883 "rows", 884 "rowstore", 885 "rule", 886 "rpad", 887 "_rpc", 888 "rtrim", 889 "running", 890 "s3", 891 "safe", 892 "save", 893 "savepoint", 894 "scalar", 895 "schema", 896 "schemas", 897 "schema_binding", 898 "scroll", 899 "search", 900 "second", 901 "second_microsecond", 902 "sec_to_time", 903 "security", 904 "select", 905 "semi_join", 906 "_send_threads", 907 "sensitive", 908 "separator", 909 "sequence", 910 "sequences", 911 "serial", 912 "serializable", 913 "series", 914 "service_user", 915 "server", 916 "session", 917 "session_user", 918 "set", 919 "setof", 920 "security_lists_intersect", 921 "sha", 922 "sha1", 923 "sha2", 924 "shard", 925 "sharded", 926 "sharded_id", 927 "share", 928 "show", 929 "shutdown", 930 "sigmoid", 931 "sign", 932 "signal", 933 "similar", 934 "simple", 935 "site", 936 "signed", 937 "sin", 938 "skip", 939 "skipped_batches", 940 "sleep", 941 "_sleep", 942 "smallint", 943 "snapshot", 944 "_snapshot", 945 "_snapshots", 946 "soft_cpu_limit_percentage", 947 "some", 948 "soname", 949 "sparse", 950 "spatial", 951 "spatial_check_index", 952 "specific", 953 "split", 954 "sql", 955 "sql_big_result", 956 "sql_buffer_result", 957 "sql_cache", 958 "sql_calc_found_rows", 959 "sqlexception", 960 "sql_mode", 961 "sql_no_cache", 962 "sql_no_logging", 963 "sql_small_result", 964 "sqlstate", 965 "sqlwarning", 966 "sqrt", 967 "ssl", 968 "stable", 969 "standalone", 970 "start", 971 "starting", 972 "state", 973 "statement", 974 "statistics", 975 "stats", 976 "status", 977 "std", 978 "stddev", 979 "stddev_pop", 980 "stddev_samp", 981 "stdin", 982 "stdout", 983 "stop", 984 "storage", 985 "str_to_date", 986 "straight_join", 987 "strict", 988 "string", 989 "strip", 990 "subdate", 991 "substr", 992 "substring", 993 "substring_index", 994 "success", 995 "sum", 996 "super", 997 "symmetric", 998 "sync_snapshot", 999 "sync", 1000 "_sync", 1001 "_sync2", 1002 "_sync_partitions", 1003 "_sync_snapshot", 1004 "synchronize", 1005 "sysid", 1006 "system", 1007 "table", 1008 "table_checksum", 1009 "tables", 1010 "tablespace", 1011 "tags", 1012 "tan", 1013 "target_size", 1014 "task", 1015 "temp", 1016 "template", 1017 "temporary", 1018 "temptable", 1019 "_term_bump", 1020 "terminate", 1021 "terminated", 1022 "test", 1023 "text", 1024 "then", 1025 "time", 1026 "timediff", 1027 "time_bucket", 1028 "time_format", 1029 "timeout", 1030 "timestamp", 1031 "timestampadd", 1032 "timestampdiff", 1033 "timezone", 1034 "time_to_sec", 1035 "tinyblob", 1036 "tinyint", 1037 "tinytext", 1038 "to", 1039 "to_base64", 1040 "to_char", 1041 "to_date", 1042 "to_days", 1043 "to_json", 1044 "to_number", 1045 "to_seconds", 1046 "to_timestamp", 1047 "tracelogs", 1048 "traditional", 1049 "trailing", 1050 "transform", 1051 "transaction", 1052 "_transactions_experimental", 1053 "treat", 1054 "trigger", 1055 "triggers", 1056 "trim", 1057 "true", 1058 "trunc", 1059 "truncate", 1060 "trusted", 1061 "two_phase", 1062 "_twopcid", 1063 "type", 1064 "types", 1065 "ucase", 1066 "unbounded", 1067 "uncommitted", 1068 "undefined", 1069 "undo", 1070 "unencrypted", 1071 "unenforced", 1072 "unhex", 1073 "unhold", 1074 "unicode", 1075 "union", 1076 "unique", 1077 "_unittest", 1078 "unix_timestamp", 1079 "unknown", 1080 "unlisten", 1081 "_unload", 1082 "unlock", 1083 "unlogged", 1084 "unpivot", 1085 "unsigned", 1086 "until", 1087 "update", 1088 "upgrade", 1089 "upper", 1090 "usage", 1091 "use", 1092 "user", 1093 "users", 1094 "using", 1095 "utc_date", 1096 "utc_time", 1097 "utc_timestamp", 1098 "_utf8", 1099 "vacuum", 1100 "valid", 1101 "validate", 1102 "validator", 1103 "value", 1104 "values", 1105 "varbinary", 1106 "varchar", 1107 "varcharacter", 1108 "variables", 1109 "variadic", 1110 "variance", 1111 "var_pop", 1112 "var_samp", 1113 "varying", 1114 "vector_sub", 1115 "verbose", 1116 "version", 1117 "view", 1118 "void", 1119 "volatile", 1120 "voting", 1121 "wait", 1122 "_wake", 1123 "warnings", 1124 "week", 1125 "weekday", 1126 "weekofyear", 1127 "when", 1128 "where", 1129 "while", 1130 "whitespace", 1131 "window", 1132 "with", 1133 "without", 1134 "within", 1135 "_wm_heartbeat", 1136 "work", 1137 "workload", 1138 "wrapper", 1139 "write", 1140 "xact_id", 1141 "xor", 1142 "year", 1143 "year_month", 1144 "yes", 1145 "zerofill", 1146 "zone", 1147 }
SUPPORTS_ORDER_BY_ALL =
True
Whether ORDER BY ALL is supported (expands to all the selected columns) as in DuckDB, Spark3/Databricks
TIME_MAPPING: Dict[str, str] =
{'D': '%u', 'DD': '%d', 'DY': '%a', 'HH': '%I', 'HH12': '%I', 'HH24': '%H', 'MI': '%M', 'MM': '%m', 'MON': '%b', 'MONTH': '%B', 'SS': '%S', 'RR': '%y', 'YY': '%y', 'YYYY': '%Y', 'FF6': '%f'}
Associates this dialect's time formats with their equivalent Python strftime formats.
UNESCAPED_SEQUENCES: Dict[str, str] =
{'\\a': '\x07', '\\b': '\x08', '\\f': '\x0c', '\\n': '\n', '\\r': '\r', '\\t': '\t', '\\v': '\x0b', '\\\\': '\\'}
Mapping of an escaped sequence (\n) to its unescaped version (
).
tokenizer_class =
<class 'SingleStore.Tokenizer'>
parser_class =
<class 'SingleStore.Parser'>
generator_class =
<class 'SingleStore.Generator'>
TIME_TRIE: Dict =
{'D': {0: True, 'D': {0: True}, 'Y': {0: True}}, 'H': {'H': {0: True, '1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}, 'O': {'N': {0: True, 'T': {'H': {0: True}}}}}, 'S': {'S': {0: True}}, 'R': {'R': {0: True}}, 'Y': {'Y': {0: True, 'Y': {'Y': {0: True}}}}, 'F': {'F': {'6': {0: True}}}}
FORMAT_TRIE: Dict =
{'D': {0: True, 'D': {0: True}, 'Y': {0: True}}, 'H': {'H': {0: True, '1': {'2': {0: True}}, '2': {'4': {0: True}}}}, 'M': {'I': {0: True}, 'M': {0: True}, 'O': {'N': {0: True, 'T': {'H': {0: True}}}}}, 'S': {'S': {0: True}}, 'R': {'R': {0: True}}, 'Y': {'Y': {0: True, 'Y': {'Y': {0: True}}}}, 'F': {'F': {'6': {0: True}}}}
INVERSE_TIME_MAPPING: Dict[str, str] =
{'%u': 'D', '%d': 'DD', '%a': 'DY', '%I': 'HH12', '%H': 'HH24', '%M': 'MI', '%m': 'MM', '%b': 'MON', '%B': 'MONTH', '%S': 'SS', '%y': 'YY', '%Y': 'YYYY', '%f': 'FF6'}
INVERSE_TIME_TRIE: Dict =
{'%': {'u': {0: True}, 'd': {0: True}, 'a': {0: True}, 'I': {0: True}, 'H': {0: True}, 'M': {0: True}, 'm': {0: True}, 'b': {0: True}, 'B': {0: True}, 'S': {0: True}, 'y': {0: True}, 'Y': {0: True}, 'f': {0: True}}}
32 class Tokenizer(MySQL.Tokenizer): 33 BYTE_STRINGS = [("e'", "'"), ("E'", "'")] 34 35 KEYWORDS = { 36 **MySQL.Tokenizer.KEYWORDS, 37 "BSON": TokenType.JSONB, 38 "GEOGRAPHYPOINT": TokenType.GEOGRAPHYPOINT, 39 ":>": TokenType.COLON_GT, 40 "!:>": TokenType.NCOLON_GT, 41 "::$": TokenType.DCOLONDOLLAR, 42 "::%": TokenType.DCOLONPERCENT, 43 }
KEYWORDS =
{'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '|>': <TokenType.PIPE_GT: 'PIPE_GT'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, ':=': <TokenType.COLON_EQ: 'COLON_EQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, '~~~': <TokenType.GLOB: 'GLOB'>, '~~': <TokenType.LIKE: 'LIKE'>, '~~*': <TokenType.ILIKE: 'ILIKE'>, '~*': <TokenType.IRLIKE: 'IRLIKE'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'COPY': <TokenType.COPY: 'COPY'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_SCHEMA': <TokenType.CURRENT_SCHEMA: 'CURRENT_SCHEMA'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NAMESPACE': <TokenType.NAMESPACE: 'NAMESPACE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'RENAME': <TokenType.RENAME: 'RENAME'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'STRAIGHT_JOIN': <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'TRUNCATE': <TokenType.TRUNCATE: 'TRUNCATE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'UHUGEINT': <TokenType.UINT128: 'UINT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'UINT': <TokenType.UINT: 'UINT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL32': <TokenType.DECIMAL32: 'DECIMAL32'>, 'DECIMAL64': <TokenType.DECIMAL64: 'DECIMAL64'>, 'DECIMAL128': <TokenType.DECIMAL128: 'DECIMAL128'>, 'DECIMAL256': <TokenType.DECIMAL256: 'DECIMAL256'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'LIST': <TokenType.LIST: 'LIST'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'JSONB': <TokenType.JSONB: 'JSONB'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'CHAR VARYING': <TokenType.VARCHAR: 'VARCHAR'>, 'CHARACTER VARYING': <TokenType.VARCHAR: 'VARCHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'BPCHAR': <TokenType.BPCHAR: 'BPCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.BLOB: 'BLOB'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'TIMESTAMP_LTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'TIMESTAMPNTZ': <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, 'TIMESTAMP_NTZ': <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'VECTOR': <TokenType.VECTOR: 'VECTOR'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.ANALYZE: 'ANALYZE'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'EXPLAIN': <TokenType.DESCRIBE: 'DESCRIBE'>, 'GRANT': <TokenType.GRANT: 'GRANT'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'CHARSET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'DISTINCTROW': <TokenType.DISTINCT: 'DISTINCT'>, 'FORCE': <TokenType.FORCE: 'FORCE'>, 'IGNORE': <TokenType.IGNORE: 'IGNORE'>, 'KEY': <TokenType.KEY: 'KEY'>, 'LOCK TABLES': <TokenType.COMMAND: 'COMMAND'>, 'MEMBER OF': <TokenType.MEMBER_OF: 'MEMBER_OF'>, 'SEPARATOR': <TokenType.SEPARATOR: 'SEPARATOR'>, 'SERIAL': <TokenType.SERIAL: 'SERIAL'>, 'START': <TokenType.BEGIN: 'BEGIN'>, 'SIGNED': <TokenType.BIGINT: 'BIGINT'>, 'SIGNED INTEGER': <TokenType.BIGINT: 'BIGINT'>, 'UNLOCK TABLES': <TokenType.COMMAND: 'COMMAND'>, 'UNSIGNED': <TokenType.UBIGINT: 'UBIGINT'>, 'UNSIGNED INTEGER': <TokenType.UBIGINT: 'UBIGINT'>, 'YEAR': <TokenType.YEAR: 'YEAR'>, '_ARMSCII8': <TokenType.INTRODUCER: 'INTRODUCER'>, '_ASCII': <TokenType.INTRODUCER: 'INTRODUCER'>, '_BIG5': <TokenType.INTRODUCER: 'INTRODUCER'>, '_BINARY': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP1250': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP1251': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP1256': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP1257': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP850': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP852': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP866': <TokenType.INTRODUCER: 'INTRODUCER'>, '_CP932': <TokenType.INTRODUCER: 'INTRODUCER'>, '_DEC8': <TokenType.INTRODUCER: 'INTRODUCER'>, '_EUCJPMS': <TokenType.INTRODUCER: 'INTRODUCER'>, '_EUCKR': <TokenType.INTRODUCER: 'INTRODUCER'>, '_GB18030': <TokenType.INTRODUCER: 'INTRODUCER'>, '_GB2312': <TokenType.INTRODUCER: 'INTRODUCER'>, '_GBK': <TokenType.INTRODUCER: 'INTRODUCER'>, '_GEOSTD8': <TokenType.INTRODUCER: 'INTRODUCER'>, '_GREEK': <TokenType.INTRODUCER: 'INTRODUCER'>, '_HEBREW': <TokenType.INTRODUCER: 'INTRODUCER'>, '_HP8': <TokenType.INTRODUCER: 'INTRODUCER'>, '_KEYBCS2': <TokenType.INTRODUCER: 'INTRODUCER'>, '_KOI8R': <TokenType.INTRODUCER: 'INTRODUCER'>, '_KOI8U': <TokenType.INTRODUCER: 'INTRODUCER'>, '_LATIN1': <TokenType.INTRODUCER: 'INTRODUCER'>, '_LATIN2': <TokenType.INTRODUCER: 'INTRODUCER'>, '_LATIN5': <TokenType.INTRODUCER: 'INTRODUCER'>, '_LATIN7': <TokenType.INTRODUCER: 'INTRODUCER'>, '_MACCE': <TokenType.INTRODUCER: 'INTRODUCER'>, '_MACROMAN': <TokenType.INTRODUCER: 'INTRODUCER'>, '_SJIS': <TokenType.INTRODUCER: 'INTRODUCER'>, '_SWE7': <TokenType.INTRODUCER: 'INTRODUCER'>, '_TIS620': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UCS2': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UJIS': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF8': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF16': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF16LE': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF32': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF8MB3': <TokenType.INTRODUCER: 'INTRODUCER'>, '_UTF8MB4': <TokenType.INTRODUCER: 'INTRODUCER'>, '@@': <TokenType.SESSION_PARAMETER: 'SESSION_PARAMETER'>, 'BSON': <TokenType.JSONB: 'JSONB'>, 'GEOGRAPHYPOINT': <TokenType.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>, ':>': <TokenType.COLON_GT: 'COLON_GT'>, '!:>': <TokenType.NCOLON_GT: 'NCOLON_GT'>, '::$': <TokenType.DCOLONDOLLAR: 'DCOLONDOLLAR'>, '::%': <TokenType.DCOLONPERCENT: 'DCOLONPERCENT'>}
Inherited Members
- sqlglot.tokens.Tokenizer
- Tokenizer
- SINGLE_TOKENS
- RAW_STRINGS
- HEREDOC_STRINGS
- UNICODE_STRINGS
- VAR_SINGLE_TOKENS
- IDENTIFIER_ESCAPES
- HEREDOC_TAG_IS_IDENTIFIER
- HEREDOC_STRING_ALTERNATIVE
- STRING_ESCAPES_ALLOWED_IN_RAW_STRINGS
- HINT_START
- TOKENS_PRECEDING_HINT
- WHITE_SPACE
- COMMAND_PREFIX_TOKENS
- NUMERIC_LITERALS
- dialect
- use_rs_tokenizer
- reset
- tokenize
- tokenize_rs
- size
- sql
- tokens
45 class Parser(MySQL.Parser): 46 FUNCTIONS = { 47 **MySQL.Parser.FUNCTIONS, 48 "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "singlestore"), 49 "TO_TIMESTAMP": build_formatted_time(exp.StrToTime, "singlestore"), 50 "TO_CHAR": build_formatted_time(exp.ToChar, "singlestore"), 51 "STR_TO_DATE": build_formatted_time(exp.StrToDate, "mysql"), 52 "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "mysql"), 53 "TIME_FORMAT": lambda args: exp.TimeToStr( 54 # The first argument is converted to TIME(6) 55 # This is needed because exp.TimeToStr is converted to DATE_FORMAT 56 # which interprets the first argument as DATETIME and fails to parse 57 # string literals like '12:05:47' without a date part. 58 this=exp.Cast( 59 this=seq_get(args, 0), 60 to=exp.DataType.build( 61 exp.DataType.Type.TIME, 62 expressions=[exp.DataTypeParam(this=exp.Literal.number(6))], 63 ), 64 ), 65 format=MySQL.format_time(seq_get(args, 1)), 66 ), 67 }
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
FUNCTIONS =
{'ABS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Abs'>>, 'ADD_MONTHS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AddMonths'>>, 'AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.And'>>, 'ANONYMOUS_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnonymousAggFunc'>>, 'ANY_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'APPLY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Apply'>>, 'APPROX_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_COUNT_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxQuantile'>>, 'APPROX_TOP_K': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxTopK'>>, 'ARG_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARGMAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'MAX_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARG_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARGMIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'MIN_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARRAY': <function Parser.<lambda>>, 'ARRAY_AGG': <function Parser.<lambda>>, 'ARRAY_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAll'>>, 'ARRAY_ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAny'>>, 'ARRAY_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CONCAT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcatAgg'>>, 'ARRAY_CONSTRUCT_COMPACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConstructCompact'>>, 'ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'ARRAY_HAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'ARRAY_CONTAINS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, 'ARRAY_HAS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, 'FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_FIRST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFirst'>>, 'ARRAY_INTERSECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayIntersect'>>, 'ARRAY_INTERSECTION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayIntersect'>>, 'ARRAY_LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayLast'>>, 'ARRAY_OVERLAPS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayOverlaps'>>, 'ARRAY_REMOVE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayRemove'>>, 'ARRAY_REVERSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayReverse'>>, 'ARRAY_SIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySize'>>, 'ARRAY_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySize'>>, 'ARRAY_SLICE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySlice'>>, 'ARRAY_SORT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySort'>>, 'ARRAY_SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySum'>>, 'ARRAY_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayToString'>>, 'ARRAY_JOIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayToString'>>, 'ARRAY_UNION_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayUnionAgg'>>, 'ARRAY_UNIQUE_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayUniqueAgg'>>, 'ASCII': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ascii'>>, 'AVG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Avg'>>, 'BIT_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.BitwiseAndAgg'>>, 'BIT_COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.BitwiseCountAgg'>>, 'BIT_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.BitwiseOrAgg'>>, 'BIT_XOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.BitwiseXorAgg'>>, 'CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Case'>>, 'CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Cast'>>, 'CAST_TO_STR_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CastToStrType'>>, 'CBRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Cbrt'>>, 'CEIL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ceil'>>, 'CEILING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ceil'>>, 'CHR': <function Parser.<lambda>>, 'CHAR': <function Parser.<lambda>>, 'COALESCE': <function build_coalesce>, 'IFNULL': <function build_coalesce>, 'NVL': <function build_coalesce>, 'COLLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Collate'>>, 'COLUMNS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Columns'>>, 'COMBINED_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CombinedAggFunc'>>, 'COMBINED_PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CombinedParameterizedAgg'>>, 'CONCAT': <function Parser.<lambda>>, 'CONCAT_WS': <function Parser.<lambda>>, 'CONNECT_BY_ROOT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ConnectByRoot'>>, 'CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Contains'>>, 'CONVERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Convert'>>, 'CONVERT_TIMEZONE': <function build_convert_timezone>, 'CONVERT_TO_CHARSET': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ConvertToCharset'>>, 'CORR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Corr'>>, 'COUNT': <function Parser.<lambda>>, 'COUNT_IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CountIf'>>, 'COUNTIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CountIf'>>, 'COVAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CovarPop'>>, 'COVAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CovarSamp'>>, 'CURRENT_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentDate'>>, 'CURRENT_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentDatetime'>>, 'CURRENT_SCHEMA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentSchema'>>, 'CURRENT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentTime'>>, 'CURRENT_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentTimestamp'>>, 'CURRENT_TIMESTAMP_L_T_Z': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentTimestampLTZ'>>, 'CURRENT_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentUser'>>, 'DATE': <function MySQL.Parser.<lambda>>, 'DATE_ADD': <function build_date_delta_with_interval.<locals>._builder>, 'DATE_BIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateBin'>>, 'DATEDIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateDiff'>>, 'DATE_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateDiff'>>, 'DATE_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATE_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.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.DateToDi'>>, 'DATE_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateTrunc'>>, 'DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Datetime'>>, 'DATETIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeAdd'>>, 'DATETIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeDiff'>>, 'DATETIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeSub'>>, 'DATETIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeTrunc'>>, 'DAY': <function MySQL.Parser.<lambda>>, 'DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfMonth'>>, 'DAYOFMONTH': <function MySQL.Parser.<lambda>>, 'DAY_OF_WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeek'>>, 'DAYOFWEEK': <function MySQL.Parser.<lambda>>, 'DAYOFWEEK_ISO': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeekIso'>>, 'ISODOW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeekIso'>>, 'DAY_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfYear'>>, 'DAYOFYEAR': <function MySQL.Parser.<lambda>>, 'DECODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Decode'>>, 'DECODE_CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DecodeCase'>>, 'DI_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DiToDate'>>, 'ENCODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Encode'>>, 'ENDS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.EndsWith'>>, 'ENDSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.EndsWith'>>, 'EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Exists'>>, 'EXP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Exp'>>, 'EXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Explode'>>, 'EXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ExplodeOuter'>>, 'EXPLODING_GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ExplodingGenerateSeries'>>, 'EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Extract'>>, 'FEATURES_AT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FeaturesAtTime'>>, 'FIRST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.First'>>, 'FIRST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FirstValue'>>, 'FLATTEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Flatten'>>, 'FLOOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Floor'>>, 'FROM_BASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase'>>, 'FROM_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase64'>>, 'FROM_ISO8601_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromISO8601Timestamp'>>, 'GAP_FILL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GapFill'>>, 'GENERATE_DATE_ARRAY': <function Parser.<lambda>>, 'GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, 'GENERATE_TIMESTAMP_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateTimestampArray'>>, 'GREATEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Greatest'>>, 'GROUP_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GroupConcat'>>, 'HEX': <function build_hex>, 'HLL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Hll'>>, 'IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'IIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'INITCAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Initcap'>>, 'INLINE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Inline'>>, 'INT64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Int64'>>, 'IS_ASCII': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsAscii'>>, 'IS_INF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'ISINF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'IS_NAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'ISNAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'J_S_O_N_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArray'>>, 'J_S_O_N_ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayAgg'>>, 'JSON_ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayContains'>>, 'JSONB_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBContains'>>, 'JSONB_EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBExists'>>, 'JSONB_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBExtract'>>, 'JSONB_EXTRACT_SCALAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBExtractScalar'>>, 'J_S_O_N_B_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBObjectAgg'>>, 'J_S_O_N_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONCast'>>, 'J_S_O_N_EXISTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONExists'>>, 'JSON_EXTRACT': <function build_extract_json_with_path.<locals>._builder>, 'JSON_EXTRACT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONExtractArray'>>, 'JSON_EXTRACT_SCALAR': <function build_extract_json_with_path.<locals>._builder>, 'JSON_FORMAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONFormat'>>, 'J_S_O_N_OBJECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObject'>>, 'J_S_O_N_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObjectAgg'>>, 'J_S_O_N_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONTable'>>, 'JSON_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONType'>>, 'J_S_O_N_VALUE_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONValueArray'>>, 'LAG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lag'>>, 'LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Last'>>, 'LAST_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastValue'>>, 'LEAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lead'>>, 'LEAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Least'>>, 'LEFT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Left'>>, 'LENGTH': <function MySQL.Parser.<lambda>>, 'LEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'CHAR_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'CHARACTER_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEVENSHTEIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Levenshtein'>>, 'LIST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.List'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ln'>>, 'LOG': <function build_logarithm>, 'LOGICAL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOLAND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'LOGICAL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOLOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'LOWER': <function build_lower>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'LOWER_HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LowerHex'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MAKE_INTERVAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MakeInterval'>>, 'MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Map'>>, 'MAP_FROM_ENTRIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MapFromEntries'>>, 'MATCH_AGAINST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MatchAgainst'>>, 'MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Max'>>, 'MEDIAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Median'>>, 'MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Min'>>, 'MONTH': <function MySQL.Parser.<lambda>>, 'MONTHS_BETWEEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MonthsBetween'>>, 'NEXT_VALUE_FOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NextValueFor'>>, 'NORMALIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Normalize'>>, 'NTH_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NthValue'>>, 'NULLIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nullif'>>, 'NUMBER_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NumberToStr'>>, 'NVL2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nvl2'>>, 'OBJECT_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ObjectInsert'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Or'>>, 'OVERLAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Overlay'>>, 'PAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pad'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quarter'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_EXTRACT_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtractAll'>>, 'REGEXP_I_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpILike'>>, 'REGEXP_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'REGEXP_REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpReplace'>>, 'REGEXP_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpSplit'>>, 'REPEAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Repeat'>>, 'REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Replace'>>, 'RIGHT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Right'>>, 'ROUND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Round'>>, 'ROW_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RowNumber'>>, 'SHA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA2'>>, 'SAFE_DIVIDE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SafeDivide'>>, 'SIGN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SIGNUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SORT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SortArray'>>, 'SPACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Space'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Split'>>, 'SPLIT_PART': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SplitPart'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sqrt'>>, 'ST_DISTANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StDistance'>>, 'ST_POINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StPoint'>>, 'ST_MAKEPOINT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StPoint'>>, 'STANDARD_HASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StandardHash'>>, 'STAR_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StarMap'>>, 'STARTS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STARTSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STDDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'STR_TO_DATE': <function build_formatted_time.<locals>._builder>, 'STR_TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToMap'>>, 'STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToTime'>>, 'STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToUnix'>>, 'STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.String'>>, 'STRING_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, 'SPLIT_BY_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, 'STRTOK_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, 'STRUCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Struct'>>, 'STRUCT_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StructExtract'>>, 'STUFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stuff'>>, 'INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stuff'>>, 'SUBSTRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Substring'>>, 'SUBSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Substring'>>, 'SUBSTRING_INDEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SubstringIndex'>>, 'SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sum'>>, 'TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Time'>>, 'TIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeAdd'>>, 'TIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeDiff'>>, 'TIME_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIMEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIME_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToDate'>>, 'TIME_STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToTime'>>, 'TIME_STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToUnix'>>, 'TIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeSub'>>, 'TIME_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToStr'>>, 'TIME_TO_TIME_STR': <function Parser.<lambda>>, 'TIME_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToUnix'>>, 'TIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeTrunc'>>, 'TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Timestamp'>>, 'TIMESTAMP_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampAdd'>>, 'TIMESTAMPDIFF': <function build_date_delta.<locals>._builder>, 'TIMESTAMP_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, 'TIMESTAMP_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMPFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMP_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampSub'>>, 'TIMESTAMP_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampTrunc'>>, 'TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToArray'>>, 'TO_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToBase64'>>, 'TO_CHAR': <function build_formatted_time.<locals>._builder>, 'TO_DAYS': <function MySQL.Parser.<lambda>>, 'TO_DOUBLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToDouble'>>, 'TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToMap'>>, 'TO_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToNumber'>>, 'TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Transform'>>, 'TRIM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Trim'>>, 'TRY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Try'>>, 'TRY_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TryCast'>>, 'TS_OR_DI_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDiToDi'>>, 'TS_OR_DS_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsAdd'>>, 'TS_OR_DS_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsDiff'>>, 'TS_OR_DS_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.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.TsOrDsToDatetime'>>, 'TS_OR_DS_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToTime'>>, 'TS_OR_DS_TO_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToTimestamp'>>, 'TYPEOF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Typeof'>>, 'UNHEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Unhex'>>, 'UNICODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Unicode'>>, 'UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixDate'>>, 'UNIX_SECONDS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixSeconds'>>, 'UNIX_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToStr'>>, 'UNIX_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTime'>>, 'UNIX_TO_TIME_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTimeStr'>>, 'UNNEST': <function Parser.<lambda>>, 'UPPER': <function build_upper>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'UUID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Uuid'>>, 'GEN_RANDOM_UUID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Uuid'>>, 'GENERATE_UUID': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Uuid'>>, 'UUID_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Uuid'>>, 'VAR_MAP': <function build_var_map>, 'VARIANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'VAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'WEEK': <function MySQL.Parser.<lambda>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WEEKOFYEAR': <function MySQL.Parser.<lambda>>, 'XMLELEMENT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.XMLElement'>>, 'X_M_L_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.XMLTable'>>, 'XOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Xor'>>, 'YEAR': <function MySQL.Parser.<lambda>>, '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.StrPosition'>>, 'CHARINDEX': <function Parser.<lambda>>, 'INSTR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'LOCATE': <function Parser.<lambda>>, 'TO_HEX': <function build_hex>, 'CONVERT_TZ': <function MySQL.Parser.<lambda>>, 'CURDATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentDate'>>, 'DATE_FORMAT': <function build_formatted_time.<locals>._builder>, 'FORMAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NumberToStr'>>, '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.TimeFromParts'>>, 'MONTHNAME': <function MySQL.Parser.<lambda>>, 'SCHEMA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentSchema'>>, 'DATABASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentSchema'>>, 'TO_DATE': <function build_formatted_time.<locals>._builder>, 'TO_TIMESTAMP': <function build_formatted_time.<locals>._builder>, 'TIME_FORMAT': <function SingleStore.Parser.<lambda>>}
TABLE_ALIAS_TOKENS =
{<TokenType.COMMAND: 'COMMAND'>, <TokenType.ASC: 'ASC'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.FILTER: 'FILTER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.UINT: 'UINT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.INT128: 'INT128'>, <TokenType.INT256: 'INT256'>, <TokenType.XML: 'XML'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.SEMI: 'SEMI'>, <TokenType.JSONB: 'JSONB'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.ATTACH: 'ATTACH'>, <TokenType.FIRST: 'FIRST'>, <TokenType.SHOW: 'SHOW'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.LIST: 'LIST'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DATETIME2: 'DATETIME2'>, <TokenType.ANY: 'ANY'>, <TokenType.DECIMAL256: 'DECIMAL256'>, <TokenType.DECIMAL32: 'DECIMAL32'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.UINT256: 'UINT256'>, <TokenType.IPV4: 'IPV4'>, <TokenType.GET: 'GET'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.COPY: 'COPY'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.END: 'END'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.CHAR: 'CHAR'>, <TokenType.POINT: 'POINT'>, <TokenType.STAGE: 'STAGE'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.IPV6: 'IPV6'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.FILE_FORMAT: 'FILE_FORMAT'>, <TokenType.DYNAMIC: 'DYNAMIC'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.DIV: 'DIV'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.POLYGON: 'POLYGON'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.INDEX: 'INDEX'>, <TokenType.PUT: 'PUT'>, <TokenType.VAR: 'VAR'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.TOP: 'TOP'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.SOURCE: 'SOURCE'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.DECIMAL128: 'DECIMAL128'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.RANGE: 'RANGE'>, <TokenType.UUID: 'UUID'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.IS: 'IS'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.TIME: 'TIME'>, <TokenType.FALSE: 'FALSE'>, <TokenType.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>, <TokenType.VOID: 'VOID'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.TAG: 'TAG'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.EXPORT: 'EXPORT'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NESTED: 'NESTED'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.JSON: 'JSON'>, <TokenType.NEXT: 'NEXT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.SEMANTIC_VIEW: 'SEMANTIC_VIEW'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.CURRENT_SCHEMA: 'CURRENT_SCHEMA'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TRUE: 'TRUE'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.CASE: 'CASE'>, <TokenType.MULTILINESTRING: 'MULTILINESTRING'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.DECIMAL64: 'DECIMAL64'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.FINAL: 'FINAL'>, <TokenType.DATE32: 'DATE32'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SET: 'SET'>, <TokenType.SUPER: 'SUPER'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.LOAD: 'LOAD'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.RING: 'RING'>, <TokenType.NAMESPACE: 'NAMESPACE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.INET: 'INET'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.MULTIPOLYGON: 'MULTIPOLYGON'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.NOTHING: 'NOTHING'>, <TokenType.CUBE: 'CUBE'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.INT: 'INT'>, <TokenType.UDOUBLE: 'UDOUBLE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.ROWS: 'ROWS'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.SMALLDATETIME: 'SMALLDATETIME'>, <TokenType.DETACH: 'DETACH'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.KILL: 'KILL'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.DATE: 'DATE'>, <TokenType.NULL: 'NULL'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.VIEW: 'VIEW'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.SOME: 'SOME'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.CACHE: 'CACHE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.DESC: 'DESC'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.BLOB: 'BLOB'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.ANTI: 'ANTI'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.SINK: 'SINK'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.TABLE: 'TABLE'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.RENAME: 'RENAME'>, <TokenType.MERGE: 'MERGE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.ROW: 'ROW'>, <TokenType.MAP: 'MAP'>, <TokenType.LINESTRING: 'LINESTRING'>, <TokenType.LIMIT: 'LIMIT'>, <TokenType.NAME: 'NAME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>}
ID_VAR_TOKENS =
{<TokenType.COMMAND: 'COMMAND'>, <TokenType.ASC: 'ASC'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.FILTER: 'FILTER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.UINT: 'UINT'>, <TokenType.LEFT: 'LEFT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.INT128: 'INT128'>, <TokenType.INT256: 'INT256'>, <TokenType.XML: 'XML'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.SEMI: 'SEMI'>, <TokenType.JSONB: 'JSONB'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.ATTACH: 'ATTACH'>, <TokenType.FIRST: 'FIRST'>, <TokenType.SHOW: 'SHOW'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.LIST: 'LIST'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DATETIME2: 'DATETIME2'>, <TokenType.ANY: 'ANY'>, <TokenType.DECIMAL256: 'DECIMAL256'>, <TokenType.DECIMAL32: 'DECIMAL32'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.UINT256: 'UINT256'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.IPV4: 'IPV4'>, <TokenType.GET: 'GET'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.COPY: 'COPY'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.END: 'END'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.CHAR: 'CHAR'>, <TokenType.POINT: 'POINT'>, <TokenType.STAGE: 'STAGE'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.IPV6: 'IPV6'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.FILE_FORMAT: 'FILE_FORMAT'>, <TokenType.DYNAMIC: 'DYNAMIC'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.DIV: 'DIV'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.POLYGON: 'POLYGON'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.INDEX: 'INDEX'>, <TokenType.PUT: 'PUT'>, <TokenType.VAR: 'VAR'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.TOP: 'TOP'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.SOURCE: 'SOURCE'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.DECIMAL128: 'DECIMAL128'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.RANGE: 'RANGE'>, <TokenType.UUID: 'UUID'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.IS: 'IS'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.TIME: 'TIME'>, <TokenType.FALSE: 'FALSE'>, <TokenType.USE: 'USE'>, <TokenType.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>, <TokenType.VOID: 'VOID'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.TAG: 'TAG'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.EXPORT: 'EXPORT'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NESTED: 'NESTED'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.JSON: 'JSON'>, <TokenType.NEXT: 'NEXT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.SEMANTIC_VIEW: 'SEMANTIC_VIEW'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.CURRENT_SCHEMA: 'CURRENT_SCHEMA'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.FULL: 'FULL'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TRUE: 'TRUE'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.CASE: 'CASE'>, <TokenType.MULTILINESTRING: 'MULTILINESTRING'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.DECIMAL64: 'DECIMAL64'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.FINAL: 'FINAL'>, <TokenType.DATE32: 'DATE32'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SET: 'SET'>, <TokenType.SUPER: 'SUPER'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.LOAD: 'LOAD'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.RING: 'RING'>, <TokenType.NAMESPACE: 'NAMESPACE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.INET: 'INET'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.APPLY: 'APPLY'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.MULTIPOLYGON: 'MULTIPOLYGON'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.NOTHING: 'NOTHING'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.CUBE: 'CUBE'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.INT: 'INT'>, <TokenType.UDOUBLE: 'UDOUBLE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.ROWS: 'ROWS'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.SMALLDATETIME: 'SMALLDATETIME'>, <TokenType.DETACH: 'DETACH'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.ASOF: 'ASOF'>, <TokenType.KILL: 'KILL'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.DATE: 'DATE'>, <TokenType.NULL: 'NULL'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.VIEW: 'VIEW'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.SOME: 'SOME'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.CACHE: 'CACHE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.DESC: 'DESC'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.BLOB: 'BLOB'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.ANTI: 'ANTI'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.SINK: 'SINK'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.TABLE: 'TABLE'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.RENAME: 'RENAME'>, <TokenType.MERGE: 'MERGE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.ROW: 'ROW'>, <TokenType.MAP: 'MAP'>, <TokenType.LINESTRING: 'LINESTRING'>, <TokenType.LIMIT: 'LIMIT'>, <TokenType.NAME: 'NAME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>}
SHOW_TRIE: Dict =
{'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: Dict =
{'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}}
Inherited Members
- sqlglot.parser.Parser
- Parser
- NO_PAREN_FUNCTIONS
- STRUCT_TYPE_TOKENS
- NESTED_TYPE_TOKENS
- AGGREGATE_TYPE_TOKENS
- SIGNED_TO_UNSIGNED_TYPE_TOKEN
- SUBQUERY_PREDICATES
- RESERVED_TOKENS
- DB_CREATABLES
- CREATABLES
- ALTERABLES
- ALIAS_TOKENS
- COLON_PLACEHOLDER_TOKENS
- ARRAY_CONSTRUCTORS
- COMMENT_TABLE_ALIAS_TOKENS
- UPDATE_ALIAS_TOKENS
- TRIM_TYPES
- ASSIGNMENT
- EQUALITY
- COMPARISON
- BITWISE
- TERM
- FACTOR
- EXPONENT
- TIMES
- TIMESTAMPS
- SET_OPERATIONS
- JOIN_METHODS
- JOIN_SIDES
- JOIN_KINDS
- JOIN_HINTS
- LAMBDAS
- COLUMN_OPERATORS
- EXPRESSION_PARSERS
- UNARY_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
- 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
- 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
- NULL_TOKENS
- UNNEST_OFFSET_ALIAS_TOKENS
- SELECT_START_TOKENS
- COPY_INTO_VARLEN_OPTIONS
- IS_JSON_PREDICATE_KIND
- ODBC_DATETIME_LITERALS
- ON_CONDITION_TOKENS
- PRIVILEGE_FOLLOW_TOKENS
- DESCRIBE_STYLES
- ANALYZE_STYLES
- ANALYZE_EXPRESSION_PARSERS
- PARTITION_KEYWORDS
- AMBIGUOUS_ALIAS_TOKENS
- RECURSIVE_CTE_SEARCH_KIND
- MODIFIABLES
- STRICT_CAST
- PREFIXED_PIVOT_COLUMNS
- IDENTIFY_PIVOT_STRINGS
- 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
- SUPPORTS_IMPLICIT_UNNEST
- INTERVAL_SPANS
- WRAPPED_TRANSFORM_COLUMN_CONSTRAINT
- OPTIONAL_ALIAS_TOKEN_CTE
- ALTER_RENAME_REQUIRES_COLUMN
- JOINS_HAVE_EQUAL_PRECEDENCE
- ZONE_AWARE_TIMESTAMP_CONSTRUCTOR
- MAP_KEYS_ARE_ARBITRARY_EXPRESSIONS
- JSON_EXTRACT_REQUIRES_JSON_EXPRESSION
- error_level
- error_message_context
- max_errors
- dialect
- reset
- parse
- parse_into
- check_errors
- raise_error
- expression
- validate_expression
- parse_set_operation
- build_cast
- errors
- sql
- sqlglot.dialects.mysql.MySQL.Parser
- FUNC_TOKENS
- CONJUNCTION
- DISJUNCTION
- RANGE_PARSERS
- FUNCTION_PARSERS
- STATEMENT_PARSERS
- SHOW_PARSERS
- PROPERTY_PARSERS
- SET_PARSERS
- CONSTRAINT_PARSERS
- ALTER_PARSERS
- ALTER_ALTER_PARSERS
- SCHEMA_UNNAMED_CONSTRAINTS
- PROFILE_TYPES
- TYPE_TOKENS
- ENUM_TYPE_TOKENS
- OPERATION_MODIFIERS
- LOG_DEFAULTS_TO_LN
- STRING_ALIASES
- VALUES_FOLLOWED_BY_PAREN
- SUPPORTS_PARTITION_SELECTION
69 class Generator(MySQL.Generator): 70 TRANSFORMS = { 71 **MySQL.Generator.TRANSFORMS, 72 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 73 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 74 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 75 exp.StrToDate: lambda self, e: self.func( 76 "STR_TO_DATE", 77 e.this, 78 self.format_time( 79 e, 80 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 81 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 82 ), 83 ), 84 exp.TimeToStr: lambda self, e: self.func( 85 "DATE_FORMAT", 86 e.this, 87 self.format_time( 88 e, 89 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 90 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 91 ), 92 ), 93 } 94 95 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 96 RESERVED_KEYWORDS = { 97 "abs", 98 "absolute", 99 "access", 100 "account", 101 "acos", 102 "action", 103 "add", 104 "adddate", 105 "addtime", 106 "admin", 107 "aes_decrypt", 108 "aes_encrypt", 109 "after", 110 "against", 111 "aggregate", 112 "aggregates", 113 "aggregator", 114 "aggregator_id", 115 "aggregator_plan_hash", 116 "aggregators", 117 "algorithm", 118 "all", 119 "also", 120 "alter", 121 "always", 122 "analyse", 123 "analyze", 124 "and", 125 "anti_join", 126 "any", 127 "any_value", 128 "approx_count_distinct", 129 "approx_count_distinct_accumulate", 130 "approx_count_distinct_combine", 131 "approx_count_distinct_estimate", 132 "approx_geography_intersects", 133 "approx_percentile", 134 "arghistory", 135 "arrange", 136 "arrangement", 137 "array", 138 "as", 139 "asc", 140 "ascii", 141 "asensitive", 142 "asin", 143 "asm", 144 "assertion", 145 "assignment", 146 "ast", 147 "asymmetric", 148 "async", 149 "at", 150 "atan", 151 "atan2", 152 "attach", 153 "attribute", 154 "authorization", 155 "auto", 156 "auto_increment", 157 "auto_reprovision", 158 "autostats", 159 "autostats_cardinality_mode", 160 "autostats_enabled", 161 "autostats_histogram_mode", 162 "autostats_sampling", 163 "availability", 164 "avg", 165 "avg_row_length", 166 "avro", 167 "azure", 168 "background", 169 "_background_threads_for_cleanup", 170 "backup", 171 "backup_history", 172 "backup_id", 173 "backward", 174 "batch", 175 "batches", 176 "batch_interval", 177 "_batch_size_limit", 178 "before", 179 "begin", 180 "between", 181 "bigint", 182 "bin", 183 "binary", 184 "_binary", 185 "bit", 186 "bit_and", 187 "bit_count", 188 "bit_or", 189 "bit_xor", 190 "blob", 191 "bool", 192 "boolean", 193 "bootstrap", 194 "both", 195 "_bt", 196 "btree", 197 "bucket_count", 198 "by", 199 "byte", 200 "byte_length", 201 "cache", 202 "call", 203 "call_for_pipeline", 204 "called", 205 "capture", 206 "cascade", 207 "cascaded", 208 "case", 209 "cast", 210 "catalog", 211 "ceil", 212 "ceiling", 213 "chain", 214 "change", 215 "char", 216 "character", 217 "characteristics", 218 "character_length", 219 "char_length", 220 "charset", 221 "check", 222 "checkpoint", 223 "_check_can_connect", 224 "_check_consistency", 225 "checksum", 226 "_checksum", 227 "class", 228 "clear", 229 "client", 230 "client_found_rows", 231 "close", 232 "cluster", 233 "clustered", 234 "cnf", 235 "coalesce", 236 "coercibility", 237 "collate", 238 "collation", 239 "collect", 240 "column", 241 "columnar", 242 "columns", 243 "columnstore", 244 "columnstore_segment_rows", 245 "comment", 246 "comments", 247 "commit", 248 "committed", 249 "_commit_log_tail", 250 "committed", 251 "compact", 252 "compile", 253 "compressed", 254 "compression", 255 "concat", 256 "concat_ws", 257 "concurrent", 258 "concurrently", 259 "condition", 260 "configuration", 261 "connection", 262 "connection_id", 263 "connections", 264 "config", 265 "constraint", 266 "constraints", 267 "content", 268 "continue", 269 "_continue_replay", 270 "conv", 271 "conversion", 272 "convert", 273 "convert_tz", 274 "copy", 275 "_core", 276 "cos", 277 "cost", 278 "cot", 279 "count", 280 "create", 281 "credentials", 282 "cross", 283 "cube", 284 "csv", 285 "cume_dist", 286 "curdate", 287 "current", 288 "current_catalog", 289 "current_date", 290 "current_role", 291 "current_schema", 292 "current_security_groups", 293 "current_security_roles", 294 "current_time", 295 "current_timestamp", 296 "current_user", 297 "cursor", 298 "curtime", 299 "cycle", 300 "data", 301 "database", 302 "databases", 303 "date", 304 "date_add", 305 "datediff", 306 "date_format", 307 "date_sub", 308 "date_trunc", 309 "datetime", 310 "day", 311 "day_hour", 312 "day_microsecond", 313 "day_minute", 314 "dayname", 315 "dayofmonth", 316 "dayofweek", 317 "dayofyear", 318 "day_second", 319 "deallocate", 320 "dec", 321 "decimal", 322 "declare", 323 "decode", 324 "default", 325 "defaults", 326 "deferrable", 327 "deferred", 328 "defined", 329 "definer", 330 "degrees", 331 "delayed", 332 "delay_key_write", 333 "delete", 334 "delimiter", 335 "delimiters", 336 "dense_rank", 337 "desc", 338 "describe", 339 "detach", 340 "deterministic", 341 "dictionary", 342 "differential", 343 "directory", 344 "disable", 345 "discard", 346 "_disconnect", 347 "disk", 348 "distinct", 349 "distinctrow", 350 "distributed_joins", 351 "div", 352 "do", 353 "document", 354 "domain", 355 "dot_product", 356 "double", 357 "drop", 358 "_drop_profile", 359 "dual", 360 "dump", 361 "duplicate", 362 "dynamic", 363 "earliest", 364 "each", 365 "echo", 366 "election", 367 "else", 368 "elseif", 369 "elt", 370 "enable", 371 "enclosed", 372 "encoding", 373 "encrypted", 374 "end", 375 "engine", 376 "engines", 377 "enum", 378 "errors", 379 "escape", 380 "escaped", 381 "estimate", 382 "euclidean_distance", 383 "event", 384 "events", 385 "except", 386 "exclude", 387 "excluding", 388 "exclusive", 389 "execute", 390 "exists", 391 "exit", 392 "exp", 393 "explain", 394 "extended", 395 "extension", 396 "external", 397 "external_host", 398 "external_port", 399 "extract", 400 "extractor", 401 "extractors", 402 "extra_join", 403 "_failover", 404 "failed_login_attempts", 405 "failure", 406 "false", 407 "family", 408 "fault", 409 "fetch", 410 "field", 411 "fields", 412 "file", 413 "files", 414 "fill", 415 "first", 416 "first_value", 417 "fix_alter", 418 "fixed", 419 "float", 420 "float4", 421 "float8", 422 "floor", 423 "flush", 424 "following", 425 "for", 426 "force", 427 "force_compiled_mode", 428 "force_interpreter_mode", 429 "foreground", 430 "foreign", 431 "format", 432 "forward", 433 "found_rows", 434 "freeze", 435 "from", 436 "from_base64", 437 "from_days", 438 "from_unixtime", 439 "fs", 440 "_fsync", 441 "full", 442 "fulltext", 443 "function", 444 "functions", 445 "gc", 446 "gcs", 447 "get_format", 448 "_gc", 449 "_gcx", 450 "generate", 451 "geography", 452 "geography_area", 453 "geography_contains", 454 "geography_distance", 455 "geography_intersects", 456 "geography_latitude", 457 "geography_length", 458 "geography_longitude", 459 "geographypoint", 460 "geography_point", 461 "geography_within_distance", 462 "geometry", 463 "geometry_area", 464 "geometry_contains", 465 "geometry_distance", 466 "geometry_filter", 467 "geometry_intersects", 468 "geometry_length", 469 "geometrypoint", 470 "geometry_point", 471 "geometry_within_distance", 472 "geometry_x", 473 "geometry_y", 474 "global", 475 "_global_version_timestamp", 476 "grant", 477 "granted", 478 "grants", 479 "greatest", 480 "group", 481 "grouping", 482 "groups", 483 "group_concat", 484 "gzip", 485 "handle", 486 "handler", 487 "hard_cpu_limit_percentage", 488 "hash", 489 "has_temp_tables", 490 "having", 491 "hdfs", 492 "header", 493 "heartbeat_no_logging", 494 "hex", 495 "highlight", 496 "high_priority", 497 "hold", 498 "holding", 499 "host", 500 "hosts", 501 "hour", 502 "hour_microsecond", 503 "hour_minute", 504 "hour_second", 505 "identified", 506 "identity", 507 "if", 508 "ifnull", 509 "ignore", 510 "ilike", 511 "immediate", 512 "immutable", 513 "implicit", 514 "import", 515 "in", 516 "including", 517 "increment", 518 "incremental", 519 "index", 520 "indexes", 521 "inet_aton", 522 "inet_ntoa", 523 "inet6_aton", 524 "inet6_ntoa", 525 "infile", 526 "inherit", 527 "inherits", 528 "_init_profile", 529 "init", 530 "initcap", 531 "initialize", 532 "initially", 533 "inject", 534 "inline", 535 "inner", 536 "inout", 537 "input", 538 "insensitive", 539 "insert", 540 "insert_method", 541 "instance", 542 "instead", 543 "instr", 544 "int", 545 "int1", 546 "int2", 547 "int3", 548 "int4", 549 "int8", 550 "integer", 551 "_internal_dynamic_typecast", 552 "interpreter_mode", 553 "intersect", 554 "interval", 555 "into", 556 "invoker", 557 "is", 558 "isnull", 559 "isolation", 560 "iterate", 561 "join", 562 "json", 563 "json_agg", 564 "json_array_contains_double", 565 "json_array_contains_json", 566 "json_array_contains_string", 567 "json_array_push_double", 568 "json_array_push_json", 569 "json_array_push_string", 570 "json_delete_key", 571 "json_extract_double", 572 "json_extract_json", 573 "json_extract_string", 574 "json_extract_bigint", 575 "json_get_type", 576 "json_length", 577 "json_set_double", 578 "json_set_json", 579 "json_set_string", 580 "json_splice_double", 581 "json_splice_json", 582 "json_splice_string", 583 "kafka", 584 "key", 585 "key_block_size", 586 "keys", 587 "kill", 588 "killall", 589 "label", 590 "lag", 591 "language", 592 "large", 593 "last", 594 "last_day", 595 "last_insert_id", 596 "last_value", 597 "lateral", 598 "latest", 599 "lc_collate", 600 "lc_ctype", 601 "lcase", 602 "lead", 603 "leading", 604 "leaf", 605 "leakproof", 606 "least", 607 "leave", 608 "leaves", 609 "left", 610 "length", 611 "level", 612 "license", 613 "like", 614 "limit", 615 "lines", 616 "listen", 617 "llvm", 618 "ln", 619 "load", 620 "loaddata_where", 621 "_load", 622 "local", 623 "localtime", 624 "localtimestamp", 625 "locate", 626 "location", 627 "lock", 628 "log", 629 "log10", 630 "log2", 631 "long", 632 "longblob", 633 "longtext", 634 "loop", 635 "lower", 636 "low_priority", 637 "lpad", 638 "_ls", 639 "ltrim", 640 "lz4", 641 "management", 642 "_management_thread", 643 "mapping", 644 "master", 645 "match", 646 "materialized", 647 "max", 648 "maxvalue", 649 "max_concurrency", 650 "max_errors", 651 "max_partitions_per_batch", 652 "max_queue_depth", 653 "max_retries_per_batch_partition", 654 "max_rows", 655 "mbc", 656 "md5", 657 "mpl", 658 "median", 659 "mediumblob", 660 "mediumint", 661 "mediumtext", 662 "member", 663 "memory", 664 "memory_percentage", 665 "_memsql_table_id_lookup", 666 "memsql", 667 "memsql_deserialize", 668 "memsql_imitating_kafka", 669 "memsql_serialize", 670 "merge", 671 "metadata", 672 "microsecond", 673 "middleint", 674 "min", 675 "min_rows", 676 "minus", 677 "minute", 678 "minute_microsecond", 679 "minute_second", 680 "minvalue", 681 "mod", 682 "mode", 683 "model", 684 "modifies", 685 "modify", 686 "month", 687 "monthname", 688 "months_between", 689 "move", 690 "mpl", 691 "names", 692 "named", 693 "namespace", 694 "national", 695 "natural", 696 "nchar", 697 "next", 698 "no", 699 "node", 700 "none", 701 "no_query_rewrite", 702 "noparam", 703 "not", 704 "nothing", 705 "notify", 706 "now", 707 "nowait", 708 "no_write_to_binlog", 709 "no_query_rewrite", 710 "norely", 711 "nth_value", 712 "ntile", 713 "null", 714 "nullcols", 715 "nullif", 716 "nulls", 717 "numeric", 718 "nvarchar", 719 "object", 720 "octet_length", 721 "of", 722 "off", 723 "offline", 724 "offset", 725 "offsets", 726 "oids", 727 "on", 728 "online", 729 "only", 730 "open", 731 "operator", 732 "optimization", 733 "optimize", 734 "optimizer", 735 "optimizer_state", 736 "option", 737 "options", 738 "optionally", 739 "or", 740 "order", 741 "ordered_serialize", 742 "orphan", 743 "out", 744 "out_of_order", 745 "outer", 746 "outfile", 747 "over", 748 "overlaps", 749 "overlay", 750 "owned", 751 "owner", 752 "pack_keys", 753 "paired", 754 "parser", 755 "parquet", 756 "partial", 757 "partition", 758 "partition_id", 759 "partitioning", 760 "partitions", 761 "passing", 762 "password", 763 "password_lock_time", 764 "parser", 765 "pause", 766 "_pause_replay", 767 "percent_rank", 768 "percentile_cont", 769 "percentile_disc", 770 "periodic", 771 "persisted", 772 "pi", 773 "pipeline", 774 "pipelines", 775 "pivot", 776 "placing", 777 "plan", 778 "plans", 779 "plancache", 780 "plugins", 781 "pool", 782 "pools", 783 "port", 784 "position", 785 "pow", 786 "power", 787 "preceding", 788 "precision", 789 "prepare", 790 "prepared", 791 "preserve", 792 "primary", 793 "prior", 794 "privileges", 795 "procedural", 796 "procedure", 797 "procedures", 798 "process", 799 "processlist", 800 "profile", 801 "profiles", 802 "program", 803 "promote", 804 "proxy", 805 "purge", 806 "quarter", 807 "queries", 808 "query", 809 "query_timeout", 810 "queue", 811 "quote", 812 "radians", 813 "rand", 814 "range", 815 "rank", 816 "read", 817 "_read", 818 "reads", 819 "real", 820 "reassign", 821 "rebalance", 822 "recheck", 823 "record", 824 "recursive", 825 "redundancy", 826 "redundant", 827 "ref", 828 "reference", 829 "references", 830 "refresh", 831 "regexp", 832 "reindex", 833 "relative", 834 "release", 835 "reload", 836 "rely", 837 "remote", 838 "remove", 839 "rename", 840 "repair", 841 "_repair_table", 842 "repeat", 843 "repeatable", 844 "_repl", 845 "_reprovisioning", 846 "replace", 847 "replica", 848 "replicate", 849 "replicating", 850 "replication", 851 "durability", 852 "require", 853 "resource", 854 "resource_pool", 855 "reset", 856 "restart", 857 "restore", 858 "restrict", 859 "result", 860 "_resurrect", 861 "retry", 862 "return", 863 "returning", 864 "returns", 865 "reverse", 866 "revoke", 867 "rg_pool", 868 "right", 869 "right_anti_join", 870 "right_semi_join", 871 "right_straight_join", 872 "rlike", 873 "role", 874 "roles", 875 "rollback", 876 "rollup", 877 "round", 878 "routine", 879 "row", 880 "row_count", 881 "row_format", 882 "row_number", 883 "rows", 884 "rowstore", 885 "rule", 886 "rpad", 887 "_rpc", 888 "rtrim", 889 "running", 890 "s3", 891 "safe", 892 "save", 893 "savepoint", 894 "scalar", 895 "schema", 896 "schemas", 897 "schema_binding", 898 "scroll", 899 "search", 900 "second", 901 "second_microsecond", 902 "sec_to_time", 903 "security", 904 "select", 905 "semi_join", 906 "_send_threads", 907 "sensitive", 908 "separator", 909 "sequence", 910 "sequences", 911 "serial", 912 "serializable", 913 "series", 914 "service_user", 915 "server", 916 "session", 917 "session_user", 918 "set", 919 "setof", 920 "security_lists_intersect", 921 "sha", 922 "sha1", 923 "sha2", 924 "shard", 925 "sharded", 926 "sharded_id", 927 "share", 928 "show", 929 "shutdown", 930 "sigmoid", 931 "sign", 932 "signal", 933 "similar", 934 "simple", 935 "site", 936 "signed", 937 "sin", 938 "skip", 939 "skipped_batches", 940 "sleep", 941 "_sleep", 942 "smallint", 943 "snapshot", 944 "_snapshot", 945 "_snapshots", 946 "soft_cpu_limit_percentage", 947 "some", 948 "soname", 949 "sparse", 950 "spatial", 951 "spatial_check_index", 952 "specific", 953 "split", 954 "sql", 955 "sql_big_result", 956 "sql_buffer_result", 957 "sql_cache", 958 "sql_calc_found_rows", 959 "sqlexception", 960 "sql_mode", 961 "sql_no_cache", 962 "sql_no_logging", 963 "sql_small_result", 964 "sqlstate", 965 "sqlwarning", 966 "sqrt", 967 "ssl", 968 "stable", 969 "standalone", 970 "start", 971 "starting", 972 "state", 973 "statement", 974 "statistics", 975 "stats", 976 "status", 977 "std", 978 "stddev", 979 "stddev_pop", 980 "stddev_samp", 981 "stdin", 982 "stdout", 983 "stop", 984 "storage", 985 "str_to_date", 986 "straight_join", 987 "strict", 988 "string", 989 "strip", 990 "subdate", 991 "substr", 992 "substring", 993 "substring_index", 994 "success", 995 "sum", 996 "super", 997 "symmetric", 998 "sync_snapshot", 999 "sync", 1000 "_sync", 1001 "_sync2", 1002 "_sync_partitions", 1003 "_sync_snapshot", 1004 "synchronize", 1005 "sysid", 1006 "system", 1007 "table", 1008 "table_checksum", 1009 "tables", 1010 "tablespace", 1011 "tags", 1012 "tan", 1013 "target_size", 1014 "task", 1015 "temp", 1016 "template", 1017 "temporary", 1018 "temptable", 1019 "_term_bump", 1020 "terminate", 1021 "terminated", 1022 "test", 1023 "text", 1024 "then", 1025 "time", 1026 "timediff", 1027 "time_bucket", 1028 "time_format", 1029 "timeout", 1030 "timestamp", 1031 "timestampadd", 1032 "timestampdiff", 1033 "timezone", 1034 "time_to_sec", 1035 "tinyblob", 1036 "tinyint", 1037 "tinytext", 1038 "to", 1039 "to_base64", 1040 "to_char", 1041 "to_date", 1042 "to_days", 1043 "to_json", 1044 "to_number", 1045 "to_seconds", 1046 "to_timestamp", 1047 "tracelogs", 1048 "traditional", 1049 "trailing", 1050 "transform", 1051 "transaction", 1052 "_transactions_experimental", 1053 "treat", 1054 "trigger", 1055 "triggers", 1056 "trim", 1057 "true", 1058 "trunc", 1059 "truncate", 1060 "trusted", 1061 "two_phase", 1062 "_twopcid", 1063 "type", 1064 "types", 1065 "ucase", 1066 "unbounded", 1067 "uncommitted", 1068 "undefined", 1069 "undo", 1070 "unencrypted", 1071 "unenforced", 1072 "unhex", 1073 "unhold", 1074 "unicode", 1075 "union", 1076 "unique", 1077 "_unittest", 1078 "unix_timestamp", 1079 "unknown", 1080 "unlisten", 1081 "_unload", 1082 "unlock", 1083 "unlogged", 1084 "unpivot", 1085 "unsigned", 1086 "until", 1087 "update", 1088 "upgrade", 1089 "upper", 1090 "usage", 1091 "use", 1092 "user", 1093 "users", 1094 "using", 1095 "utc_date", 1096 "utc_time", 1097 "utc_timestamp", 1098 "_utf8", 1099 "vacuum", 1100 "valid", 1101 "validate", 1102 "validator", 1103 "value", 1104 "values", 1105 "varbinary", 1106 "varchar", 1107 "varcharacter", 1108 "variables", 1109 "variadic", 1110 "variance", 1111 "var_pop", 1112 "var_samp", 1113 "varying", 1114 "vector_sub", 1115 "verbose", 1116 "version", 1117 "view", 1118 "void", 1119 "volatile", 1120 "voting", 1121 "wait", 1122 "_wake", 1123 "warnings", 1124 "week", 1125 "weekday", 1126 "weekofyear", 1127 "when", 1128 "where", 1129 "while", 1130 "whitespace", 1131 "window", 1132 "with", 1133 "without", 1134 "within", 1135 "_wm_heartbeat", 1136 "work", 1137 "workload", 1138 "wrapper", 1139 "write", 1140 "xact_id", 1141 "xor", 1142 "year", 1143 "year_month", 1144 "yes", 1145 "zerofill", 1146 "zone", 1147 }
Generator converts a given syntax tree to the corresponding SQL string.
Arguments:
- pretty: Whether to format the produced SQL string. Default: False.
- identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
- normalize: Whether to normalize identifiers to lowercase. Default: False.
- pad: The pad size in a formatted string. For example, this affects the indentation of a projection in a query, relative to its nesting level. Default: 2.
- indent: The indentation size in a formatted string. For example, this affects the
indentation of subqueries and filters under a
WHEREclause. Default: 2. - normalize_functions: How to normalize function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
- unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
- max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
- leading_comma: Whether the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
- max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
- comments: Whether to preserve comments in the output SQL code. Default: True
TRANSFORMS =
{<class 'sqlglot.expressions.JSONPathFilter'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathKey'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathRecursive'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathRoot'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathScript'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathSelector'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathSlice'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathUnion'>: <function <lambda>>, <class 'sqlglot.expressions.JSONPathWildcard'>: <function <lambda>>, <class 'sqlglot.expressions.AllowedValuesProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AnalyzeColumns'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AnalyzeWith'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ArrayContainsAll'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ArrayOverlaps'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.BackupProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Ceil'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CommentColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ConnectByRoot'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ConvertToCharset'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CredentialsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DateFormatColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DefaultColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DynamicProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EmptyProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EncodeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EnviromentProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EphemeralColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExcludeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Except'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExternalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Floor'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Get'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.GlobalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.HeapProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IcebergProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InheritsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InlineLengthColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Intersect'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Int64'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LanguageProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LocationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.MaterializedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NonClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NotForReplicationColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnCommitProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnUpdateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Operator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OutputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PathColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PartitionedByBucket'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PartitionByTruncate'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PivotAny'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PositionalColumn'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ProjectionPolicyColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Put'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ReturnsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SampleProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SecureProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetConfigProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SettingsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SharingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StabilityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Stream'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StreamingTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StrictProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SwapTable'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TableColumn'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Tags'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ToMap'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ToTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransformModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransientProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Union'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UnloggedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UsingTemplateProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UsingData'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Uuid'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VarMap'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ViewAttributeProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithProcedureOptions'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithSchemaBindingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithOperator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ForceProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ArrayAgg'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CurrentDate'>: <function no_paren_current_date_sql>, <class 'sqlglot.expressions.DateDiff'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DateAdd'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DateStrToDate'>: <function datestrtodate_sql>, <class 'sqlglot.expressions.DateSub'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DateTrunc'>: <function _date_trunc_sql>, <class 'sqlglot.expressions.Day'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DayOfMonth'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DayOfWeek'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.DayOfYear'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.GroupConcat'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.ILike'>: <function no_ilike_sql>, <class 'sqlglot.expressions.JSONExtractScalar'>: <function arrow_json_extract_sql>, <class 'sqlglot.expressions.Length'>: <function length_or_char_length_sql>, <class 'sqlglot.expressions.LogicalOr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.LogicalAnd'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Max'>: <function max_or_greatest>, <class 'sqlglot.expressions.Min'>: <function min_or_least>, <class 'sqlglot.expressions.Month'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.NullSafeEQ'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.NullSafeNEQ'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.NumberToStr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Pivot'>: <function no_pivot_sql>, <class 'sqlglot.expressions.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.StrPosition'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.StrToDate'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.StrToTime'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.Stuff'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.TableSample'>: <function no_tablesample_sql>, <class 'sqlglot.expressions.TimeFromParts'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.TimestampAdd'>: <function date_add_interval_sql.<locals>.func>, <class 'sqlglot.expressions.TimestampDiff'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.TimestampSub'>: <function date_add_interval_sql.<locals>.func>, <class 'sqlglot.expressions.TimeStrToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.TimeStrToTime'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.TimeToStr'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.Trim'>: <function trim_sql>, <class 'sqlglot.expressions.TryCast'>: <function no_trycast_sql>, <class 'sqlglot.expressions.TsOrDsAdd'>: <function date_add_sql.<locals>.func>, <class 'sqlglot.expressions.TsOrDsDiff'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.TsOrDsToDate'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.Unicode'>: <function MySQL.Generator.<lambda>>, <class 'sqlglot.expressions.UnixToTime'>: <function _unix_to_time_sql>, <class 'sqlglot.expressions.Week'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.WeekOfYear'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.Year'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.ToChar'>: <function SingleStore.Generator.<lambda>>}
RESERVED_KEYWORDS =
{'date', 'bootstrap', 'timeout', 'convert_tz', 'value', 'float', 'roles', 'trigger', 'backup', 'int8', 'signal', 'passing', 'member', 'aggregates', 'collect', 'json_splice_json', 'leaf', 'family', 'preserve', 'subdate', 'varcharacter', 'columnstore', '_ls', 'dual', 'fix_alter', 'content', 'replicating', 'sequences', 'bool', 'stddev_pop', 'xor', 'not', 'plans', 'xact_id', 'conversion', 'distinctrow', 'outer', 'open', 'volatile', 'latest', 'optimizer_state', 'share', 'execute', 'killall', 'utc_date', 'semi_join', 'including', 'detach', 'admin', 'ascii', 'node', 'right_straight_join', 'init', 'euclidean_distance', 'immediate', 'license', 'order', 'sharded_id', 'values', 'locate', 'avro', 'first', 'character', 'header', 'from_days', 'int1', 'require', 'restart', 'parser', 'schema_binding', 'ssl', 'local', 'delimiters', 'sleep', 'maxvalue', 'high_priority', 'asin', 'update', 'after', 'all', 'async', 'aes_encrypt', 'loop', 'geometry_filter', 'split', 'ceil', 'using', 'safe', 'unhold', 'length', 'reindex', 'stop', 'aes_decrypt', 'pivot', 'exclude', 'label', 'dynamic', 'call', 'rename', 'timezone', 'log2', 'inet6_aton', 'percent_rank', 'voting', 'byte_length', 'compression', 'pause', 'status', 'void', 'super', 'absolute', 'geometry_contains', 'soft_cpu_limit_percentage', 'day_microsecond', 'datediff', 'delay_key_write', 'online', 'elseif', 'max_rows', 'release', 'host', 'current_catalog', 'implicit', 'begin', 'excluding', 'hex', 'initially', 's3', 'llvm', 'day_minute', 'document', 'ltrim', 'validate', 'partial', 'batch_interval', '_sync_partitions', 'bit_count', 'hold', 'cache', 'else', 'partition', 'credentials', 'traditional', 'quote', 'resource_pool', 'gzip', 'nowait', 'minute_microsecond', 'create', 'for', 'optimization', 'greatest', 'warnings', 'unique', 'octet_length', 'catalog', 'optimize', 'inherits', 'profile', 'geography_distance', 'decode', 'overlay', 'join', 'dayofweek', 'curdate', 'current_user', 'percentile_disc', 'group', 'cnf', 'year', 'ntile', 'pow', 'minute', 'aggregator_plan_hash', 'geometry_point', 'day_hour', '_check_consistency', 'names', 'date_sub', 'hour_minute', 'sync', 'fixed', 'upgrade', 'uncommitted', 'binary', 'clear', 'dot_product', 'disk', 'timestampdiff', 'csv', 'btree', 'serial', 'object', 'sha1', 'current_schema', 'monthname', '_sync', 'geography_area', 'against', 'bit_xor', 'compact', 'model', 'dayofmonth', 'external_port', 'deferred', 'prior', 'undefined', 'leading', 'function', 'search', 'replicate', 'to_json', 'nullif', 'with', 'max', 'plugins', 'domain', 'max_queue_depth', 'json_set_double', 'nothing', 'cross', '_sleep', 'right_anti_join', '_checksum', 'get_format', 'databases', 'day', 'instead', 'rely', 'stddev_samp', 'ref', 'directory', 'encoding', 'deferrable', 'var_pop', 'cume_dist', 'reset', 'unhex', 'temporary', 'adddate', 'tracelogs', 'foreign', '_transactions_experimental', 'ignore', 'orphan', 'tags', 'concat', 'schemas', 'target_size', 'language', 'array', 'statement', 'synchronize', 'background', '_sync_snapshot', 'current_time', 'lead', 'geometry_y', 'inet_ntoa', 'offline', 'unlock', 'comment', 'cursor', 'dec', 'varbinary', 'identified', 'variance', 'until', 'forward', 'memsql_imitating_kafka', 'minute_second', 'authorization', '_resurrect', 'constraints', '_commit_log_tail', 'intersect', 'offsets', 'min_rows', 'loaddata_where', 'count', 'auto_increment', 'tables', '_wm_heartbeat', 'out_of_order', 'lcase', 'optimizer', 'second', 'sparse', 'server', 'repeat', 'sql_mode', 'any_value', 'substr', 'json_extract_double', 'json_splice_string', 'abs', 'queries', 'vacuum', 'json_array_contains_double', 'pipeline', 'bit', 'dayname', 'hour_microsecond', 'microsecond', 'test', 'relative', 'differential', 'connection', 'action', 'avg_row_length', 'convert', 'config', 'engines', 'initialize', 'starting', 'bit_and', 'trunc', '_pause_replay', 'date_trunc', 'transform', 'checkpoint', 'master', 'numeric', 'sql_buffer_result', '_gcx', 'geography_intersects', 'string', 'asymmetric', 'approx_count_distinct', 'approx_percentile', 'always', 'time_format', 'isolation', 'restrict', 'users', 'next', 'current_security_groups', 'avg', 'program', 'rlike', 'degrees', 'extractor', 'in', 'lines', 'approx_count_distinct_combine', 'keys', 'routine', 'at', 'longblob', 'separator', 'max_concurrency', 'auto', 'copy', 'insert', 'outfile', 'analyse', 'instr', 'namespace', 'ilike', 'sqlwarning', 'select', 'recursive', 'left', 'extended', 'max_retries_per_batch_partition', 'months_between', 'replace', 'comments', '_core', 'reference', 'range', 'procedural', 'except', 'reads', 'compressed', 'nvarchar', 'encrypted', 'add', 'unknown', 'password_lock_time', 'integer', 'backup_history', 'stdout', 'date_format', 'grouping', 'extractors', 'norely', 'rollback', 'before', 'write', 'none', 'bin', 'mode', 'false', 'storage', 'hash', 'prepared', 'batch', 'terminate', 'query_timeout', 'variadic', 'log10', 'unlisten', 'time_to_sec', 'cube', 'pool', 'condition', 'minvalue', 'byte', '_disconnect', 'mpl', 'union', 'to_number', 'sqlexception', 'then', 'procedure', 'availability', '_check_can_connect', 'aggregator_id', 'pipelines', 'wrapper', 'oids', 'owned', 'show', 'defined', 'skip', 'int2', '_init_profile', 'no_query_rewrite', 'mediumblob', 'reload', 'retry', 'highlight', 'mod', 'return', 'autostats_cardinality_mode', 'to', 'both', 'unix_timestamp', 'has_temp_tables', 'interpreter_mode', 'on', 'processlist', 'use', 'columns', 'site', 'variables', 'some', 'table_checksum', 'option', 'temptable', 'varying', 'generate', 'aggregator', 'lpad', 'dictionary', 'blob', 'true', 'strict', 'group_concat', 'rtrim', 'standalone', 'placing', 'varchar', 'scalar', 'inline', 'geometry_distance', 'profiles', 'sequence', 'elt', 'substring_index', 'identity', '_unload', 'fields', 'hour', 'tinyblob', 'immutable', 'from_base64', 'text', 'month', 'notify', 'view', 'concat_ws', 'time', 'extension', 'serializable', 'low_priority', 'sql_calc_found_rows', 'var_samp', 'options', 'json_array_push_json', 'columnar', 'lz4', 'force_interpreter_mode', 'having', 'transaction', 'within', 'usage', 'no', 'geography_point', 'input', 'national', 'client', '_fsync', 'auto_reprovision', 'table', 'insensitive', 'lc_ctype', 'row_format', 'to_days', 'event', 'paired', 'resource', 'class', 'isnull', 'when', 'engine', 'heartbeat_no_logging', 'smallint', 'by', 'geography_within_distance', 'enclosed', 'inner', '_read', 'geometry', 'row_number', 'account', 'backup_id', '_wake', 'end', 'case', 'query', 'lateral', 'sharded', 'geometry_length', 'duplicate', 'save', 'from', 'asc', 'concurrently', 'second_microsecond', 'unbounded', '_failover', 'collate', 'leakproof', 'savepoint', 'algorithm', 'gc', 'characteristics', 'or', 'as', 'acos', 'tan', 'fill', 'configuration', 'timestamp', 'to_char', 'template', 'insert_method', 'enum', 'current_security_roles', 'external', 'strip', 'assignment', 'record', 'grant', 'revoke', 'parquet', 'merge', 'stddev', 'named', 'offset', 'unenforced', 'geography_length', 'ordered_serialize', 'pools', '_utf8', 'geography_contains', 'window', 'terminated', 'proxy', 'treat', 'periodic', 'sigmoid', '_rpc', 'similar', 'to_timestamp', 'modify', 'zerofill', 'full', 'hdfs', 'bigint', 'repeatable', 'inherit', 'gcs', 'client_found_rows', 'sqrt', 'mbc', 'workload', 'memory_percentage', 'tinyint', 'handle', 'memsql_serialize', 'defaults', 'current', 'exp', 'timestampadd', '_drop_profile', 'purge', 'truncate', 'log', 'dump', 'ifnull', 'sin', 'management', 'task', 'undo', 'database', 'day_second', 'addtime', 'rebalance', 'indexes', 'hosts', 'substring', 'primary', 'now', 'first_value', 'signed', 'autostats', '_background_threads_for_cleanup', 'geography', 'weekofyear', 'do', 'import', 'off', 'bit_or', 'yes', 'is', 'last_day', 'preceding', 'capture', 'memsql', 'out', 'plan', 'approx_count_distinct_estimate', 'utc_time', 'dayofyear', 'initcap', 'geometry_within_distance', 'force', 'inet_aton', 'sha2', 'service_user', 'sign', 'overlaps', 'zone', 'level', 'clustered', 'floor', 'continue', 'exists', 'json_agg', 'json_set_json', 'data', 'character_length', 'deallocate', 'attribute', 'delayed', 'operator', '_continue_replay', 'procedures', 'asensitive', 'disable', 'to_seconds', 'inout', 'between', 'rank', 'found_rows', 'json_delete_key', 'round', 'weekday', 'sync_snapshot', 'max_errors', 'iterate', 'failed_login_attempts', 'echo', 'trusted', 'int4', 'like', 'repair', 'datetime', 'nulls', 'desc', 'approx_count_distinct_accumulate', 'promote', 'cot', 'int3', 'enable', 'following', 'inet6_ntoa', 'timediff', 'sql_cache', 'unencrypted', 'access', 'version', 'redundant', 'unicode', 'trailing', 'durability', 'minus', 'events', 'geometry_intersects', 'std', 'dense_rank', 'time_bucket', 'json_array_push_string', '_memsql_table_id_lookup', 'listen', 'cascaded', 'row_count', 'current_timestamp', 'geometry_area', 'whitespace', 'lag', 'hard_cpu_limit_percentage', 'fetch', 'exit', 'field', 'analyze', 'power', 'div', 'geographypoint', 'kill', 'spatial_check_index', 'move', 'reverse', 'compile', 'functions', 'security_lists_intersect', 'holding', 'port', 'cycle', 'position', 'char_length', 'wait', 'leave', 'right', 'arrangement', 'autostats_sampling', 'ceiling', '_gc', 'setof', 'tinytext', '_repl', 'skipped_batches', 'into', 'earliest', 'each', 'str_to_date', 'sec_to_time', '_bt', 'json_get_type', 'remove', 'also', 'symmetric', 'aggregators', '_snapshot', 'specific', 'sql_no_cache', 'schema', '_send_threads', 'last_insert_id', 'delimiter', 'flush', 'int', 'process', '_twopcid', 'real', 'recheck', 'session_user', 'owner', 'shutdown', 'arghistory', 'definer', 'replica', 'azure', 'two_phase', 'of', 'freeze', '_unittest', 'alter', 'aggregate', 'json_array_contains_json', 'sql_no_logging', 'materialized', 'over', 'memsql_deserialize', 'prepare', 'queue', 'without', 'json_array_contains_string', 'decimal', 'columnstore_segment_rows', 'json_array_push_double', 'checksum', 'success', 'middleint', 'restore', 'valid', 'security', 'remote', 'verbose', 'if', 'failure', 'attach', 'limit', 'scroll', 'collation', 'estimate', 'call_for_pipeline', 'localtime', 'backward', 'distributed_joins', 'declare', 'extra_join', 'geometry_x', 'nth_value', 'external_host', 'global', 'last', 'simple', 'cos', 'commit', 'any', 'precision', 'connections', 'kafka', 'hour_second', 'work', 'json_extract_json', '_term_bump', '_binary', 'metadata', 'ucase', 'incremental', 'cascade', 'fs', 'increment', 'current_date', 'nullcols', 'distinct', 'atan2', 'percentile_cont', 'redundancy', 'pi', 'coalesce', 'chain', 'json_extract_bigint', 'default', 'min', 'md5', 'geography_longitude', 'cost', '_snapshots', 'noparam', 'triggers', 'explain', 'modifies', 'system', 'groups', 'spatial', 'boolean', 'returns', 'lc_collate', 'shard', 'files', 'cluster', 'type', 'references', 'deterministic', 'session', 'constraint', 'ast', 'max_partitions_per_batch', 'mediumint', 'rollup', 'start', 'memory', 'while', 'location', 'snapshot', 'unpivot', 'plancache', 'persisted', 'sysid', 'rowstore', 'password', 'column', 'rand', '_management_thread', 'curtime', 'atan', 'batches', 'double', 'last_value', 'nchar', 'natural', 'date_add', 'committed', '_batch_size_limit', 'instance', 'lower', 'charset', 'vector_sub', 'sha', 'geography_latitude', 'user', 'key_block_size', 'replication', '_repair_table', 'stdin', 'interval', 'rows', 'foreground', 'check', 'autostats_histogram_mode', 'asm', 'geometrypoint', 'float8', 'autostats_enabled', 'infile', 'fulltext', 'election', 'privileges', 'state', 'unlogged', 'current_role', 'longtext', '_global_version_timestamp', 'lock', 'escape', 'partition_id', 'close', 'long', 'json', 'no_write_to_binlog', 'null', 'partitioning', 'rule', 'escaped', 'rg_pool', 'called', 'straight_join', 'sensitive', 'to_base64', 'to_date', 'trim', 'approx_geography_intersects', 'sql_small_result', 'week', 'arrange', 'refresh', 'extract', 'anti_join', 'invoker', 'where', 'set', 'pack_keys', 'radians', 'float4', 'from_unixtime', 'and', 'coercibility', 'json_length', 'right_semi_join', 'statistics', 'concurrent', 'row', 'bucket_count', 'least', 'sql', 'errors', 'connection_id', 'exclusive', 'delete', 'sum', 'large', 'optionally', 'drop', 'format', 'grants', 'sql_big_result', 'sqlstate', 'median', 'stable', 'tablespace', 'json_extract_string', 'returning', 'types', 'match', 'quarter', 'json_set_string', 'describe', 'leaves', 'only', '_reprovisioning', 'role', 'file', 'utc_timestamp', 'regexp', 'discard', 'load', 'partitions', 'stats', '_load', 'unsigned', '_sync2', 'json_splice_double', 'temp', 'reassign', 'change', 'conv', 'read', 'year_month', 'granted', 'index', 'cast', 'upper', 'fault', 'result', 'handler', 'mediumtext', 'ln', 'running', 'series', 'force_compiled_mode', 'assertion', 'localtimestamp', 'inject', 'mapping', 'rpad', 'validator', 'char', '_internal_dynamic_typecast', 'key', 'soname'}
AFTER_HAVING_MODIFIER_TRANSFORMS =
{'windows': <function Generator.<lambda>>, 'qualify': <function Generator.<lambda>>}
Inherited Members
- sqlglot.generator.Generator
- Generator
- IGNORE_NULLS_IN_FUNC
- EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE
- CREATE_FUNCTION_RETURN_AS
- MATCHED_BY_SOURCE
- SINGLE_STRING_INTERVAL
- RENAME_TABLE_WITH_DB
- GROUPINGS_SEP
- INDEX_ON
- QUERY_HINTS
- IS_BOOL_ALLOWED
- LIMIT_IS_TOP
- RETURNING_END
- EXTRACT_ALLOWS_QUOTES
- TZ_TO_WITH_TIME_ZONE
- ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
- UNNEST_WITH_ORDINALITY
- AGGREGATE_FILTER_SUPPORTED
- SEMI_ANTI_JOIN_WITH_SIDE
- COMPUTED_COLUMN_WITH_TYPE
- SUPPORTS_TABLE_COPY
- TABLESAMPLE_REQUIRES_PARENS
- TABLESAMPLE_SIZE_IS_ROWS
- TABLESAMPLE_KEYWORDS
- TABLESAMPLE_WITH_METHOD
- TABLESAMPLE_SEED_KEYWORD
- COLLATE_IS_FUNC
- DATA_TYPE_SPECIFIERS_ALLOWED
- ENSURE_BOOLS
- CTE_RECURSIVE_KEYWORD_REQUIRED
- SUPPORTS_SINGLE_ARG_CONCAT
- SUPPORTS_TABLE_ALIAS_COLUMNS
- UNPIVOT_ALIASES_ARE_IDENTIFIERS
- INSERT_OVERWRITE
- SUPPORTS_SELECT_INTO
- SUPPORTS_UNLOGGED_TABLES
- SUPPORTS_CREATE_TABLE_LIKE
- LIKE_PROPERTY_INSIDE_SCHEMA
- MULTI_ARG_DISTINCT
- JSON_PATH_SINGLE_QUOTE_ESCAPE
- SUPPORTED_JSON_PATH_PARTS
- CAN_IMPLEMENT_ARRAY_ANY
- SUPPORTS_WINDOW_EXCLUDE
- SET_OP_MODIFIERS
- COPY_PARAMS_ARE_WRAPPED
- COPY_PARAMS_EQ_REQUIRED
- COPY_HAS_INTO_KEYWORD
- STAR_EXCEPT
- HEX_FUNC
- WITH_PROPERTIES_PREFIX
- QUOTE_JSON_PATH
- SUPPORTS_EXPLODING_PROJECTIONS
- ARRAY_CONCAT_IS_VAR_LEN
- SUPPORTS_CONVERT_TIMEZONE
- SUPPORTS_UNIX_SECONDS
- ALTER_SET_WRAPPED
- NORMALIZE_EXTRACT_DATE_PARTS
- ARRAY_SIZE_NAME
- ALTER_SET_TYPE
- ARRAY_SIZE_DIM_REQUIRED
- SUPPORTS_BETWEEN_FLAGS
- SUPPORTS_LIKE_QUANTIFIERS
- TIME_PART_SINGULARS
- TOKEN_MAPPING
- STRUCT_DELIMITER
- PARAMETER_TOKEN
- NAMED_PLACEHOLDER_TOKEN
- EXPRESSION_PRECEDES_PROPERTIES_CREATABLES
- WITH_SEPARATED_COMMENTS
- EXCLUDE_COMMENTS
- UNWRAPPED_INTERVAL_VALUES
- PARAMETERIZABLE_TEXT_TYPES
- EXPRESSIONS_WITHOUT_NESTED_CTES
- RESPECT_IGNORE_NULLS_UNSUPPORTED_EXPRESSIONS
- SENTINEL_LINE_BREAK
- pretty
- identify
- normalize
- pad
- unsupported_level
- max_unsupported
- leading_comma
- max_text_width
- comments
- dialect
- normalize_functions
- unsupported_messages
- generate
- preprocess
- unsupported
- sep
- seg
- sanitize_comment
- maybe_comment
- wrap
- no_identify
- normalize_func
- indent
- sql
- uncache_sql
- cache_sql
- characterset_sql
- column_parts
- column_sql
- columnposition_sql
- columndef_sql
- columnconstraint_sql
- autoincrementcolumnconstraint_sql
- compresscolumnconstraint_sql
- generatedasidentitycolumnconstraint_sql
- generatedasrowcolumnconstraint_sql
- periodforsystemtimeconstraint_sql
- notnullcolumnconstraint_sql
- primarykeycolumnconstraint_sql
- uniquecolumnconstraint_sql
- createable_sql
- create_sql
- sequenceproperties_sql
- clone_sql
- describe_sql
- heredoc_sql
- prepend_ctes
- with_sql
- cte_sql
- tablealias_sql
- bitstring_sql
- hexstring_sql
- bytestring_sql
- unicodestring_sql
- rawstring_sql
- datatypeparam_sql
- directory_sql
- delete_sql
- drop_sql
- set_operation
- set_operations
- fetch_sql
- limitoptions_sql
- filter_sql
- hint_sql
- indexparameters_sql
- index_sql
- identifier_sql
- hex_sql
- lowerhex_sql
- inputoutputformat_sql
- national_sql
- partition_sql
- properties_sql
- root_properties
- properties
- with_properties
- locate_properties
- property_name
- property_sql
- likeproperty_sql
- fallbackproperty_sql
- journalproperty_sql
- freespaceproperty_sql
- checksumproperty_sql
- mergeblockratioproperty_sql
- datablocksizeproperty_sql
- blockcompressionproperty_sql
- isolatedloadingproperty_sql
- partitionboundspec_sql
- partitionedofproperty_sql
- lockingproperty_sql
- withdataproperty_sql
- withsystemversioningproperty_sql
- insert_sql
- introducer_sql
- kill_sql
- pseudotype_sql
- objectidentifier_sql
- onconflict_sql
- returning_sql
- rowformatdelimitedproperty_sql
- withtablehint_sql
- indextablehint_sql
- historicaldata_sql
- table_parts
- table_sql
- tablefromrows_sql
- tablesample_sql
- pivot_sql
- version_sql
- tuple_sql
- update_sql
- values_sql
- var_sql
- into_sql
- from_sql
- groupingsets_sql
- rollup_sql
- cube_sql
- group_sql
- having_sql
- connect_sql
- prior_sql
- join_sql
- lambda_sql
- lateral_op
- lateral_sql
- limit_sql
- offset_sql
- setitem_sql
- set_sql
- pragma_sql
- lock_sql
- literal_sql
- escape_str
- loaddata_sql
- null_sql
- boolean_sql
- order_sql
- withfill_sql
- cluster_sql
- distribute_sql
- sort_sql
- ordered_sql
- matchrecognizemeasure_sql
- matchrecognize_sql
- query_modifiers
- options_modifier
- for_modifiers
- queryoption_sql
- offset_limit_modifiers
- after_limit_modifiers
- select_sql
- schema_sql
- schema_columns_sql
- star_sql
- parameter_sql
- sessionparameter_sql
- placeholder_sql
- subquery_sql
- qualify_sql
- unnest_sql
- prewhere_sql
- where_sql
- window_sql
- partition_by_sql
- windowspec_sql
- withingroup_sql
- between_sql
- bracket_offset_expressions
- bracket_sql
- all_sql
- any_sql
- exists_sql
- case_sql
- constraint_sql
- nextvaluefor_sql
- trim_sql
- convert_concat_args
- concat_sql
- concatws_sql
- check_sql
- foreignkey_sql
- primarykey_sql
- if_sql
- matchagainst_sql
- jsonkeyvalue_sql
- jsonpath_sql
- json_path_part
- formatjson_sql
- formatphrase_sql
- jsonobject_sql
- jsonobjectagg_sql
- jsonarray_sql
- jsonarrayagg_sql
- jsoncolumndef_sql
- jsonschema_sql
- jsontable_sql
- openjsoncolumndef_sql
- openjson_sql
- in_sql
- in_unnest_op
- interval_sql
- return_sql
- reference_sql
- anonymous_sql
- paren_sql
- neg_sql
- not_sql
- alias_sql
- pivotalias_sql
- aliases_sql
- atindex_sql
- fromtimezone_sql
- add_sql
- and_sql
- or_sql
- xor_sql
- connector_sql
- bitwiseand_sql
- bitwiseleftshift_sql
- bitwisenot_sql
- bitwiseor_sql
- bitwiserightshift_sql
- bitwisexor_sql
- currentdate_sql
- collate_sql
- command_sql
- comment_sql
- mergetreettlaction_sql
- mergetreettl_sql
- transaction_sql
- commit_sql
- rollback_sql
- alterindex_sql
- alterdiststyle_sql
- altersortkey_sql
- alterrename_sql
- renamecolumn_sql
- alterset_sql
- alter_sql
- add_column_sql
- droppartition_sql
- addconstraint_sql
- addpartition_sql
- distinct_sql
- ignorenulls_sql
- respectnulls_sql
- havingmax_sql
- intdiv_sql
- div_sql
- safedivide_sql
- overlaps_sql
- distance_sql
- dot_sql
- eq_sql
- propertyeq_sql
- escape_sql
- glob_sql
- gt_sql
- gte_sql
- is_sql
- like_sql
- ilike_sql
- similarto_sql
- lt_sql
- lte_sql
- mod_sql
- mul_sql
- neq_sql
- nullsafeeq_sql
- nullsafeneq_sql
- slice_sql
- sub_sql
- trycast_sql
- jsoncast_sql
- try_sql
- log_sql
- use_sql
- binary
- ceil_floor
- function_fallback_sql
- func
- format_args
- too_wide
- format_time
- expressions
- op_expressions
- naked_property
- tag_sql
- token_sql
- userdefinedfunction_sql
- joinhint_sql
- kwarg_sql
- when_sql
- whens_sql
- merge_sql
- tochar_sql
- tonumber_sql
- dictproperty_sql
- dictrange_sql
- dictsubproperty_sql
- duplicatekeyproperty_sql
- uniquekeyproperty_sql
- distributedbyproperty_sql
- oncluster_sql
- clusteredbyproperty_sql
- anyvalue_sql
- querytransform_sql
- indexconstraintoption_sql
- checkcolumnconstraint_sql
- indexcolumnconstraint_sql
- nvl2_sql
- comprehension_sql
- columnprefix_sql
- opclass_sql
- predict_sql
- forin_sql
- refresh_sql
- toarray_sql
- tsordstotime_sql
- tsordstotimestamp_sql
- tsordstodatetime_sql
- tsordstodate_sql
- unixdate_sql
- lastday_sql
- dateadd_sql
- arrayany_sql
- struct_sql
- partitionrange_sql
- truncatetable_sql
- convert_sql
- copyparameter_sql
- credentials_sql
- copy_sql
- semicolon_sql
- datadeletionproperty_sql
- maskingpolicycolumnconstraint_sql
- gapfill_sql
- scope_resolution
- scoperesolution_sql
- parsejson_sql
- rand_sql
- changes_sql
- pad_sql
- summarize_sql
- explodinggenerateseries_sql
- arrayconcat_sql
- json_sql
- jsonvalue_sql
- conditionalinsert_sql
- multitableinserts_sql
- oncondition_sql
- jsonextractquote_sql
- jsonexists_sql
- arrayagg_sql
- apply_sql
- grant_sql
- grantprivilege_sql
- grantprincipal_sql
- columns_sql
- overlay_sql
- todouble_sql
- string_sql
- median_sql
- overflowtruncatebehavior_sql
- unixseconds_sql
- arraysize_sql
- attach_sql
- detach_sql
- attachoption_sql
- featuresattime_sql
- watermarkcolumnconstraint_sql
- encodeproperty_sql
- includeproperty_sql
- xmlelement_sql
- xmlkeyvalueoption_sql
- partitionbyrangeproperty_sql
- partitionbyrangepropertydynamic_sql
- unpivotcolumns_sql
- analyzesample_sql
- analyzestatistics_sql
- analyzehistogram_sql
- analyzedelete_sql
- analyzelistchainedrows_sql
- analyzevalidate_sql
- analyze_sql
- xmltable_sql
- xmlnamespace_sql
- export_sql
- declare_sql
- declareitem_sql
- recursivewithsearch_sql
- parameterizedagg_sql
- anonymousaggfunc_sql
- combinedaggfunc_sql
- combinedparameterizedagg_sql
- get_put_sql
- translatecharacters_sql
- decodecase_sql
- semanticview_sql
- sqlglot.dialects.mysql.MySQL.Generator
- INTERVAL_ALLOWS_PLURAL_FORM
- LOCKING_READS_SUPPORTED
- NULL_ORDERING_SUPPORTED
- JOIN_HINTS
- TABLE_HINTS
- DUPLICATE_KEY_UPDATE_WITH_SET
- QUERY_HINT_SEP
- VALUES_AS_TABLE
- NVL2_SUPPORTED
- LAST_DAY_SUPPORTS_DATE_PART
- JSON_TYPE_REQUIRED_FOR_EXTRACTION
- JSON_PATH_BRACKETED_KEY_SUPPORTED
- JSON_KEY_VALUE_PAIR_SEP
- SUPPORTS_TO_NUMBER
- PARSE_JSON_NAME
- PAD_FILL_PATTERN_IS_REQUIRED
- WRAP_DERIVED_VALUES
- VARCHAR_REQUIRES_SIZE
- SUPPORTS_MEDIAN
- UNSIGNED_TYPE_MAPPING
- TIMESTAMP_TYPE_MAPPING
- TYPE_MAPPING
- PROPERTIES_LOCATION
- LIMIT_FETCH
- LIMIT_ONLY_LITERALS
- CHAR_CAST_MAPPING
- SIGNED_CAST_MAPPING
- CAST_MAPPING
- TIMESTAMP_FUNC_TYPES
- computedcolumnconstraint_sql
- array_sql
- arraycontainsall_sql
- dpipe_sql
- extract_sql
- datatype_sql
- jsonarraycontains_sql
- cast_sql
- show_sql
- altercolumn_sql
- chr_sql
- timestamptrunc_sql
- converttimezone_sql
- attimezone_sql
- isascii_sql
- currentschema_sql