sqlglot.dialects.singlestore
1from sqlglot import TokenType 2import typing as t 3 4from sqlglot import exp 5from sqlglot.dialects.dialect import build_formatted_time, rename_func 6from sqlglot.dialects.mysql import MySQL 7from sqlglot.generator import unsupported_args 8from sqlglot.helper import seq_get 9 10 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 "UNIX_TIMESTAMP": exp.StrToUnix.from_arg_list, 68 "FROM_UNIXTIME": build_formatted_time(exp.UnixToTime, "mysql"), 69 } 70 71 CAST_COLUMN_OPERATORS = {TokenType.COLON_GT, TokenType.NCOLON_GT} 72 73 COLUMN_OPERATORS = { 74 TokenType.COLON_GT: lambda self, this, to: self.expression( 75 exp.Cast, 76 this=this, 77 to=to, 78 ), 79 TokenType.NCOLON_GT: lambda self, this, to: self.expression( 80 exp.TryCast, 81 this=this, 82 to=to, 83 ), 84 } 85 86 class Generator(MySQL.Generator): 87 TRANSFORMS = { 88 **MySQL.Generator.TRANSFORMS, 89 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 90 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 91 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 92 exp.StrToDate: lambda self, e: self.func( 93 "STR_TO_DATE", 94 e.this, 95 self.format_time( 96 e, 97 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 98 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 99 ), 100 ), 101 exp.TimeToStr: lambda self, e: self.func( 102 "DATE_FORMAT", 103 e.this, 104 self.format_time( 105 e, 106 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 107 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 108 ), 109 ), 110 exp.Cast: unsupported_args("format", "action", "default")( 111 lambda self, e: f"{self.sql(e, 'this')} :> {self.sql(e, 'to')}" 112 ), 113 exp.TryCast: unsupported_args("format", "action", "default")( 114 lambda self, e: f"{self.sql(e, 'this')} !:> {self.sql(e, 'to')}" 115 ), 116 exp.StrToUnix: unsupported_args("format")(rename_func("UNIX_TIMESTAMP")), 117 exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"), 118 exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"), 119 exp.UnixSeconds: rename_func("UNIX_TIMESTAMP"), 120 exp.UnixToStr: lambda self, e: self.func( 121 "FROM_UNIXTIME", 122 e.this, 123 self.format_time( 124 e, 125 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 126 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 127 ), 128 ), 129 exp.UnixToTime: unsupported_args("scale", "zone", "hours", "minutes")( 130 lambda self, e: self.func( 131 "FROM_UNIXTIME", 132 e.this, 133 self.format_time( 134 e, 135 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 136 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 137 ), 138 ), 139 ), 140 exp.UnixToTimeStr: lambda self, e: f"FROM_UNIXTIME({self.sql(e, 'this')}) :> TEXT", 141 } 142 143 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 144 RESERVED_KEYWORDS = { 145 "abs", 146 "absolute", 147 "access", 148 "account", 149 "acos", 150 "action", 151 "add", 152 "adddate", 153 "addtime", 154 "admin", 155 "aes_decrypt", 156 "aes_encrypt", 157 "after", 158 "against", 159 "aggregate", 160 "aggregates", 161 "aggregator", 162 "aggregator_id", 163 "aggregator_plan_hash", 164 "aggregators", 165 "algorithm", 166 "all", 167 "also", 168 "alter", 169 "always", 170 "analyse", 171 "analyze", 172 "and", 173 "anti_join", 174 "any", 175 "any_value", 176 "approx_count_distinct", 177 "approx_count_distinct_accumulate", 178 "approx_count_distinct_combine", 179 "approx_count_distinct_estimate", 180 "approx_geography_intersects", 181 "approx_percentile", 182 "arghistory", 183 "arrange", 184 "arrangement", 185 "array", 186 "as", 187 "asc", 188 "ascii", 189 "asensitive", 190 "asin", 191 "asm", 192 "assertion", 193 "assignment", 194 "ast", 195 "asymmetric", 196 "async", 197 "at", 198 "atan", 199 "atan2", 200 "attach", 201 "attribute", 202 "authorization", 203 "auto", 204 "auto_increment", 205 "auto_reprovision", 206 "autostats", 207 "autostats_cardinality_mode", 208 "autostats_enabled", 209 "autostats_histogram_mode", 210 "autostats_sampling", 211 "availability", 212 "avg", 213 "avg_row_length", 214 "avro", 215 "azure", 216 "background", 217 "_background_threads_for_cleanup", 218 "backup", 219 "backup_history", 220 "backup_id", 221 "backward", 222 "batch", 223 "batches", 224 "batch_interval", 225 "_batch_size_limit", 226 "before", 227 "begin", 228 "between", 229 "bigint", 230 "bin", 231 "binary", 232 "_binary", 233 "bit", 234 "bit_and", 235 "bit_count", 236 "bit_or", 237 "bit_xor", 238 "blob", 239 "bool", 240 "boolean", 241 "bootstrap", 242 "both", 243 "_bt", 244 "btree", 245 "bucket_count", 246 "by", 247 "byte", 248 "byte_length", 249 "cache", 250 "call", 251 "call_for_pipeline", 252 "called", 253 "capture", 254 "cascade", 255 "cascaded", 256 "case", 257 "cast", 258 "catalog", 259 "ceil", 260 "ceiling", 261 "chain", 262 "change", 263 "char", 264 "character", 265 "characteristics", 266 "character_length", 267 "char_length", 268 "charset", 269 "check", 270 "checkpoint", 271 "_check_can_connect", 272 "_check_consistency", 273 "checksum", 274 "_checksum", 275 "class", 276 "clear", 277 "client", 278 "client_found_rows", 279 "close", 280 "cluster", 281 "clustered", 282 "cnf", 283 "coalesce", 284 "coercibility", 285 "collate", 286 "collation", 287 "collect", 288 "column", 289 "columnar", 290 "columns", 291 "columnstore", 292 "columnstore_segment_rows", 293 "comment", 294 "comments", 295 "commit", 296 "committed", 297 "_commit_log_tail", 298 "committed", 299 "compact", 300 "compile", 301 "compressed", 302 "compression", 303 "concat", 304 "concat_ws", 305 "concurrent", 306 "concurrently", 307 "condition", 308 "configuration", 309 "connection", 310 "connection_id", 311 "connections", 312 "config", 313 "constraint", 314 "constraints", 315 "content", 316 "continue", 317 "_continue_replay", 318 "conv", 319 "conversion", 320 "convert", 321 "convert_tz", 322 "copy", 323 "_core", 324 "cos", 325 "cost", 326 "cot", 327 "count", 328 "create", 329 "credentials", 330 "cross", 331 "cube", 332 "csv", 333 "cume_dist", 334 "curdate", 335 "current", 336 "current_catalog", 337 "current_date", 338 "current_role", 339 "current_schema", 340 "current_security_groups", 341 "current_security_roles", 342 "current_time", 343 "current_timestamp", 344 "current_user", 345 "cursor", 346 "curtime", 347 "cycle", 348 "data", 349 "database", 350 "databases", 351 "date", 352 "date_add", 353 "datediff", 354 "date_format", 355 "date_sub", 356 "date_trunc", 357 "datetime", 358 "day", 359 "day_hour", 360 "day_microsecond", 361 "day_minute", 362 "dayname", 363 "dayofmonth", 364 "dayofweek", 365 "dayofyear", 366 "day_second", 367 "deallocate", 368 "dec", 369 "decimal", 370 "declare", 371 "decode", 372 "default", 373 "defaults", 374 "deferrable", 375 "deferred", 376 "defined", 377 "definer", 378 "degrees", 379 "delayed", 380 "delay_key_write", 381 "delete", 382 "delimiter", 383 "delimiters", 384 "dense_rank", 385 "desc", 386 "describe", 387 "detach", 388 "deterministic", 389 "dictionary", 390 "differential", 391 "directory", 392 "disable", 393 "discard", 394 "_disconnect", 395 "disk", 396 "distinct", 397 "distinctrow", 398 "distributed_joins", 399 "div", 400 "do", 401 "document", 402 "domain", 403 "dot_product", 404 "double", 405 "drop", 406 "_drop_profile", 407 "dual", 408 "dump", 409 "duplicate", 410 "dynamic", 411 "earliest", 412 "each", 413 "echo", 414 "election", 415 "else", 416 "elseif", 417 "elt", 418 "enable", 419 "enclosed", 420 "encoding", 421 "encrypted", 422 "end", 423 "engine", 424 "engines", 425 "enum", 426 "errors", 427 "escape", 428 "escaped", 429 "estimate", 430 "euclidean_distance", 431 "event", 432 "events", 433 "except", 434 "exclude", 435 "excluding", 436 "exclusive", 437 "execute", 438 "exists", 439 "exit", 440 "exp", 441 "explain", 442 "extended", 443 "extension", 444 "external", 445 "external_host", 446 "external_port", 447 "extract", 448 "extractor", 449 "extractors", 450 "extra_join", 451 "_failover", 452 "failed_login_attempts", 453 "failure", 454 "false", 455 "family", 456 "fault", 457 "fetch", 458 "field", 459 "fields", 460 "file", 461 "files", 462 "fill", 463 "first", 464 "first_value", 465 "fix_alter", 466 "fixed", 467 "float", 468 "float4", 469 "float8", 470 "floor", 471 "flush", 472 "following", 473 "for", 474 "force", 475 "force_compiled_mode", 476 "force_interpreter_mode", 477 "foreground", 478 "foreign", 479 "format", 480 "forward", 481 "found_rows", 482 "freeze", 483 "from", 484 "from_base64", 485 "from_days", 486 "from_unixtime", 487 "fs", 488 "_fsync", 489 "full", 490 "fulltext", 491 "function", 492 "functions", 493 "gc", 494 "gcs", 495 "get_format", 496 "_gc", 497 "_gcx", 498 "generate", 499 "geography", 500 "geography_area", 501 "geography_contains", 502 "geography_distance", 503 "geography_intersects", 504 "geography_latitude", 505 "geography_length", 506 "geography_longitude", 507 "geographypoint", 508 "geography_point", 509 "geography_within_distance", 510 "geometry", 511 "geometry_area", 512 "geometry_contains", 513 "geometry_distance", 514 "geometry_filter", 515 "geometry_intersects", 516 "geometry_length", 517 "geometrypoint", 518 "geometry_point", 519 "geometry_within_distance", 520 "geometry_x", 521 "geometry_y", 522 "global", 523 "_global_version_timestamp", 524 "grant", 525 "granted", 526 "grants", 527 "greatest", 528 "group", 529 "grouping", 530 "groups", 531 "group_concat", 532 "gzip", 533 "handle", 534 "handler", 535 "hard_cpu_limit_percentage", 536 "hash", 537 "has_temp_tables", 538 "having", 539 "hdfs", 540 "header", 541 "heartbeat_no_logging", 542 "hex", 543 "highlight", 544 "high_priority", 545 "hold", 546 "holding", 547 "host", 548 "hosts", 549 "hour", 550 "hour_microsecond", 551 "hour_minute", 552 "hour_second", 553 "identified", 554 "identity", 555 "if", 556 "ifnull", 557 "ignore", 558 "ilike", 559 "immediate", 560 "immutable", 561 "implicit", 562 "import", 563 "in", 564 "including", 565 "increment", 566 "incremental", 567 "index", 568 "indexes", 569 "inet_aton", 570 "inet_ntoa", 571 "inet6_aton", 572 "inet6_ntoa", 573 "infile", 574 "inherit", 575 "inherits", 576 "_init_profile", 577 "init", 578 "initcap", 579 "initialize", 580 "initially", 581 "inject", 582 "inline", 583 "inner", 584 "inout", 585 "input", 586 "insensitive", 587 "insert", 588 "insert_method", 589 "instance", 590 "instead", 591 "instr", 592 "int", 593 "int1", 594 "int2", 595 "int3", 596 "int4", 597 "int8", 598 "integer", 599 "_internal_dynamic_typecast", 600 "interpreter_mode", 601 "intersect", 602 "interval", 603 "into", 604 "invoker", 605 "is", 606 "isnull", 607 "isolation", 608 "iterate", 609 "join", 610 "json", 611 "json_agg", 612 "json_array_contains_double", 613 "json_array_contains_json", 614 "json_array_contains_string", 615 "json_array_push_double", 616 "json_array_push_json", 617 "json_array_push_string", 618 "json_delete_key", 619 "json_extract_double", 620 "json_extract_json", 621 "json_extract_string", 622 "json_extract_bigint", 623 "json_get_type", 624 "json_length", 625 "json_set_double", 626 "json_set_json", 627 "json_set_string", 628 "json_splice_double", 629 "json_splice_json", 630 "json_splice_string", 631 "kafka", 632 "key", 633 "key_block_size", 634 "keys", 635 "kill", 636 "killall", 637 "label", 638 "lag", 639 "language", 640 "large", 641 "last", 642 "last_day", 643 "last_insert_id", 644 "last_value", 645 "lateral", 646 "latest", 647 "lc_collate", 648 "lc_ctype", 649 "lcase", 650 "lead", 651 "leading", 652 "leaf", 653 "leakproof", 654 "least", 655 "leave", 656 "leaves", 657 "left", 658 "length", 659 "level", 660 "license", 661 "like", 662 "limit", 663 "lines", 664 "listen", 665 "llvm", 666 "ln", 667 "load", 668 "loaddata_where", 669 "_load", 670 "local", 671 "localtime", 672 "localtimestamp", 673 "locate", 674 "location", 675 "lock", 676 "log", 677 "log10", 678 "log2", 679 "long", 680 "longblob", 681 "longtext", 682 "loop", 683 "lower", 684 "low_priority", 685 "lpad", 686 "_ls", 687 "ltrim", 688 "lz4", 689 "management", 690 "_management_thread", 691 "mapping", 692 "master", 693 "match", 694 "materialized", 695 "max", 696 "maxvalue", 697 "max_concurrency", 698 "max_errors", 699 "max_partitions_per_batch", 700 "max_queue_depth", 701 "max_retries_per_batch_partition", 702 "max_rows", 703 "mbc", 704 "md5", 705 "mpl", 706 "median", 707 "mediumblob", 708 "mediumint", 709 "mediumtext", 710 "member", 711 "memory", 712 "memory_percentage", 713 "_memsql_table_id_lookup", 714 "memsql", 715 "memsql_deserialize", 716 "memsql_imitating_kafka", 717 "memsql_serialize", 718 "merge", 719 "metadata", 720 "microsecond", 721 "middleint", 722 "min", 723 "min_rows", 724 "minus", 725 "minute", 726 "minute_microsecond", 727 "minute_second", 728 "minvalue", 729 "mod", 730 "mode", 731 "model", 732 "modifies", 733 "modify", 734 "month", 735 "monthname", 736 "months_between", 737 "move", 738 "mpl", 739 "names", 740 "named", 741 "namespace", 742 "national", 743 "natural", 744 "nchar", 745 "next", 746 "no", 747 "node", 748 "none", 749 "no_query_rewrite", 750 "noparam", 751 "not", 752 "nothing", 753 "notify", 754 "now", 755 "nowait", 756 "no_write_to_binlog", 757 "no_query_rewrite", 758 "norely", 759 "nth_value", 760 "ntile", 761 "null", 762 "nullcols", 763 "nullif", 764 "nulls", 765 "numeric", 766 "nvarchar", 767 "object", 768 "octet_length", 769 "of", 770 "off", 771 "offline", 772 "offset", 773 "offsets", 774 "oids", 775 "on", 776 "online", 777 "only", 778 "open", 779 "operator", 780 "optimization", 781 "optimize", 782 "optimizer", 783 "optimizer_state", 784 "option", 785 "options", 786 "optionally", 787 "or", 788 "order", 789 "ordered_serialize", 790 "orphan", 791 "out", 792 "out_of_order", 793 "outer", 794 "outfile", 795 "over", 796 "overlaps", 797 "overlay", 798 "owned", 799 "owner", 800 "pack_keys", 801 "paired", 802 "parser", 803 "parquet", 804 "partial", 805 "partition", 806 "partition_id", 807 "partitioning", 808 "partitions", 809 "passing", 810 "password", 811 "password_lock_time", 812 "parser", 813 "pause", 814 "_pause_replay", 815 "percent_rank", 816 "percentile_cont", 817 "percentile_disc", 818 "periodic", 819 "persisted", 820 "pi", 821 "pipeline", 822 "pipelines", 823 "pivot", 824 "placing", 825 "plan", 826 "plans", 827 "plancache", 828 "plugins", 829 "pool", 830 "pools", 831 "port", 832 "position", 833 "pow", 834 "power", 835 "preceding", 836 "precision", 837 "prepare", 838 "prepared", 839 "preserve", 840 "primary", 841 "prior", 842 "privileges", 843 "procedural", 844 "procedure", 845 "procedures", 846 "process", 847 "processlist", 848 "profile", 849 "profiles", 850 "program", 851 "promote", 852 "proxy", 853 "purge", 854 "quarter", 855 "queries", 856 "query", 857 "query_timeout", 858 "queue", 859 "quote", 860 "radians", 861 "rand", 862 "range", 863 "rank", 864 "read", 865 "_read", 866 "reads", 867 "real", 868 "reassign", 869 "rebalance", 870 "recheck", 871 "record", 872 "recursive", 873 "redundancy", 874 "redundant", 875 "ref", 876 "reference", 877 "references", 878 "refresh", 879 "regexp", 880 "reindex", 881 "relative", 882 "release", 883 "reload", 884 "rely", 885 "remote", 886 "remove", 887 "rename", 888 "repair", 889 "_repair_table", 890 "repeat", 891 "repeatable", 892 "_repl", 893 "_reprovisioning", 894 "replace", 895 "replica", 896 "replicate", 897 "replicating", 898 "replication", 899 "durability", 900 "require", 901 "resource", 902 "resource_pool", 903 "reset", 904 "restart", 905 "restore", 906 "restrict", 907 "result", 908 "_resurrect", 909 "retry", 910 "return", 911 "returning", 912 "returns", 913 "reverse", 914 "revoke", 915 "rg_pool", 916 "right", 917 "right_anti_join", 918 "right_semi_join", 919 "right_straight_join", 920 "rlike", 921 "role", 922 "roles", 923 "rollback", 924 "rollup", 925 "round", 926 "routine", 927 "row", 928 "row_count", 929 "row_format", 930 "row_number", 931 "rows", 932 "rowstore", 933 "rule", 934 "rpad", 935 "_rpc", 936 "rtrim", 937 "running", 938 "s3", 939 "safe", 940 "save", 941 "savepoint", 942 "scalar", 943 "schema", 944 "schemas", 945 "schema_binding", 946 "scroll", 947 "search", 948 "second", 949 "second_microsecond", 950 "sec_to_time", 951 "security", 952 "select", 953 "semi_join", 954 "_send_threads", 955 "sensitive", 956 "separator", 957 "sequence", 958 "sequences", 959 "serial", 960 "serializable", 961 "series", 962 "service_user", 963 "server", 964 "session", 965 "session_user", 966 "set", 967 "setof", 968 "security_lists_intersect", 969 "sha", 970 "sha1", 971 "sha2", 972 "shard", 973 "sharded", 974 "sharded_id", 975 "share", 976 "show", 977 "shutdown", 978 "sigmoid", 979 "sign", 980 "signal", 981 "similar", 982 "simple", 983 "site", 984 "signed", 985 "sin", 986 "skip", 987 "skipped_batches", 988 "sleep", 989 "_sleep", 990 "smallint", 991 "snapshot", 992 "_snapshot", 993 "_snapshots", 994 "soft_cpu_limit_percentage", 995 "some", 996 "soname", 997 "sparse", 998 "spatial", 999 "spatial_check_index", 1000 "specific", 1001 "split", 1002 "sql", 1003 "sql_big_result", 1004 "sql_buffer_result", 1005 "sql_cache", 1006 "sql_calc_found_rows", 1007 "sqlexception", 1008 "sql_mode", 1009 "sql_no_cache", 1010 "sql_no_logging", 1011 "sql_small_result", 1012 "sqlstate", 1013 "sqlwarning", 1014 "sqrt", 1015 "ssl", 1016 "stable", 1017 "standalone", 1018 "start", 1019 "starting", 1020 "state", 1021 "statement", 1022 "statistics", 1023 "stats", 1024 "status", 1025 "std", 1026 "stddev", 1027 "stddev_pop", 1028 "stddev_samp", 1029 "stdin", 1030 "stdout", 1031 "stop", 1032 "storage", 1033 "str_to_date", 1034 "straight_join", 1035 "strict", 1036 "string", 1037 "strip", 1038 "subdate", 1039 "substr", 1040 "substring", 1041 "substring_index", 1042 "success", 1043 "sum", 1044 "super", 1045 "symmetric", 1046 "sync_snapshot", 1047 "sync", 1048 "_sync", 1049 "_sync2", 1050 "_sync_partitions", 1051 "_sync_snapshot", 1052 "synchronize", 1053 "sysid", 1054 "system", 1055 "table", 1056 "table_checksum", 1057 "tables", 1058 "tablespace", 1059 "tags", 1060 "tan", 1061 "target_size", 1062 "task", 1063 "temp", 1064 "template", 1065 "temporary", 1066 "temptable", 1067 "_term_bump", 1068 "terminate", 1069 "terminated", 1070 "test", 1071 "text", 1072 "then", 1073 "time", 1074 "timediff", 1075 "time_bucket", 1076 "time_format", 1077 "timeout", 1078 "timestamp", 1079 "timestampadd", 1080 "timestampdiff", 1081 "timezone", 1082 "time_to_sec", 1083 "tinyblob", 1084 "tinyint", 1085 "tinytext", 1086 "to", 1087 "to_base64", 1088 "to_char", 1089 "to_date", 1090 "to_days", 1091 "to_json", 1092 "to_number", 1093 "to_seconds", 1094 "to_timestamp", 1095 "tracelogs", 1096 "traditional", 1097 "trailing", 1098 "transform", 1099 "transaction", 1100 "_transactions_experimental", 1101 "treat", 1102 "trigger", 1103 "triggers", 1104 "trim", 1105 "true", 1106 "trunc", 1107 "truncate", 1108 "trusted", 1109 "two_phase", 1110 "_twopcid", 1111 "type", 1112 "types", 1113 "ucase", 1114 "unbounded", 1115 "uncommitted", 1116 "undefined", 1117 "undo", 1118 "unencrypted", 1119 "unenforced", 1120 "unhex", 1121 "unhold", 1122 "unicode", 1123 "union", 1124 "unique", 1125 "_unittest", 1126 "unix_timestamp", 1127 "unknown", 1128 "unlisten", 1129 "_unload", 1130 "unlock", 1131 "unlogged", 1132 "unpivot", 1133 "unsigned", 1134 "until", 1135 "update", 1136 "upgrade", 1137 "upper", 1138 "usage", 1139 "use", 1140 "user", 1141 "users", 1142 "using", 1143 "utc_date", 1144 "utc_time", 1145 "utc_timestamp", 1146 "_utf8", 1147 "vacuum", 1148 "valid", 1149 "validate", 1150 "validator", 1151 "value", 1152 "values", 1153 "varbinary", 1154 "varchar", 1155 "varcharacter", 1156 "variables", 1157 "variadic", 1158 "variance", 1159 "var_pop", 1160 "var_samp", 1161 "varying", 1162 "vector_sub", 1163 "verbose", 1164 "version", 1165 "view", 1166 "void", 1167 "volatile", 1168 "voting", 1169 "wait", 1170 "_wake", 1171 "warnings", 1172 "week", 1173 "weekday", 1174 "weekofyear", 1175 "when", 1176 "where", 1177 "while", 1178 "whitespace", 1179 "window", 1180 "with", 1181 "without", 1182 "within", 1183 "_wm_heartbeat", 1184 "work", 1185 "workload", 1186 "wrapper", 1187 "write", 1188 "xact_id", 1189 "xor", 1190 "year", 1191 "year_month", 1192 "yes", 1193 "zerofill", 1194 "zone", 1195 }
12class SingleStore(MySQL): 13 SUPPORTS_ORDER_BY_ALL = True 14 15 TIME_MAPPING: t.Dict[str, str] = { 16 "D": "%u", # Day of week (1-7) 17 "DD": "%d", # day of month (01-31) 18 "DY": "%a", # abbreviated name of day 19 "HH": "%I", # Hour of day (01-12) 20 "HH12": "%I", # alias for HH 21 "HH24": "%H", # Hour of day (00-23) 22 "MI": "%M", # Minute (00-59) 23 "MM": "%m", # Month (01-12; January = 01) 24 "MON": "%b", # Abbreviated name of month 25 "MONTH": "%B", # Name of month 26 "SS": "%S", # Second (00-59) 27 "RR": "%y", # 15 28 "YY": "%y", # 15 29 "YYYY": "%Y", # 2015 30 "FF6": "%f", # only 6 digits are supported in python formats 31 } 32 33 class Tokenizer(MySQL.Tokenizer): 34 BYTE_STRINGS = [("e'", "'"), ("E'", "'")] 35 36 KEYWORDS = { 37 **MySQL.Tokenizer.KEYWORDS, 38 "BSON": TokenType.JSONB, 39 "GEOGRAPHYPOINT": TokenType.GEOGRAPHYPOINT, 40 ":>": TokenType.COLON_GT, 41 "!:>": TokenType.NCOLON_GT, 42 "::$": TokenType.DCOLONDOLLAR, 43 "::%": TokenType.DCOLONPERCENT, 44 } 45 46 class Parser(MySQL.Parser): 47 FUNCTIONS = { 48 **MySQL.Parser.FUNCTIONS, 49 "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "singlestore"), 50 "TO_TIMESTAMP": build_formatted_time(exp.StrToTime, "singlestore"), 51 "TO_CHAR": build_formatted_time(exp.ToChar, "singlestore"), 52 "STR_TO_DATE": build_formatted_time(exp.StrToDate, "mysql"), 53 "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "mysql"), 54 "TIME_FORMAT": lambda args: exp.TimeToStr( 55 # The first argument is converted to TIME(6) 56 # This is needed because exp.TimeToStr is converted to DATE_FORMAT 57 # which interprets the first argument as DATETIME and fails to parse 58 # string literals like '12:05:47' without a date part. 59 this=exp.Cast( 60 this=seq_get(args, 0), 61 to=exp.DataType.build( 62 exp.DataType.Type.TIME, 63 expressions=[exp.DataTypeParam(this=exp.Literal.number(6))], 64 ), 65 ), 66 format=MySQL.format_time(seq_get(args, 1)), 67 ), 68 "UNIX_TIMESTAMP": exp.StrToUnix.from_arg_list, 69 "FROM_UNIXTIME": build_formatted_time(exp.UnixToTime, "mysql"), 70 } 71 72 CAST_COLUMN_OPERATORS = {TokenType.COLON_GT, TokenType.NCOLON_GT} 73 74 COLUMN_OPERATORS = { 75 TokenType.COLON_GT: lambda self, this, to: self.expression( 76 exp.Cast, 77 this=this, 78 to=to, 79 ), 80 TokenType.NCOLON_GT: lambda self, this, to: self.expression( 81 exp.TryCast, 82 this=this, 83 to=to, 84 ), 85 } 86 87 class Generator(MySQL.Generator): 88 TRANSFORMS = { 89 **MySQL.Generator.TRANSFORMS, 90 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 91 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 92 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 93 exp.StrToDate: lambda self, e: self.func( 94 "STR_TO_DATE", 95 e.this, 96 self.format_time( 97 e, 98 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 99 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 100 ), 101 ), 102 exp.TimeToStr: lambda self, e: self.func( 103 "DATE_FORMAT", 104 e.this, 105 self.format_time( 106 e, 107 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 108 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 109 ), 110 ), 111 exp.Cast: unsupported_args("format", "action", "default")( 112 lambda self, e: f"{self.sql(e, 'this')} :> {self.sql(e, 'to')}" 113 ), 114 exp.TryCast: unsupported_args("format", "action", "default")( 115 lambda self, e: f"{self.sql(e, 'this')} !:> {self.sql(e, 'to')}" 116 ), 117 exp.StrToUnix: unsupported_args("format")(rename_func("UNIX_TIMESTAMP")), 118 exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"), 119 exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"), 120 exp.UnixSeconds: rename_func("UNIX_TIMESTAMP"), 121 exp.UnixToStr: lambda self, e: self.func( 122 "FROM_UNIXTIME", 123 e.this, 124 self.format_time( 125 e, 126 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 127 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 128 ), 129 ), 130 exp.UnixToTime: unsupported_args("scale", "zone", "hours", "minutes")( 131 lambda self, e: self.func( 132 "FROM_UNIXTIME", 133 e.this, 134 self.format_time( 135 e, 136 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 137 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 138 ), 139 ), 140 ), 141 exp.UnixToTimeStr: lambda self, e: f"FROM_UNIXTIME({self.sql(e, 'this')}) :> TEXT", 142 } 143 144 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 145 RESERVED_KEYWORDS = { 146 "abs", 147 "absolute", 148 "access", 149 "account", 150 "acos", 151 "action", 152 "add", 153 "adddate", 154 "addtime", 155 "admin", 156 "aes_decrypt", 157 "aes_encrypt", 158 "after", 159 "against", 160 "aggregate", 161 "aggregates", 162 "aggregator", 163 "aggregator_id", 164 "aggregator_plan_hash", 165 "aggregators", 166 "algorithm", 167 "all", 168 "also", 169 "alter", 170 "always", 171 "analyse", 172 "analyze", 173 "and", 174 "anti_join", 175 "any", 176 "any_value", 177 "approx_count_distinct", 178 "approx_count_distinct_accumulate", 179 "approx_count_distinct_combine", 180 "approx_count_distinct_estimate", 181 "approx_geography_intersects", 182 "approx_percentile", 183 "arghistory", 184 "arrange", 185 "arrangement", 186 "array", 187 "as", 188 "asc", 189 "ascii", 190 "asensitive", 191 "asin", 192 "asm", 193 "assertion", 194 "assignment", 195 "ast", 196 "asymmetric", 197 "async", 198 "at", 199 "atan", 200 "atan2", 201 "attach", 202 "attribute", 203 "authorization", 204 "auto", 205 "auto_increment", 206 "auto_reprovision", 207 "autostats", 208 "autostats_cardinality_mode", 209 "autostats_enabled", 210 "autostats_histogram_mode", 211 "autostats_sampling", 212 "availability", 213 "avg", 214 "avg_row_length", 215 "avro", 216 "azure", 217 "background", 218 "_background_threads_for_cleanup", 219 "backup", 220 "backup_history", 221 "backup_id", 222 "backward", 223 "batch", 224 "batches", 225 "batch_interval", 226 "_batch_size_limit", 227 "before", 228 "begin", 229 "between", 230 "bigint", 231 "bin", 232 "binary", 233 "_binary", 234 "bit", 235 "bit_and", 236 "bit_count", 237 "bit_or", 238 "bit_xor", 239 "blob", 240 "bool", 241 "boolean", 242 "bootstrap", 243 "both", 244 "_bt", 245 "btree", 246 "bucket_count", 247 "by", 248 "byte", 249 "byte_length", 250 "cache", 251 "call", 252 "call_for_pipeline", 253 "called", 254 "capture", 255 "cascade", 256 "cascaded", 257 "case", 258 "cast", 259 "catalog", 260 "ceil", 261 "ceiling", 262 "chain", 263 "change", 264 "char", 265 "character", 266 "characteristics", 267 "character_length", 268 "char_length", 269 "charset", 270 "check", 271 "checkpoint", 272 "_check_can_connect", 273 "_check_consistency", 274 "checksum", 275 "_checksum", 276 "class", 277 "clear", 278 "client", 279 "client_found_rows", 280 "close", 281 "cluster", 282 "clustered", 283 "cnf", 284 "coalesce", 285 "coercibility", 286 "collate", 287 "collation", 288 "collect", 289 "column", 290 "columnar", 291 "columns", 292 "columnstore", 293 "columnstore_segment_rows", 294 "comment", 295 "comments", 296 "commit", 297 "committed", 298 "_commit_log_tail", 299 "committed", 300 "compact", 301 "compile", 302 "compressed", 303 "compression", 304 "concat", 305 "concat_ws", 306 "concurrent", 307 "concurrently", 308 "condition", 309 "configuration", 310 "connection", 311 "connection_id", 312 "connections", 313 "config", 314 "constraint", 315 "constraints", 316 "content", 317 "continue", 318 "_continue_replay", 319 "conv", 320 "conversion", 321 "convert", 322 "convert_tz", 323 "copy", 324 "_core", 325 "cos", 326 "cost", 327 "cot", 328 "count", 329 "create", 330 "credentials", 331 "cross", 332 "cube", 333 "csv", 334 "cume_dist", 335 "curdate", 336 "current", 337 "current_catalog", 338 "current_date", 339 "current_role", 340 "current_schema", 341 "current_security_groups", 342 "current_security_roles", 343 "current_time", 344 "current_timestamp", 345 "current_user", 346 "cursor", 347 "curtime", 348 "cycle", 349 "data", 350 "database", 351 "databases", 352 "date", 353 "date_add", 354 "datediff", 355 "date_format", 356 "date_sub", 357 "date_trunc", 358 "datetime", 359 "day", 360 "day_hour", 361 "day_microsecond", 362 "day_minute", 363 "dayname", 364 "dayofmonth", 365 "dayofweek", 366 "dayofyear", 367 "day_second", 368 "deallocate", 369 "dec", 370 "decimal", 371 "declare", 372 "decode", 373 "default", 374 "defaults", 375 "deferrable", 376 "deferred", 377 "defined", 378 "definer", 379 "degrees", 380 "delayed", 381 "delay_key_write", 382 "delete", 383 "delimiter", 384 "delimiters", 385 "dense_rank", 386 "desc", 387 "describe", 388 "detach", 389 "deterministic", 390 "dictionary", 391 "differential", 392 "directory", 393 "disable", 394 "discard", 395 "_disconnect", 396 "disk", 397 "distinct", 398 "distinctrow", 399 "distributed_joins", 400 "div", 401 "do", 402 "document", 403 "domain", 404 "dot_product", 405 "double", 406 "drop", 407 "_drop_profile", 408 "dual", 409 "dump", 410 "duplicate", 411 "dynamic", 412 "earliest", 413 "each", 414 "echo", 415 "election", 416 "else", 417 "elseif", 418 "elt", 419 "enable", 420 "enclosed", 421 "encoding", 422 "encrypted", 423 "end", 424 "engine", 425 "engines", 426 "enum", 427 "errors", 428 "escape", 429 "escaped", 430 "estimate", 431 "euclidean_distance", 432 "event", 433 "events", 434 "except", 435 "exclude", 436 "excluding", 437 "exclusive", 438 "execute", 439 "exists", 440 "exit", 441 "exp", 442 "explain", 443 "extended", 444 "extension", 445 "external", 446 "external_host", 447 "external_port", 448 "extract", 449 "extractor", 450 "extractors", 451 "extra_join", 452 "_failover", 453 "failed_login_attempts", 454 "failure", 455 "false", 456 "family", 457 "fault", 458 "fetch", 459 "field", 460 "fields", 461 "file", 462 "files", 463 "fill", 464 "first", 465 "first_value", 466 "fix_alter", 467 "fixed", 468 "float", 469 "float4", 470 "float8", 471 "floor", 472 "flush", 473 "following", 474 "for", 475 "force", 476 "force_compiled_mode", 477 "force_interpreter_mode", 478 "foreground", 479 "foreign", 480 "format", 481 "forward", 482 "found_rows", 483 "freeze", 484 "from", 485 "from_base64", 486 "from_days", 487 "from_unixtime", 488 "fs", 489 "_fsync", 490 "full", 491 "fulltext", 492 "function", 493 "functions", 494 "gc", 495 "gcs", 496 "get_format", 497 "_gc", 498 "_gcx", 499 "generate", 500 "geography", 501 "geography_area", 502 "geography_contains", 503 "geography_distance", 504 "geography_intersects", 505 "geography_latitude", 506 "geography_length", 507 "geography_longitude", 508 "geographypoint", 509 "geography_point", 510 "geography_within_distance", 511 "geometry", 512 "geometry_area", 513 "geometry_contains", 514 "geometry_distance", 515 "geometry_filter", 516 "geometry_intersects", 517 "geometry_length", 518 "geometrypoint", 519 "geometry_point", 520 "geometry_within_distance", 521 "geometry_x", 522 "geometry_y", 523 "global", 524 "_global_version_timestamp", 525 "grant", 526 "granted", 527 "grants", 528 "greatest", 529 "group", 530 "grouping", 531 "groups", 532 "group_concat", 533 "gzip", 534 "handle", 535 "handler", 536 "hard_cpu_limit_percentage", 537 "hash", 538 "has_temp_tables", 539 "having", 540 "hdfs", 541 "header", 542 "heartbeat_no_logging", 543 "hex", 544 "highlight", 545 "high_priority", 546 "hold", 547 "holding", 548 "host", 549 "hosts", 550 "hour", 551 "hour_microsecond", 552 "hour_minute", 553 "hour_second", 554 "identified", 555 "identity", 556 "if", 557 "ifnull", 558 "ignore", 559 "ilike", 560 "immediate", 561 "immutable", 562 "implicit", 563 "import", 564 "in", 565 "including", 566 "increment", 567 "incremental", 568 "index", 569 "indexes", 570 "inet_aton", 571 "inet_ntoa", 572 "inet6_aton", 573 "inet6_ntoa", 574 "infile", 575 "inherit", 576 "inherits", 577 "_init_profile", 578 "init", 579 "initcap", 580 "initialize", 581 "initially", 582 "inject", 583 "inline", 584 "inner", 585 "inout", 586 "input", 587 "insensitive", 588 "insert", 589 "insert_method", 590 "instance", 591 "instead", 592 "instr", 593 "int", 594 "int1", 595 "int2", 596 "int3", 597 "int4", 598 "int8", 599 "integer", 600 "_internal_dynamic_typecast", 601 "interpreter_mode", 602 "intersect", 603 "interval", 604 "into", 605 "invoker", 606 "is", 607 "isnull", 608 "isolation", 609 "iterate", 610 "join", 611 "json", 612 "json_agg", 613 "json_array_contains_double", 614 "json_array_contains_json", 615 "json_array_contains_string", 616 "json_array_push_double", 617 "json_array_push_json", 618 "json_array_push_string", 619 "json_delete_key", 620 "json_extract_double", 621 "json_extract_json", 622 "json_extract_string", 623 "json_extract_bigint", 624 "json_get_type", 625 "json_length", 626 "json_set_double", 627 "json_set_json", 628 "json_set_string", 629 "json_splice_double", 630 "json_splice_json", 631 "json_splice_string", 632 "kafka", 633 "key", 634 "key_block_size", 635 "keys", 636 "kill", 637 "killall", 638 "label", 639 "lag", 640 "language", 641 "large", 642 "last", 643 "last_day", 644 "last_insert_id", 645 "last_value", 646 "lateral", 647 "latest", 648 "lc_collate", 649 "lc_ctype", 650 "lcase", 651 "lead", 652 "leading", 653 "leaf", 654 "leakproof", 655 "least", 656 "leave", 657 "leaves", 658 "left", 659 "length", 660 "level", 661 "license", 662 "like", 663 "limit", 664 "lines", 665 "listen", 666 "llvm", 667 "ln", 668 "load", 669 "loaddata_where", 670 "_load", 671 "local", 672 "localtime", 673 "localtimestamp", 674 "locate", 675 "location", 676 "lock", 677 "log", 678 "log10", 679 "log2", 680 "long", 681 "longblob", 682 "longtext", 683 "loop", 684 "lower", 685 "low_priority", 686 "lpad", 687 "_ls", 688 "ltrim", 689 "lz4", 690 "management", 691 "_management_thread", 692 "mapping", 693 "master", 694 "match", 695 "materialized", 696 "max", 697 "maxvalue", 698 "max_concurrency", 699 "max_errors", 700 "max_partitions_per_batch", 701 "max_queue_depth", 702 "max_retries_per_batch_partition", 703 "max_rows", 704 "mbc", 705 "md5", 706 "mpl", 707 "median", 708 "mediumblob", 709 "mediumint", 710 "mediumtext", 711 "member", 712 "memory", 713 "memory_percentage", 714 "_memsql_table_id_lookup", 715 "memsql", 716 "memsql_deserialize", 717 "memsql_imitating_kafka", 718 "memsql_serialize", 719 "merge", 720 "metadata", 721 "microsecond", 722 "middleint", 723 "min", 724 "min_rows", 725 "minus", 726 "minute", 727 "minute_microsecond", 728 "minute_second", 729 "minvalue", 730 "mod", 731 "mode", 732 "model", 733 "modifies", 734 "modify", 735 "month", 736 "monthname", 737 "months_between", 738 "move", 739 "mpl", 740 "names", 741 "named", 742 "namespace", 743 "national", 744 "natural", 745 "nchar", 746 "next", 747 "no", 748 "node", 749 "none", 750 "no_query_rewrite", 751 "noparam", 752 "not", 753 "nothing", 754 "notify", 755 "now", 756 "nowait", 757 "no_write_to_binlog", 758 "no_query_rewrite", 759 "norely", 760 "nth_value", 761 "ntile", 762 "null", 763 "nullcols", 764 "nullif", 765 "nulls", 766 "numeric", 767 "nvarchar", 768 "object", 769 "octet_length", 770 "of", 771 "off", 772 "offline", 773 "offset", 774 "offsets", 775 "oids", 776 "on", 777 "online", 778 "only", 779 "open", 780 "operator", 781 "optimization", 782 "optimize", 783 "optimizer", 784 "optimizer_state", 785 "option", 786 "options", 787 "optionally", 788 "or", 789 "order", 790 "ordered_serialize", 791 "orphan", 792 "out", 793 "out_of_order", 794 "outer", 795 "outfile", 796 "over", 797 "overlaps", 798 "overlay", 799 "owned", 800 "owner", 801 "pack_keys", 802 "paired", 803 "parser", 804 "parquet", 805 "partial", 806 "partition", 807 "partition_id", 808 "partitioning", 809 "partitions", 810 "passing", 811 "password", 812 "password_lock_time", 813 "parser", 814 "pause", 815 "_pause_replay", 816 "percent_rank", 817 "percentile_cont", 818 "percentile_disc", 819 "periodic", 820 "persisted", 821 "pi", 822 "pipeline", 823 "pipelines", 824 "pivot", 825 "placing", 826 "plan", 827 "plans", 828 "plancache", 829 "plugins", 830 "pool", 831 "pools", 832 "port", 833 "position", 834 "pow", 835 "power", 836 "preceding", 837 "precision", 838 "prepare", 839 "prepared", 840 "preserve", 841 "primary", 842 "prior", 843 "privileges", 844 "procedural", 845 "procedure", 846 "procedures", 847 "process", 848 "processlist", 849 "profile", 850 "profiles", 851 "program", 852 "promote", 853 "proxy", 854 "purge", 855 "quarter", 856 "queries", 857 "query", 858 "query_timeout", 859 "queue", 860 "quote", 861 "radians", 862 "rand", 863 "range", 864 "rank", 865 "read", 866 "_read", 867 "reads", 868 "real", 869 "reassign", 870 "rebalance", 871 "recheck", 872 "record", 873 "recursive", 874 "redundancy", 875 "redundant", 876 "ref", 877 "reference", 878 "references", 879 "refresh", 880 "regexp", 881 "reindex", 882 "relative", 883 "release", 884 "reload", 885 "rely", 886 "remote", 887 "remove", 888 "rename", 889 "repair", 890 "_repair_table", 891 "repeat", 892 "repeatable", 893 "_repl", 894 "_reprovisioning", 895 "replace", 896 "replica", 897 "replicate", 898 "replicating", 899 "replication", 900 "durability", 901 "require", 902 "resource", 903 "resource_pool", 904 "reset", 905 "restart", 906 "restore", 907 "restrict", 908 "result", 909 "_resurrect", 910 "retry", 911 "return", 912 "returning", 913 "returns", 914 "reverse", 915 "revoke", 916 "rg_pool", 917 "right", 918 "right_anti_join", 919 "right_semi_join", 920 "right_straight_join", 921 "rlike", 922 "role", 923 "roles", 924 "rollback", 925 "rollup", 926 "round", 927 "routine", 928 "row", 929 "row_count", 930 "row_format", 931 "row_number", 932 "rows", 933 "rowstore", 934 "rule", 935 "rpad", 936 "_rpc", 937 "rtrim", 938 "running", 939 "s3", 940 "safe", 941 "save", 942 "savepoint", 943 "scalar", 944 "schema", 945 "schemas", 946 "schema_binding", 947 "scroll", 948 "search", 949 "second", 950 "second_microsecond", 951 "sec_to_time", 952 "security", 953 "select", 954 "semi_join", 955 "_send_threads", 956 "sensitive", 957 "separator", 958 "sequence", 959 "sequences", 960 "serial", 961 "serializable", 962 "series", 963 "service_user", 964 "server", 965 "session", 966 "session_user", 967 "set", 968 "setof", 969 "security_lists_intersect", 970 "sha", 971 "sha1", 972 "sha2", 973 "shard", 974 "sharded", 975 "sharded_id", 976 "share", 977 "show", 978 "shutdown", 979 "sigmoid", 980 "sign", 981 "signal", 982 "similar", 983 "simple", 984 "site", 985 "signed", 986 "sin", 987 "skip", 988 "skipped_batches", 989 "sleep", 990 "_sleep", 991 "smallint", 992 "snapshot", 993 "_snapshot", 994 "_snapshots", 995 "soft_cpu_limit_percentage", 996 "some", 997 "soname", 998 "sparse", 999 "spatial", 1000 "spatial_check_index", 1001 "specific", 1002 "split", 1003 "sql", 1004 "sql_big_result", 1005 "sql_buffer_result", 1006 "sql_cache", 1007 "sql_calc_found_rows", 1008 "sqlexception", 1009 "sql_mode", 1010 "sql_no_cache", 1011 "sql_no_logging", 1012 "sql_small_result", 1013 "sqlstate", 1014 "sqlwarning", 1015 "sqrt", 1016 "ssl", 1017 "stable", 1018 "standalone", 1019 "start", 1020 "starting", 1021 "state", 1022 "statement", 1023 "statistics", 1024 "stats", 1025 "status", 1026 "std", 1027 "stddev", 1028 "stddev_pop", 1029 "stddev_samp", 1030 "stdin", 1031 "stdout", 1032 "stop", 1033 "storage", 1034 "str_to_date", 1035 "straight_join", 1036 "strict", 1037 "string", 1038 "strip", 1039 "subdate", 1040 "substr", 1041 "substring", 1042 "substring_index", 1043 "success", 1044 "sum", 1045 "super", 1046 "symmetric", 1047 "sync_snapshot", 1048 "sync", 1049 "_sync", 1050 "_sync2", 1051 "_sync_partitions", 1052 "_sync_snapshot", 1053 "synchronize", 1054 "sysid", 1055 "system", 1056 "table", 1057 "table_checksum", 1058 "tables", 1059 "tablespace", 1060 "tags", 1061 "tan", 1062 "target_size", 1063 "task", 1064 "temp", 1065 "template", 1066 "temporary", 1067 "temptable", 1068 "_term_bump", 1069 "terminate", 1070 "terminated", 1071 "test", 1072 "text", 1073 "then", 1074 "time", 1075 "timediff", 1076 "time_bucket", 1077 "time_format", 1078 "timeout", 1079 "timestamp", 1080 "timestampadd", 1081 "timestampdiff", 1082 "timezone", 1083 "time_to_sec", 1084 "tinyblob", 1085 "tinyint", 1086 "tinytext", 1087 "to", 1088 "to_base64", 1089 "to_char", 1090 "to_date", 1091 "to_days", 1092 "to_json", 1093 "to_number", 1094 "to_seconds", 1095 "to_timestamp", 1096 "tracelogs", 1097 "traditional", 1098 "trailing", 1099 "transform", 1100 "transaction", 1101 "_transactions_experimental", 1102 "treat", 1103 "trigger", 1104 "triggers", 1105 "trim", 1106 "true", 1107 "trunc", 1108 "truncate", 1109 "trusted", 1110 "two_phase", 1111 "_twopcid", 1112 "type", 1113 "types", 1114 "ucase", 1115 "unbounded", 1116 "uncommitted", 1117 "undefined", 1118 "undo", 1119 "unencrypted", 1120 "unenforced", 1121 "unhex", 1122 "unhold", 1123 "unicode", 1124 "union", 1125 "unique", 1126 "_unittest", 1127 "unix_timestamp", 1128 "unknown", 1129 "unlisten", 1130 "_unload", 1131 "unlock", 1132 "unlogged", 1133 "unpivot", 1134 "unsigned", 1135 "until", 1136 "update", 1137 "upgrade", 1138 "upper", 1139 "usage", 1140 "use", 1141 "user", 1142 "users", 1143 "using", 1144 "utc_date", 1145 "utc_time", 1146 "utc_timestamp", 1147 "_utf8", 1148 "vacuum", 1149 "valid", 1150 "validate", 1151 "validator", 1152 "value", 1153 "values", 1154 "varbinary", 1155 "varchar", 1156 "varcharacter", 1157 "variables", 1158 "variadic", 1159 "variance", 1160 "var_pop", 1161 "var_samp", 1162 "varying", 1163 "vector_sub", 1164 "verbose", 1165 "version", 1166 "view", 1167 "void", 1168 "volatile", 1169 "voting", 1170 "wait", 1171 "_wake", 1172 "warnings", 1173 "week", 1174 "weekday", 1175 "weekofyear", 1176 "when", 1177 "where", 1178 "while", 1179 "whitespace", 1180 "window", 1181 "with", 1182 "without", 1183 "within", 1184 "_wm_heartbeat", 1185 "work", 1186 "workload", 1187 "wrapper", 1188 "write", 1189 "xact_id", 1190 "xor", 1191 "year", 1192 "year_month", 1193 "yes", 1194 "zerofill", 1195 "zone", 1196 }
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}}}
33 class Tokenizer(MySQL.Tokenizer): 34 BYTE_STRINGS = [("e'", "'"), ("E'", "'")] 35 36 KEYWORDS = { 37 **MySQL.Tokenizer.KEYWORDS, 38 "BSON": TokenType.JSONB, 39 "GEOGRAPHYPOINT": TokenType.GEOGRAPHYPOINT, 40 ":>": TokenType.COLON_GT, 41 "!:>": TokenType.NCOLON_GT, 42 "::$": TokenType.DCOLONDOLLAR, 43 "::%": TokenType.DCOLONPERCENT, 44 }
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
46 class Parser(MySQL.Parser): 47 FUNCTIONS = { 48 **MySQL.Parser.FUNCTIONS, 49 "TO_DATE": build_formatted_time(exp.TsOrDsToDate, "singlestore"), 50 "TO_TIMESTAMP": build_formatted_time(exp.StrToTime, "singlestore"), 51 "TO_CHAR": build_formatted_time(exp.ToChar, "singlestore"), 52 "STR_TO_DATE": build_formatted_time(exp.StrToDate, "mysql"), 53 "DATE_FORMAT": build_formatted_time(exp.TimeToStr, "mysql"), 54 "TIME_FORMAT": lambda args: exp.TimeToStr( 55 # The first argument is converted to TIME(6) 56 # This is needed because exp.TimeToStr is converted to DATE_FORMAT 57 # which interprets the first argument as DATETIME and fails to parse 58 # string literals like '12:05:47' without a date part. 59 this=exp.Cast( 60 this=seq_get(args, 0), 61 to=exp.DataType.build( 62 exp.DataType.Type.TIME, 63 expressions=[exp.DataTypeParam(this=exp.Literal.number(6))], 64 ), 65 ), 66 format=MySQL.format_time(seq_get(args, 1)), 67 ), 68 "UNIX_TIMESTAMP": exp.StrToUnix.from_arg_list, 69 "FROM_UNIXTIME": build_formatted_time(exp.UnixToTime, "mysql"), 70 } 71 72 CAST_COLUMN_OPERATORS = {TokenType.COLON_GT, TokenType.NCOLON_GT} 73 74 COLUMN_OPERATORS = { 75 TokenType.COLON_GT: lambda self, this, to: self.expression( 76 exp.Cast, 77 this=this, 78 to=to, 79 ), 80 TokenType.NCOLON_GT: lambda self, this, to: self.expression( 81 exp.TryCast, 82 this=this, 83 to=to, 84 ), 85 }
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'>>, 'BYTE_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ByteLength'>>, '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>, 'CODE_POINTS_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CodePointsToString'>>, '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_FROM_UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromUnixDate'>>, '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'>>, 'GET_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GetExtract'>>, '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'>>, 'JUSTIFY_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JustifyDays'>>, 'JUSTIFY_HOURS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JustifyHours'>>, 'JUSTIFY_INTERVAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JustifyInterval'>>, '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_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseDatetime'>>, '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'>>, 'PARSE_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseTime'>>, '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'>>, 'REVERSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reverse'>>, '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_MICROS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixMicros'>>, 'UNIX_MILLIS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixMillis'>>, '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>>, 'UNIX_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToUnix'>>}
COLUMN_OPERATORS =
{<TokenType.COLON_GT: 'COLON_GT'>: <function SingleStore.Parser.<lambda>>, <TokenType.NCOLON_GT: 'NCOLON_GT'>: <function SingleStore.Parser.<lambda>>}
TABLE_ALIAS_TOKENS =
{<TokenType.UINT128: 'UINT128'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.JSON: 'JSON'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.MULTIPOLYGON: 'MULTIPOLYGON'>, <TokenType.RENAME: 'RENAME'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.SINK: 'SINK'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.NESTED: 'NESTED'>, <TokenType.UINT: 'UINT'>, <TokenType.BLOB: 'BLOB'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.LOAD: 'LOAD'>, <TokenType.JSONB: 'JSONB'>, <TokenType.CUBE: 'CUBE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.TIME: 'TIME'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.DECIMAL32: 'DECIMAL32'>, <TokenType.XML: 'XML'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.EXPORT: 'EXPORT'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.IS: 'IS'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.PUT: 'PUT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.TABLE: 'TABLE'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.DECIMAL256: 'DECIMAL256'>, <TokenType.CHAR: 'CHAR'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.VIEW: 'VIEW'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.SEMI: 'SEMI'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.DECIMAL64: 'DECIMAL64'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.RANGE: 'RANGE'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.DECIMAL128: 'DECIMAL128'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SOME: 'SOME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.DATETIME2: 'DATETIME2'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.DESC: 'DESC'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.TEXT: 'TEXT'>, <TokenType.ROWS: 'ROWS'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.FINAL: 'FINAL'>, <TokenType.INDEX: 'INDEX'>, <TokenType.IPV4: 'IPV4'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.INT128: 'INT128'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.ANTI: 'ANTI'>, <TokenType.COPY: 'COPY'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.DETACH: 'DETACH'>, <TokenType.DATE: 'DATE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.CASE: 'CASE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ASC: 'ASC'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.FIRST: 'FIRST'>, <TokenType.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.TAG: 'TAG'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.MODEL: 'MODEL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.FALSE: 'FALSE'>, <TokenType.SEMANTIC_VIEW: 'SEMANTIC_VIEW'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.TOP: 'TOP'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.BIT: 'BIT'>, <TokenType.UDOUBLE: 'UDOUBLE'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SET: 'SET'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.SMALLDATETIME: 'SMALLDATETIME'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.SHOW: 'SHOW'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.VAR: 'VAR'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.FILE_FORMAT: 'FILE_FORMAT'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.UUID: 'UUID'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.IPV6: 'IPV6'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ANY: 'ANY'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.FILTER: 'FILTER'>, <TokenType.STAGE: 'STAGE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.MONEY: 'MONEY'>, <TokenType.LIST: 'LIST'>, <TokenType.KEEP: 'KEEP'>, <TokenType.DYNAMIC: 'DYNAMIC'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.LINESTRING: 'LINESTRING'>, <TokenType.NULL: 'NULL'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.NAMESPACE: 'NAMESPACE'>, <TokenType.GET: 'GET'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.RING: 'RING'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.NOTHING: 'NOTHING'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.LIMIT: 'LIMIT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.ROW: 'ROW'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INT: 'INT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.VOID: 'VOID'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.CURRENT_SCHEMA: 'CURRENT_SCHEMA'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.POLYGON: 'POLYGON'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.YEAR: 'YEAR'>, <TokenType.MAP: 'MAP'>, <TokenType.ALL: 'ALL'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.SOURCE: 'SOURCE'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.NAME: 'NAME'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT256: 'INT256'>, <TokenType.ATTACH: 'ATTACH'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.KILL: 'KILL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.POINT: 'POINT'>, <TokenType.MERGE: 'MERGE'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DIV: 'DIV'>, <TokenType.BINARY: 'BINARY'>, <TokenType.NEXT: 'NEXT'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.MULTILINESTRING: 'MULTILINESTRING'>, <TokenType.GEOMETRY: 'GEOMETRY'>}
ID_VAR_TOKENS =
{<TokenType.UINT128: 'UINT128'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.JSON: 'JSON'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.MULTIPOLYGON: 'MULTIPOLYGON'>, <TokenType.RENAME: 'RENAME'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.SINK: 'SINK'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.NESTED: 'NESTED'>, <TokenType.UINT: 'UINT'>, <TokenType.BLOB: 'BLOB'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.LOAD: 'LOAD'>, <TokenType.JSONB: 'JSONB'>, <TokenType.CUBE: 'CUBE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.TIME: 'TIME'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.DECIMAL32: 'DECIMAL32'>, <TokenType.XML: 'XML'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.EXPORT: 'EXPORT'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.IS: 'IS'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.PUT: 'PUT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.TABLE: 'TABLE'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.DECIMAL256: 'DECIMAL256'>, <TokenType.CHAR: 'CHAR'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.VIEW: 'VIEW'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.SEMI: 'SEMI'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.DECIMAL64: 'DECIMAL64'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.RANGE: 'RANGE'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.DECIMAL128: 'DECIMAL128'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SOME: 'SOME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.DATETIME2: 'DATETIME2'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.DESC: 'DESC'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.TEXT: 'TEXT'>, <TokenType.ROWS: 'ROWS'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.FINAL: 'FINAL'>, <TokenType.INDEX: 'INDEX'>, <TokenType.IPV4: 'IPV4'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.INT128: 'INT128'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.ANTI: 'ANTI'>, <TokenType.COPY: 'COPY'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.DETACH: 'DETACH'>, <TokenType.DATE: 'DATE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.CASE: 'CASE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ASC: 'ASC'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.FIRST: 'FIRST'>, <TokenType.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.TAG: 'TAG'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.MODEL: 'MODEL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.FALSE: 'FALSE'>, <TokenType.SEMANTIC_VIEW: 'SEMANTIC_VIEW'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.TOP: 'TOP'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.BIT: 'BIT'>, <TokenType.UDOUBLE: 'UDOUBLE'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SET: 'SET'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.SMALLDATETIME: 'SMALLDATETIME'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.SHOW: 'SHOW'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.FULL: 'FULL'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.VAR: 'VAR'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.FILE_FORMAT: 'FILE_FORMAT'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.UUID: 'UUID'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.IPV6: 'IPV6'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ANY: 'ANY'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.FILTER: 'FILTER'>, <TokenType.STAGE: 'STAGE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.MONEY: 'MONEY'>, <TokenType.LIST: 'LIST'>, <TokenType.KEEP: 'KEEP'>, <TokenType.DYNAMIC: 'DYNAMIC'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.LINESTRING: 'LINESTRING'>, <TokenType.NULL: 'NULL'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.NAMESPACE: 'NAMESPACE'>, <TokenType.GET: 'GET'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.RING: 'RING'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.NOTHING: 'NOTHING'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.LEFT: 'LEFT'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.LIMIT: 'LIMIT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.ROW: 'ROW'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INT: 'INT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.VOID: 'VOID'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.CURRENT_SCHEMA: 'CURRENT_SCHEMA'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.POLYGON: 'POLYGON'>, <TokenType.APPLY: 'APPLY'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.YEAR: 'YEAR'>, <TokenType.MAP: 'MAP'>, <TokenType.ALL: 'ALL'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.SOURCE: 'SOURCE'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.NAME: 'NAME'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT256: 'INT256'>, <TokenType.ATTACH: 'ATTACH'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ASOF: 'ASOF'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.KILL: 'KILL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.POINT: 'POINT'>, <TokenType.MERGE: 'MERGE'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DIV: 'DIV'>, <TokenType.BINARY: 'BINARY'>, <TokenType.NEXT: 'NEXT'>, <TokenType.USE: 'USE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.MULTILINESTRING: 'MULTILINESTRING'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.GEOMETRY: 'GEOMETRY'>}
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
- 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
87 class Generator(MySQL.Generator): 88 TRANSFORMS = { 89 **MySQL.Generator.TRANSFORMS, 90 exp.TsOrDsToDate: lambda self, e: self.func("TO_DATE", e.this, self.format_time(e)), 91 exp.StrToTime: lambda self, e: self.func("TO_TIMESTAMP", e.this, self.format_time(e)), 92 exp.ToChar: lambda self, e: self.func("TO_CHAR", e.this, self.format_time(e)), 93 exp.StrToDate: lambda self, e: self.func( 94 "STR_TO_DATE", 95 e.this, 96 self.format_time( 97 e, 98 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 99 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 100 ), 101 ), 102 exp.TimeToStr: lambda self, e: self.func( 103 "DATE_FORMAT", 104 e.this, 105 self.format_time( 106 e, 107 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 108 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 109 ), 110 ), 111 exp.Cast: unsupported_args("format", "action", "default")( 112 lambda self, e: f"{self.sql(e, 'this')} :> {self.sql(e, 'to')}" 113 ), 114 exp.TryCast: unsupported_args("format", "action", "default")( 115 lambda self, e: f"{self.sql(e, 'this')} !:> {self.sql(e, 'to')}" 116 ), 117 exp.StrToUnix: unsupported_args("format")(rename_func("UNIX_TIMESTAMP")), 118 exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"), 119 exp.TimeStrToUnix: rename_func("UNIX_TIMESTAMP"), 120 exp.UnixSeconds: rename_func("UNIX_TIMESTAMP"), 121 exp.UnixToStr: lambda self, e: self.func( 122 "FROM_UNIXTIME", 123 e.this, 124 self.format_time( 125 e, 126 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 127 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 128 ), 129 ), 130 exp.UnixToTime: unsupported_args("scale", "zone", "hours", "minutes")( 131 lambda self, e: self.func( 132 "FROM_UNIXTIME", 133 e.this, 134 self.format_time( 135 e, 136 inverse_time_mapping=MySQL.INVERSE_TIME_MAPPING, 137 inverse_time_trie=MySQL.INVERSE_TIME_TRIE, 138 ), 139 ), 140 ), 141 exp.UnixToTimeStr: lambda self, e: f"FROM_UNIXTIME({self.sql(e, 'this')}) :> TEXT", 142 } 143 144 # https://docs.singlestore.com/cloud/reference/sql-reference/restricted-keywords/list-of-restricted-keywords/ 145 RESERVED_KEYWORDS = { 146 "abs", 147 "absolute", 148 "access", 149 "account", 150 "acos", 151 "action", 152 "add", 153 "adddate", 154 "addtime", 155 "admin", 156 "aes_decrypt", 157 "aes_encrypt", 158 "after", 159 "against", 160 "aggregate", 161 "aggregates", 162 "aggregator", 163 "aggregator_id", 164 "aggregator_plan_hash", 165 "aggregators", 166 "algorithm", 167 "all", 168 "also", 169 "alter", 170 "always", 171 "analyse", 172 "analyze", 173 "and", 174 "anti_join", 175 "any", 176 "any_value", 177 "approx_count_distinct", 178 "approx_count_distinct_accumulate", 179 "approx_count_distinct_combine", 180 "approx_count_distinct_estimate", 181 "approx_geography_intersects", 182 "approx_percentile", 183 "arghistory", 184 "arrange", 185 "arrangement", 186 "array", 187 "as", 188 "asc", 189 "ascii", 190 "asensitive", 191 "asin", 192 "asm", 193 "assertion", 194 "assignment", 195 "ast", 196 "asymmetric", 197 "async", 198 "at", 199 "atan", 200 "atan2", 201 "attach", 202 "attribute", 203 "authorization", 204 "auto", 205 "auto_increment", 206 "auto_reprovision", 207 "autostats", 208 "autostats_cardinality_mode", 209 "autostats_enabled", 210 "autostats_histogram_mode", 211 "autostats_sampling", 212 "availability", 213 "avg", 214 "avg_row_length", 215 "avro", 216 "azure", 217 "background", 218 "_background_threads_for_cleanup", 219 "backup", 220 "backup_history", 221 "backup_id", 222 "backward", 223 "batch", 224 "batches", 225 "batch_interval", 226 "_batch_size_limit", 227 "before", 228 "begin", 229 "between", 230 "bigint", 231 "bin", 232 "binary", 233 "_binary", 234 "bit", 235 "bit_and", 236 "bit_count", 237 "bit_or", 238 "bit_xor", 239 "blob", 240 "bool", 241 "boolean", 242 "bootstrap", 243 "both", 244 "_bt", 245 "btree", 246 "bucket_count", 247 "by", 248 "byte", 249 "byte_length", 250 "cache", 251 "call", 252 "call_for_pipeline", 253 "called", 254 "capture", 255 "cascade", 256 "cascaded", 257 "case", 258 "cast", 259 "catalog", 260 "ceil", 261 "ceiling", 262 "chain", 263 "change", 264 "char", 265 "character", 266 "characteristics", 267 "character_length", 268 "char_length", 269 "charset", 270 "check", 271 "checkpoint", 272 "_check_can_connect", 273 "_check_consistency", 274 "checksum", 275 "_checksum", 276 "class", 277 "clear", 278 "client", 279 "client_found_rows", 280 "close", 281 "cluster", 282 "clustered", 283 "cnf", 284 "coalesce", 285 "coercibility", 286 "collate", 287 "collation", 288 "collect", 289 "column", 290 "columnar", 291 "columns", 292 "columnstore", 293 "columnstore_segment_rows", 294 "comment", 295 "comments", 296 "commit", 297 "committed", 298 "_commit_log_tail", 299 "committed", 300 "compact", 301 "compile", 302 "compressed", 303 "compression", 304 "concat", 305 "concat_ws", 306 "concurrent", 307 "concurrently", 308 "condition", 309 "configuration", 310 "connection", 311 "connection_id", 312 "connections", 313 "config", 314 "constraint", 315 "constraints", 316 "content", 317 "continue", 318 "_continue_replay", 319 "conv", 320 "conversion", 321 "convert", 322 "convert_tz", 323 "copy", 324 "_core", 325 "cos", 326 "cost", 327 "cot", 328 "count", 329 "create", 330 "credentials", 331 "cross", 332 "cube", 333 "csv", 334 "cume_dist", 335 "curdate", 336 "current", 337 "current_catalog", 338 "current_date", 339 "current_role", 340 "current_schema", 341 "current_security_groups", 342 "current_security_roles", 343 "current_time", 344 "current_timestamp", 345 "current_user", 346 "cursor", 347 "curtime", 348 "cycle", 349 "data", 350 "database", 351 "databases", 352 "date", 353 "date_add", 354 "datediff", 355 "date_format", 356 "date_sub", 357 "date_trunc", 358 "datetime", 359 "day", 360 "day_hour", 361 "day_microsecond", 362 "day_minute", 363 "dayname", 364 "dayofmonth", 365 "dayofweek", 366 "dayofyear", 367 "day_second", 368 "deallocate", 369 "dec", 370 "decimal", 371 "declare", 372 "decode", 373 "default", 374 "defaults", 375 "deferrable", 376 "deferred", 377 "defined", 378 "definer", 379 "degrees", 380 "delayed", 381 "delay_key_write", 382 "delete", 383 "delimiter", 384 "delimiters", 385 "dense_rank", 386 "desc", 387 "describe", 388 "detach", 389 "deterministic", 390 "dictionary", 391 "differential", 392 "directory", 393 "disable", 394 "discard", 395 "_disconnect", 396 "disk", 397 "distinct", 398 "distinctrow", 399 "distributed_joins", 400 "div", 401 "do", 402 "document", 403 "domain", 404 "dot_product", 405 "double", 406 "drop", 407 "_drop_profile", 408 "dual", 409 "dump", 410 "duplicate", 411 "dynamic", 412 "earliest", 413 "each", 414 "echo", 415 "election", 416 "else", 417 "elseif", 418 "elt", 419 "enable", 420 "enclosed", 421 "encoding", 422 "encrypted", 423 "end", 424 "engine", 425 "engines", 426 "enum", 427 "errors", 428 "escape", 429 "escaped", 430 "estimate", 431 "euclidean_distance", 432 "event", 433 "events", 434 "except", 435 "exclude", 436 "excluding", 437 "exclusive", 438 "execute", 439 "exists", 440 "exit", 441 "exp", 442 "explain", 443 "extended", 444 "extension", 445 "external", 446 "external_host", 447 "external_port", 448 "extract", 449 "extractor", 450 "extractors", 451 "extra_join", 452 "_failover", 453 "failed_login_attempts", 454 "failure", 455 "false", 456 "family", 457 "fault", 458 "fetch", 459 "field", 460 "fields", 461 "file", 462 "files", 463 "fill", 464 "first", 465 "first_value", 466 "fix_alter", 467 "fixed", 468 "float", 469 "float4", 470 "float8", 471 "floor", 472 "flush", 473 "following", 474 "for", 475 "force", 476 "force_compiled_mode", 477 "force_interpreter_mode", 478 "foreground", 479 "foreign", 480 "format", 481 "forward", 482 "found_rows", 483 "freeze", 484 "from", 485 "from_base64", 486 "from_days", 487 "from_unixtime", 488 "fs", 489 "_fsync", 490 "full", 491 "fulltext", 492 "function", 493 "functions", 494 "gc", 495 "gcs", 496 "get_format", 497 "_gc", 498 "_gcx", 499 "generate", 500 "geography", 501 "geography_area", 502 "geography_contains", 503 "geography_distance", 504 "geography_intersects", 505 "geography_latitude", 506 "geography_length", 507 "geography_longitude", 508 "geographypoint", 509 "geography_point", 510 "geography_within_distance", 511 "geometry", 512 "geometry_area", 513 "geometry_contains", 514 "geometry_distance", 515 "geometry_filter", 516 "geometry_intersects", 517 "geometry_length", 518 "geometrypoint", 519 "geometry_point", 520 "geometry_within_distance", 521 "geometry_x", 522 "geometry_y", 523 "global", 524 "_global_version_timestamp", 525 "grant", 526 "granted", 527 "grants", 528 "greatest", 529 "group", 530 "grouping", 531 "groups", 532 "group_concat", 533 "gzip", 534 "handle", 535 "handler", 536 "hard_cpu_limit_percentage", 537 "hash", 538 "has_temp_tables", 539 "having", 540 "hdfs", 541 "header", 542 "heartbeat_no_logging", 543 "hex", 544 "highlight", 545 "high_priority", 546 "hold", 547 "holding", 548 "host", 549 "hosts", 550 "hour", 551 "hour_microsecond", 552 "hour_minute", 553 "hour_second", 554 "identified", 555 "identity", 556 "if", 557 "ifnull", 558 "ignore", 559 "ilike", 560 "immediate", 561 "immutable", 562 "implicit", 563 "import", 564 "in", 565 "including", 566 "increment", 567 "incremental", 568 "index", 569 "indexes", 570 "inet_aton", 571 "inet_ntoa", 572 "inet6_aton", 573 "inet6_ntoa", 574 "infile", 575 "inherit", 576 "inherits", 577 "_init_profile", 578 "init", 579 "initcap", 580 "initialize", 581 "initially", 582 "inject", 583 "inline", 584 "inner", 585 "inout", 586 "input", 587 "insensitive", 588 "insert", 589 "insert_method", 590 "instance", 591 "instead", 592 "instr", 593 "int", 594 "int1", 595 "int2", 596 "int3", 597 "int4", 598 "int8", 599 "integer", 600 "_internal_dynamic_typecast", 601 "interpreter_mode", 602 "intersect", 603 "interval", 604 "into", 605 "invoker", 606 "is", 607 "isnull", 608 "isolation", 609 "iterate", 610 "join", 611 "json", 612 "json_agg", 613 "json_array_contains_double", 614 "json_array_contains_json", 615 "json_array_contains_string", 616 "json_array_push_double", 617 "json_array_push_json", 618 "json_array_push_string", 619 "json_delete_key", 620 "json_extract_double", 621 "json_extract_json", 622 "json_extract_string", 623 "json_extract_bigint", 624 "json_get_type", 625 "json_length", 626 "json_set_double", 627 "json_set_json", 628 "json_set_string", 629 "json_splice_double", 630 "json_splice_json", 631 "json_splice_string", 632 "kafka", 633 "key", 634 "key_block_size", 635 "keys", 636 "kill", 637 "killall", 638 "label", 639 "lag", 640 "language", 641 "large", 642 "last", 643 "last_day", 644 "last_insert_id", 645 "last_value", 646 "lateral", 647 "latest", 648 "lc_collate", 649 "lc_ctype", 650 "lcase", 651 "lead", 652 "leading", 653 "leaf", 654 "leakproof", 655 "least", 656 "leave", 657 "leaves", 658 "left", 659 "length", 660 "level", 661 "license", 662 "like", 663 "limit", 664 "lines", 665 "listen", 666 "llvm", 667 "ln", 668 "load", 669 "loaddata_where", 670 "_load", 671 "local", 672 "localtime", 673 "localtimestamp", 674 "locate", 675 "location", 676 "lock", 677 "log", 678 "log10", 679 "log2", 680 "long", 681 "longblob", 682 "longtext", 683 "loop", 684 "lower", 685 "low_priority", 686 "lpad", 687 "_ls", 688 "ltrim", 689 "lz4", 690 "management", 691 "_management_thread", 692 "mapping", 693 "master", 694 "match", 695 "materialized", 696 "max", 697 "maxvalue", 698 "max_concurrency", 699 "max_errors", 700 "max_partitions_per_batch", 701 "max_queue_depth", 702 "max_retries_per_batch_partition", 703 "max_rows", 704 "mbc", 705 "md5", 706 "mpl", 707 "median", 708 "mediumblob", 709 "mediumint", 710 "mediumtext", 711 "member", 712 "memory", 713 "memory_percentage", 714 "_memsql_table_id_lookup", 715 "memsql", 716 "memsql_deserialize", 717 "memsql_imitating_kafka", 718 "memsql_serialize", 719 "merge", 720 "metadata", 721 "microsecond", 722 "middleint", 723 "min", 724 "min_rows", 725 "minus", 726 "minute", 727 "minute_microsecond", 728 "minute_second", 729 "minvalue", 730 "mod", 731 "mode", 732 "model", 733 "modifies", 734 "modify", 735 "month", 736 "monthname", 737 "months_between", 738 "move", 739 "mpl", 740 "names", 741 "named", 742 "namespace", 743 "national", 744 "natural", 745 "nchar", 746 "next", 747 "no", 748 "node", 749 "none", 750 "no_query_rewrite", 751 "noparam", 752 "not", 753 "nothing", 754 "notify", 755 "now", 756 "nowait", 757 "no_write_to_binlog", 758 "no_query_rewrite", 759 "norely", 760 "nth_value", 761 "ntile", 762 "null", 763 "nullcols", 764 "nullif", 765 "nulls", 766 "numeric", 767 "nvarchar", 768 "object", 769 "octet_length", 770 "of", 771 "off", 772 "offline", 773 "offset", 774 "offsets", 775 "oids", 776 "on", 777 "online", 778 "only", 779 "open", 780 "operator", 781 "optimization", 782 "optimize", 783 "optimizer", 784 "optimizer_state", 785 "option", 786 "options", 787 "optionally", 788 "or", 789 "order", 790 "ordered_serialize", 791 "orphan", 792 "out", 793 "out_of_order", 794 "outer", 795 "outfile", 796 "over", 797 "overlaps", 798 "overlay", 799 "owned", 800 "owner", 801 "pack_keys", 802 "paired", 803 "parser", 804 "parquet", 805 "partial", 806 "partition", 807 "partition_id", 808 "partitioning", 809 "partitions", 810 "passing", 811 "password", 812 "password_lock_time", 813 "parser", 814 "pause", 815 "_pause_replay", 816 "percent_rank", 817 "percentile_cont", 818 "percentile_disc", 819 "periodic", 820 "persisted", 821 "pi", 822 "pipeline", 823 "pipelines", 824 "pivot", 825 "placing", 826 "plan", 827 "plans", 828 "plancache", 829 "plugins", 830 "pool", 831 "pools", 832 "port", 833 "position", 834 "pow", 835 "power", 836 "preceding", 837 "precision", 838 "prepare", 839 "prepared", 840 "preserve", 841 "primary", 842 "prior", 843 "privileges", 844 "procedural", 845 "procedure", 846 "procedures", 847 "process", 848 "processlist", 849 "profile", 850 "profiles", 851 "program", 852 "promote", 853 "proxy", 854 "purge", 855 "quarter", 856 "queries", 857 "query", 858 "query_timeout", 859 "queue", 860 "quote", 861 "radians", 862 "rand", 863 "range", 864 "rank", 865 "read", 866 "_read", 867 "reads", 868 "real", 869 "reassign", 870 "rebalance", 871 "recheck", 872 "record", 873 "recursive", 874 "redundancy", 875 "redundant", 876 "ref", 877 "reference", 878 "references", 879 "refresh", 880 "regexp", 881 "reindex", 882 "relative", 883 "release", 884 "reload", 885 "rely", 886 "remote", 887 "remove", 888 "rename", 889 "repair", 890 "_repair_table", 891 "repeat", 892 "repeatable", 893 "_repl", 894 "_reprovisioning", 895 "replace", 896 "replica", 897 "replicate", 898 "replicating", 899 "replication", 900 "durability", 901 "require", 902 "resource", 903 "resource_pool", 904 "reset", 905 "restart", 906 "restore", 907 "restrict", 908 "result", 909 "_resurrect", 910 "retry", 911 "return", 912 "returning", 913 "returns", 914 "reverse", 915 "revoke", 916 "rg_pool", 917 "right", 918 "right_anti_join", 919 "right_semi_join", 920 "right_straight_join", 921 "rlike", 922 "role", 923 "roles", 924 "rollback", 925 "rollup", 926 "round", 927 "routine", 928 "row", 929 "row_count", 930 "row_format", 931 "row_number", 932 "rows", 933 "rowstore", 934 "rule", 935 "rpad", 936 "_rpc", 937 "rtrim", 938 "running", 939 "s3", 940 "safe", 941 "save", 942 "savepoint", 943 "scalar", 944 "schema", 945 "schemas", 946 "schema_binding", 947 "scroll", 948 "search", 949 "second", 950 "second_microsecond", 951 "sec_to_time", 952 "security", 953 "select", 954 "semi_join", 955 "_send_threads", 956 "sensitive", 957 "separator", 958 "sequence", 959 "sequences", 960 "serial", 961 "serializable", 962 "series", 963 "service_user", 964 "server", 965 "session", 966 "session_user", 967 "set", 968 "setof", 969 "security_lists_intersect", 970 "sha", 971 "sha1", 972 "sha2", 973 "shard", 974 "sharded", 975 "sharded_id", 976 "share", 977 "show", 978 "shutdown", 979 "sigmoid", 980 "sign", 981 "signal", 982 "similar", 983 "simple", 984 "site", 985 "signed", 986 "sin", 987 "skip", 988 "skipped_batches", 989 "sleep", 990 "_sleep", 991 "smallint", 992 "snapshot", 993 "_snapshot", 994 "_snapshots", 995 "soft_cpu_limit_percentage", 996 "some", 997 "soname", 998 "sparse", 999 "spatial", 1000 "spatial_check_index", 1001 "specific", 1002 "split", 1003 "sql", 1004 "sql_big_result", 1005 "sql_buffer_result", 1006 "sql_cache", 1007 "sql_calc_found_rows", 1008 "sqlexception", 1009 "sql_mode", 1010 "sql_no_cache", 1011 "sql_no_logging", 1012 "sql_small_result", 1013 "sqlstate", 1014 "sqlwarning", 1015 "sqrt", 1016 "ssl", 1017 "stable", 1018 "standalone", 1019 "start", 1020 "starting", 1021 "state", 1022 "statement", 1023 "statistics", 1024 "stats", 1025 "status", 1026 "std", 1027 "stddev", 1028 "stddev_pop", 1029 "stddev_samp", 1030 "stdin", 1031 "stdout", 1032 "stop", 1033 "storage", 1034 "str_to_date", 1035 "straight_join", 1036 "strict", 1037 "string", 1038 "strip", 1039 "subdate", 1040 "substr", 1041 "substring", 1042 "substring_index", 1043 "success", 1044 "sum", 1045 "super", 1046 "symmetric", 1047 "sync_snapshot", 1048 "sync", 1049 "_sync", 1050 "_sync2", 1051 "_sync_partitions", 1052 "_sync_snapshot", 1053 "synchronize", 1054 "sysid", 1055 "system", 1056 "table", 1057 "table_checksum", 1058 "tables", 1059 "tablespace", 1060 "tags", 1061 "tan", 1062 "target_size", 1063 "task", 1064 "temp", 1065 "template", 1066 "temporary", 1067 "temptable", 1068 "_term_bump", 1069 "terminate", 1070 "terminated", 1071 "test", 1072 "text", 1073 "then", 1074 "time", 1075 "timediff", 1076 "time_bucket", 1077 "time_format", 1078 "timeout", 1079 "timestamp", 1080 "timestampadd", 1081 "timestampdiff", 1082 "timezone", 1083 "time_to_sec", 1084 "tinyblob", 1085 "tinyint", 1086 "tinytext", 1087 "to", 1088 "to_base64", 1089 "to_char", 1090 "to_date", 1091 "to_days", 1092 "to_json", 1093 "to_number", 1094 "to_seconds", 1095 "to_timestamp", 1096 "tracelogs", 1097 "traditional", 1098 "trailing", 1099 "transform", 1100 "transaction", 1101 "_transactions_experimental", 1102 "treat", 1103 "trigger", 1104 "triggers", 1105 "trim", 1106 "true", 1107 "trunc", 1108 "truncate", 1109 "trusted", 1110 "two_phase", 1111 "_twopcid", 1112 "type", 1113 "types", 1114 "ucase", 1115 "unbounded", 1116 "uncommitted", 1117 "undefined", 1118 "undo", 1119 "unencrypted", 1120 "unenforced", 1121 "unhex", 1122 "unhold", 1123 "unicode", 1124 "union", 1125 "unique", 1126 "_unittest", 1127 "unix_timestamp", 1128 "unknown", 1129 "unlisten", 1130 "_unload", 1131 "unlock", 1132 "unlogged", 1133 "unpivot", 1134 "unsigned", 1135 "until", 1136 "update", 1137 "upgrade", 1138 "upper", 1139 "usage", 1140 "use", 1141 "user", 1142 "users", 1143 "using", 1144 "utc_date", 1145 "utc_time", 1146 "utc_timestamp", 1147 "_utf8", 1148 "vacuum", 1149 "valid", 1150 "validate", 1151 "validator", 1152 "value", 1153 "values", 1154 "varbinary", 1155 "varchar", 1156 "varcharacter", 1157 "variables", 1158 "variadic", 1159 "variance", 1160 "var_pop", 1161 "var_samp", 1162 "varying", 1163 "vector_sub", 1164 "verbose", 1165 "version", 1166 "view", 1167 "void", 1168 "volatile", 1169 "voting", 1170 "wait", 1171 "_wake", 1172 "warnings", 1173 "week", 1174 "weekday", 1175 "weekofyear", 1176 "when", 1177 "where", 1178 "while", 1179 "whitespace", 1180 "window", 1181 "with", 1182 "without", 1183 "within", 1184 "_wm_heartbeat", 1185 "work", 1186 "workload", 1187 "wrapper", 1188 "write", 1189 "xact_id", 1190 "xor", 1191 "year", 1192 "year_month", 1193 "yes", 1194 "zerofill", 1195 "zone", 1196 }
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.WeekStart'>: <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 SingleStore.Generator.<lambda>>, <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 SingleStore.Generator.<lambda>>, <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>>, <class 'sqlglot.expressions.Cast'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.StrToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.TimeToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.UnixSeconds'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.UnixToStr'>: <function SingleStore.Generator.<lambda>>, <class 'sqlglot.expressions.UnixToTimeStr'>: <function SingleStore.Generator.<lambda>>}
RESERVED_KEYWORDS =
{'distinct', 'left', 'whitespace', 'wrapper', 'replica', 'acos', '_repl', 'str_to_date', 'geometry_distance', 'procedure', 'ifnull', 'online', 'varchar', 'option', 'to_timestamp', 'fulltext', 'pipeline', 'tracelogs', 'no_write_to_binlog', 'deferrable', 'day_minute', 'geometry_within_distance', 'json_extract_bigint', 'procedural', 'gcs', 'leave', 'target_size', 'into', 'heartbeat_no_logging', 'iterate', 'set', 'system', 'clear', 'lc_ctype', 'to_days', 'dot_product', 'llvm', 'compression', 'sleep', 'shard', 'in', 'namespace', 'match', 'ceil', 'json_splice_double', 'tinytext', 'variadic', 'sin', 'discard', 'plan', 'plugins', 'keys', 'serializable', 'to_number', 'coalesce', 'optionally', 'tinyblob', 'except', 'query_timeout', 'process', 'client_found_rows', 'minute_second', 'real', 'geometry_intersects', 'second_microsecond', 'access', 'minus', 'json_delete_key', 'least', 'all', 'foreign', 'extended', 'drop', 'synchronize', '_reprovisioning', 'euclidean_distance', 'then', 'type', 'arrangement', 'rollup', 'similar', 'bigint', 'float', 'unlock', 'committed', 'exclusive', 'model', 'function', 'current_user', 'begin', 'grouping', 'simple', 'not', 'minute_microsecond', 'geometry_length', '_transactions_experimental', 'proxy', '_unload', 'duplicate', 'unhex', 'ordered_serialize', 'refresh', 'stdout', 'input', 'flush', 'reads', 'killall', 'events', 'nulls', 'checksum', 'leakproof', 'do', 'inout', 'microsecond', 'percentile_disc', 'sql_buffer_result', 'redundancy', 'preceding', 'modifies', 'conversion', 'external_host', 'setof', 'terminate', 'partition', 'inet6_aton', 'prepare', 'first', 'maxvalue', 'close', 'kafka', 'chain', 'scroll', 'aes_decrypt', 'approx_count_distinct', 'content', 'pack_keys', 'strict', 'hosts', 'cycle', 'where', 'some', 'files', 'repeatable', 'mediumtext', '_bt', 'year_month', 'signed', 'holding', 'rebalance', 'security_lists_intersect', 'instead', 'json_length', 'inline', 'call_for_pipeline', 'leading', 'interval', 'boolean', 'auto', 'connections', 'rule', 'mode', 'safe', 'lz4', 'sharded', 'condition', 'dec', 'current_catalog', 'geographypoint', 'restart', 'sql_no_logging', 'check', 'to_json', 'databases', 'rank', 'yes', 'radians', 'inet_ntoa', 'language', 'sql_big_result', '_resurrect', 'object', 'octet_length', 'repeat', 'implicit', 'large', 'call', 'quarter', 'temptable', 'tables', 'current_timestamp', 'connection_id', 'using', 'dictionary', 'geometry_point', '_unittest', 'bin', 'min_rows', 'rename', 'ceiling', 'cross', 'avro', 'delimiter', 'mpl', 'var_pop', 'locate', 'over', 'exists', 'extension', 'isnull', 'or', 'show', 'engine', 'prepared', 'fs', 'middleint', 'sync', 'partitioning', 'domain', 'dense_rank', '_term_bump', '_init_profile', 'quote', 'extractor', 'declare', 'vacuum', 'only', 'unlogged', 'durability', 'range', 'column', 'local', 'called', 'no', 'conv', 'geometrypoint', 'initially', 'false', '_continue_replay', 'sqlexception', 'replace', 'pipelines', '_twopcid', 'attach', 'timestampadd', 'mbc', 'hold', 'including', 'decode', 'data', 'plancache', 'sequences', 'approx_percentile', '_background_threads_for_cleanup', 'lc_collate', 'delayed', 'json_array_push_string', 'long', 'join', 'starting', 'void', 'tablespace', 'intersect', 'backup_history', 'skipped_batches', 'to_char', 'force_interpreter_mode', 'week', 'json_array_push_json', 'failure', 'distinctrow', 'when', 'asensitive', 'atan2', 'profile', 'level', '_wm_heartbeat', 'mediumblob', 'xact_id', 'lateral', 'location', 'json_array_contains_json', 'autostats_sampling', 'having', 'delimiters', 'inet6_ntoa', 'spatial_check_index', 'month', 'bootstrap', 'undefined', 'estimate', 'port', 'ucase', 'cast', 'stats', 'utc_date', 'freeze', 'arrange', 'rand', 'dayname', 'nth_value', 'save', 'trusted', 'persisted', 'trailing', 'nullcols', '_internal_dynamic_typecast', 'serial', 'gzip', 'cascaded', 'autostats_cardinality_mode', 'nvarchar', 'utc_time', '_load', 'arghistory', 'now', 'pool', 'end', '_global_version_timestamp', 'password', 'json', 'position', 'like', 'geometry', 'rpad', 'columnstore_segment_rows', 'operator', 'adddate', 'max_concurrency', 'log', 'columns', '_binary', 'backup', 'count', 'storage', 'placing', 'definer', 'connection', 'extractors', 'incremental', 'max_errors', 'cot', 'reindex', 'default', '_gc', 'std', 'null', 'return', 'identified', 'geography_within_distance', 'int1', 'binary', 'identity', 'role', '_checksum', 'traditional', 'mediumint', 'sec_to_time', 'nullif', 'immutable', 'json_splice_string', 'max', 'before', 'at', 'compressed', 'out_of_order', 'and', 'inner', 'json_get_type', 'avg_row_length', 'specific', 'row', 'resource_pool', '_commit_log_tail', 'both', 'memsql_imitating_kafka', 'memory_percentage', 'until', 'select', 'replicating', 'geography_latitude', 'action', 'numeric', 'ast', 'dayofyear', 'unpivot', 'div', 'fetch', 'users', 'hard_cpu_limit_percentage', 'bit_xor', 'sigmoid', 'minvalue', 'start', 'stddev', '_gcx', 'auto_increment', 'replicate', 'any', 'aggregator_plan_hash', 'right', 'cube', 'second', 'group', 'json_extract_json', 'ntile', 'processlist', 'sql_mode', 'partition_id', 'compact', 'schema', '_memsql_table_id_lookup', 'concurrent', 'latest', 'external_port', 'timeout', 'localtime', 'nowait', 'pools', 'pi', 'table_checksum', 'for', 'escape', '_sleep', 'format', 'asc', 'exp', 'hdfs', 'checkpoint', 'date_sub', 'concat_ws', 'cache', 'current_role', 'unlisten', '_rpc', 'sql_calc_found_rows', 'pow', 'groups', 'stddev_pop', 'int4', 'grant', 'symmetric', 'json_array_push_double', 'tinyint', 'unenforced', 'offset', 'rg_pool', 'escaped', 'autostats', 'datetime', 'redundant', 'status', 'absolute', 'lag', '_check_consistency', 'if', 'datediff', 'rtrim', 'trunc', 'always', 'window', 'year', 'unix_timestamp', 'convert_tz', 'scalar', 'btree', 'periodic', 'degrees', 'approx_count_distinct_combine', 'backward', 'owned', 'program', 'prior', 'distributed_joins', 'soft_cpu_limit_percentage', 'generate', 'first_value', 'excluding', 'has_temp_tables', 'csv', 'is', 'ascii', 'listen', 'after', 'key', 'increment', 'background', 'stddev_samp', 'tags', 'json_set_double', 'varbinary', 'soname', 'geography_distance', 'noparam', 'int2', 'create', 'national', 'row_count', 'replication', 'describe', 'geography_contains', 'weekday', 'functions', 'primary', 'time_format', 'use', 'isolation', 'signal', 'hour_second', 'dump', 'hour', 'highlight', 'decimal', 'session_user', 'query', 'character', 'variance', 'int', 'lpad', 'test', 'within', 'procedures', 'event', 'time_to_sec', 'family', 'detach', 'statistics', 'none', 'precision', 'without', 'substr', 'purge', 'profiles', 'columnstore', 'fields', 'master', 'approx_geography_intersects', 'relative', 'series', 'validator', 'fault', 'tan', 'against', 'also', 'longtext', 'oids', 'pivot', 'availability', 'share', 'json_extract_double', 'temporary', 'geography_intersects', 'aggregator_id', 'constraint', 'geometry_area', 'handler', 'license', 'utc_timestamp', '_sync_snapshot', 'admin', 'release', 'last', 'inject', 'rlike', 'credentials', 'current_schema', 'merge', 'validate', 'schema_binding', 'bucket_count', 'comment', 'sql', 'unicode', 'modify', 'array', 'desc', 'split', 'encrypted', 'each', 'sha', 'clustered', 'hour_minute', 'recursive', 'standalone', 'encoding', 'char', 'ignore', 'lines', 'on', 'transaction', 'sha2', 'asm', 'zone', 'weekofyear', 'else', 'unencrypted', 'pause', 'grants', 'separator', 'addtime', 'snapshot', 'timestampdiff', 'work', 'alter', 'ilike', 'uncommitted', 'approx_count_distinct_accumulate', 'outer', 'directory', 'power', 'version', 'defaults', 'shutdown', 'hash', 'batches', 'sqrt', 'document', 'ssl', 'voting', 'substring', 'sync_snapshot', 'stdin', 'server', 'verbose', '_ls', 'norely', 'median', 'key_block_size', '_repair_table', 'stop', 'fix_alter', 'approx_count_distinct_estimate', 'log10', 'right_anti_join', 'to_date', 'hex', 'terminated', 'sign', 'full', 'async', 'ltrim', 'read', 'undo', 'next', 'differential', 'sql_no_cache', 'geometry_x', 'auto_reprovision', 'require', 'instance', 'ref', 'values', 'stable', 'spatial', 'regexp', 'out', 'trim', 'outfile', 'right_semi_join', 'exit', 'cursor', 'reverse', 'resource', 'float8', 'autostats_histogram_mode', 'account', 'from', 'batch', 'algorithm', 'enclosed', 'index', 'kill', 'characteristics', 'volatile', 'workload', 'compile', 'nchar', '_snapshots', 'date_trunc', 'columnar', '_read', 'avg', 'last_day', 'sql_small_result', 'timezone', 'valid', 'granted', 'triggers', 'insert_method', 'wait', 'treat', 'returning', 'curtime', 'retry', 'anti_join', 'aggregate', 'float4', 'current_time', 'unbounded', 'aes_encrypt', 'mapping', 'upper', 'backup_id', 'site', '_drop_profile', 'concurrently', 'comments', 'restore', '_send_threads', 'continue', 'true', 'max_rows', 'leaves', 'to_base64', 'abs', 'concat', 'running', 'while', 'analyze', 'batch_interval', 'sysid', 'errors', 'memsql_serialize', 'template', 'any_value', 'gc', 'owner', 'autostats_enabled', '_sync2', 'found_rows', 'byte_length', 'case', 'collation', 'service_user', 'following', 'partial', 'reload', 'member', 'semi_join', 'returns', 'minute', 'xor', 'success', 'materialized', 'initcap', 'last_value', 'with', 'constraints', 'of', 'cos', 'recheck', 'nothing', 'sum', 'force_compiled_mode', 'time', 'aggregates', 'promote', 'date_add', 'subdate', 'write', 'geometry_y', 'queue', 'commit', 'hour_microsecond', 'no_query_rewrite', 'log2', 'disk', 'dual', 'inherit', 'two_phase', 'high_priority', 'config', 'reference', 'low_priority', 'json_set_string', 'result', 'privileges', 'to_seconds', 'optimization', 'convert', 'enable', 'bit_count', 'label', 'unhold', 'management', 'named', 'geography', 'immediate', 'user', 'double', 'day_second', 'disable', '_failover', 'char_length', 'json_agg', 'foreground', 'localtimestamp', 'metadata', 'current_security_roles', 'table', 'offline', 'election', 'row_format', 'timediff', 'view', 'greatest', 'bit', 'geometry_filter', 'password_lock_time', 'lead', 'sequence', 'delay_key_write', 'names', 'dayofweek', 'configuration', 'straight_join', 'restrict', 'months_between', 'extra_join', 'roles', 'remote', 'state', 'load', 'references', 'instr', 'temp', 'routine', 'deterministic', 'rollback', 'session', 'memsql_deserialize', 'forward', 'handle', 'change', 'deallocate', '_core', 'monthname', 'attribute', 'value', 'rely', 'partitions', 'deferred', 'bit_or', 'statement', 'cost', 'defined', 'insert', 'echo', 'lock', 'reset', 'limit', 'security', 'aggregator', 'file', 'capture', 'loop', 'revoke', 'types', 'to', 'transform', 'union', 'asymmetric', 'cnf', 'json_set_json', 'longblob', 'elt', 'passing', 'max_retries_per_batch_partition', 'fill', 'offsets', 'sqlstate', 'overlaps', 'text', 'search', 'task', 'byte', 'bit_and', 'between', 'warnings', 'json_splice_json', 'leaf', 'sha1', 'invoker', 'interpreter_mode', 'elseif', 'class', 'percentile_cont', 'time_bucket', 'open', 'queries', 'by', '_pause_replay', 'initialize', 'varying', 'from_base64', 'variables', 'charset', 'geography_longitude', 'init', 'assertion', 's3', 'geometry_contains', 'execute', 'bool', 'day_hour', 'geography_area', 'date_format', 'node', 'percent_rank', 'trigger', 'truncate', 'min', 'header', 'atan', 'current', 'import', 'day', 'lower', 'natural', 'order', 'add', 'from_unixtime', 'strip', 'off', 'substring_index', 'delete', 'sql_cache', 'super', 'database', 'memsql', 'earliest', 'schemas', 'move', 'timestamp', 'geography_length', 'loaddata_where', 'explain', 'force', 'row_number', 'ln', 'record', 'max_partitions_per_batch', 'blob', 'optimizer', 'client', '_wake', 'cascade', 'failed_login_attempts', 'optimizer_state', 'date', 'plans', 'engines', 'sensitive', 'authorization', 'current_security_groups', 'usage', 'parser', 'length', 'cume_dist', 'indexes', '_utf8', 'day_microsecond', 'assignment', 'skip', 'copy', 'sparse', 'sharded_id', 'sqlwarning', 'json_array_contains_double', 'mod', '_management_thread', 'smallint', 'max_queue_depth', 'update', 'unknown', 'analyse', 'var_samp', 'lcase', 'orphan', 'unique', '_check_can_connect', 'string', 'get_format', 'dayofmonth', 'collect', 'field', 'insensitive', 'rows', 'overlay', 'savepoint', '_disconnect', 'last_insert_id', 'character_length', '_batch_size_limit', 'aggregators', 'reassign', 'unsigned', 'coercibility', 'int8', 'memory', 'inherits', 'varcharacter', 'geography_point', '_sync_partitions', 'paired', 'optimize', 'rowstore', 'upgrade', 'current_date', 'exclude', 'options', '_fsync', 'from_days', 'host', 'json_extract_string', 'repair', 'enum', 'catalog', 'int3', 'dynamic', 'azure', 'infile', 'parquet', 'right_straight_join', 'collate', 'global', 'fixed', 'cluster', 'inet_aton', 'json_array_contains_string', '_sync', 'md5', 'as', 'notify', '_snapshot', 'curdate', 'group_concat', 'extract', 'floor', 'integer', 'preserve', 'vector_sub', 'zerofill', 'round', 'asin', 'remove', 'external'}
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
- queryband_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
- getextract_sql
- datefromunixdate_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