Edit on GitHub

# sqlglot.dialects.clickhouse

View Source

      1from __future__ import annotations
      2
      3import typing as t
      4
      5from sqlglot import exp, generator, parser, tokens, transforms
      6from sqlglot.dialects.dialect import (
      7    Dialect,
      8    arg_max_or_min_no_count,
      9    build_formatted_time,
     10    date_delta_sql,
     11    inline_array_sql,
     12    json_extract_segments,
     13    json_path_key_only_name,
     14    no_pivot_sql,
     15    build_json_extract_path,
     16    rename_func,
     17    var_map_sql,
     18    timestamptrunc_sql,
     19)
     20from sqlglot.helper import is_int, seq_get
     21from sqlglot.tokens import Token, TokenType
     22
     23
     24def _build_date_format(args: t.List) -> exp.TimeToStr:
     25    expr = build_formatted_time(exp.TimeToStr, "clickhouse")(args)
     26
     27    timezone = seq_get(args, 2)
     28    if timezone:
     29        expr.set("timezone", timezone)
     30
     31    return expr
     32
     33
     34def _unix_to_time_sql(self: ClickHouse.Generator, expression: exp.UnixToTime) -> str:
     35    scale = expression.args.get("scale")
     36    timestamp = expression.this
     37
     38    if scale in (None, exp.UnixToTime.SECONDS):
     39        return self.func("fromUnixTimestamp", exp.cast(timestamp, exp.DataType.Type.BIGINT))
     40    if scale == exp.UnixToTime.MILLIS:
     41        return self.func("fromUnixTimestamp64Milli", exp.cast(timestamp, exp.DataType.Type.BIGINT))
     42    if scale == exp.UnixToTime.MICROS:
     43        return self.func("fromUnixTimestamp64Micro", exp.cast(timestamp, exp.DataType.Type.BIGINT))
     44    if scale == exp.UnixToTime.NANOS:
     45        return self.func("fromUnixTimestamp64Nano", exp.cast(timestamp, exp.DataType.Type.BIGINT))
     46
     47    return self.func(
     48        "fromUnixTimestamp",
     49        exp.cast(
     50            exp.Div(this=timestamp, expression=exp.func("POW", 10, scale)), exp.DataType.Type.BIGINT
     51        ),
     52    )
     53
     54
     55def _lower_func(sql: str) -> str:
     56    index = sql.index("(")
     57    return sql[:index].lower() + sql[index:]
     58
     59
     60def _quantile_sql(self: ClickHouse.Generator, expression: exp.Quantile) -> str:
     61    quantile = expression.args["quantile"]
     62    args = f"({self.sql(expression, 'this')})"
     63
     64    if isinstance(quantile, exp.Array):
     65        func = self.func("quantiles", *quantile)
     66    else:
     67        func = self.func("quantile", quantile)
     68
     69    return func + args
     70
     71
     72def _build_count_if(args: t.List) -> exp.CountIf | exp.CombinedAggFunc:
     73    if len(args) == 1:
     74        return exp.CountIf(this=seq_get(args, 0))
     75
     76    return exp.CombinedAggFunc(this="countIf", expressions=args, parts=("count", "If"))
     77
     78
     79class ClickHouse(Dialect):
     80    NORMALIZE_FUNCTIONS: bool | str = False
     81    NULL_ORDERING = "nulls_are_last"
     82    SUPPORTS_USER_DEFINED_TYPES = False
     83    SAFE_DIVISION = True
     84    LOG_BASE_FIRST: t.Optional[bool] = None
     85
     86    UNESCAPED_SEQUENCES = {
     87        "\\0": "\0",
     88    }
     89
     90    class Tokenizer(tokens.Tokenizer):
     91        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     92        IDENTIFIERS = ['"', "`"]
     93        STRING_ESCAPES = ["'", "\\"]
     94        BIT_STRINGS = [("0b", "")]
     95        HEX_STRINGS = [("0x", ""), ("0X", "")]
     96        HEREDOC_STRINGS = ["$"]
     97
     98        KEYWORDS = {
     99            **tokens.Tokenizer.KEYWORDS,
    100            "ATTACH": TokenType.COMMAND,
    101            "DATE32": TokenType.DATE32,
    102            "DATETIME64": TokenType.DATETIME64,
    103            "DICTIONARY": TokenType.DICTIONARY,
    104            "ENUM8": TokenType.ENUM8,
    105            "ENUM16": TokenType.ENUM16,
    106            "FINAL": TokenType.FINAL,
    107            "FIXEDSTRING": TokenType.FIXEDSTRING,
    108            "FLOAT32": TokenType.FLOAT,
    109            "FLOAT64": TokenType.DOUBLE,
    110            "GLOBAL": TokenType.GLOBAL,
    111            "INT256": TokenType.INT256,
    112            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    113            "MAP": TokenType.MAP,
    114            "NESTED": TokenType.NESTED,
    115            "SAMPLE": TokenType.TABLE_SAMPLE,
    116            "TUPLE": TokenType.STRUCT,
    117            "UINT128": TokenType.UINT128,
    118            "UINT16": TokenType.USMALLINT,
    119            "UINT256": TokenType.UINT256,
    120            "UINT32": TokenType.UINT,
    121            "UINT64": TokenType.UBIGINT,
    122            "UINT8": TokenType.UTINYINT,
    123            "IPV4": TokenType.IPV4,
    124            "IPV6": TokenType.IPV6,
    125            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
    126            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
    127            "SYSTEM": TokenType.COMMAND,
    128            "PREWHERE": TokenType.PREWHERE,
    129        }
    130
    131        SINGLE_TOKENS = {
    132            **tokens.Tokenizer.SINGLE_TOKENS,
    133            "$": TokenType.HEREDOC_STRING,
    134        }
    135
    136    class Parser(parser.Parser):
    137        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    138        # * select x from t1 union all select x from t2 limit 1;
    139        # * select x from t1 union all (select x from t2 limit 1);
    140        MODIFIERS_ATTACHED_TO_UNION = False
    141        INTERVAL_SPANS = False
    142
    143        FUNCTIONS = {
    144            **parser.Parser.FUNCTIONS,
    145            "ANY": exp.AnyValue.from_arg_list,
    146            "ARRAYSUM": exp.ArraySum.from_arg_list,
    147            "COUNTIF": _build_count_if,
    148            "DATE_ADD": lambda args: exp.DateAdd(
    149                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    150            ),
    151            "DATEADD": lambda args: exp.DateAdd(
    152                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    153            ),
    154            "DATE_DIFF": lambda args: exp.DateDiff(
    155                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    156            ),
    157            "DATEDIFF": lambda args: exp.DateDiff(
    158                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    159            ),
    160            "DATE_FORMAT": _build_date_format,
    161            "FORMATDATETIME": _build_date_format,
    162            "JSONEXTRACTSTRING": build_json_extract_path(
    163                exp.JSONExtractScalar, zero_based_indexing=False
    164            ),
    165            "MAP": parser.build_var_map,
    166            "MATCH": exp.RegexpLike.from_arg_list,
    167            "RANDCANONICAL": exp.Rand.from_arg_list,
    168            "TUPLE": exp.Struct.from_arg_list,
    169            "UNIQ": exp.ApproxDistinct.from_arg_list,
    170            "XOR": lambda args: exp.Xor(expressions=args),
    171            "MD5": exp.MD5Digest.from_arg_list,
    172            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
    173            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
    174        }
    175
    176        AGG_FUNCTIONS = {
    177            "count",
    178            "min",
    179            "max",
    180            "sum",
    181            "avg",
    182            "any",
    183            "stddevPop",
    184            "stddevSamp",
    185            "varPop",
    186            "varSamp",
    187            "corr",
    188            "covarPop",
    189            "covarSamp",
    190            "entropy",
    191            "exponentialMovingAverage",
    192            "intervalLengthSum",
    193            "kolmogorovSmirnovTest",
    194            "mannWhitneyUTest",
    195            "median",
    196            "rankCorr",
    197            "sumKahan",
    198            "studentTTest",
    199            "welchTTest",
    200            "anyHeavy",
    201            "anyLast",
    202            "boundingRatio",
    203            "first_value",
    204            "last_value",
    205            "argMin",
    206            "argMax",
    207            "avgWeighted",
    208            "topK",
    209            "topKWeighted",
    210            "deltaSum",
    211            "deltaSumTimestamp",
    212            "groupArray",
    213            "groupArrayLast",
    214            "groupUniqArray",
    215            "groupArrayInsertAt",
    216            "groupArrayMovingAvg",
    217            "groupArrayMovingSum",
    218            "groupArraySample",
    219            "groupBitAnd",
    220            "groupBitOr",
    221            "groupBitXor",
    222            "groupBitmap",
    223            "groupBitmapAnd",
    224            "groupBitmapOr",
    225            "groupBitmapXor",
    226            "sumWithOverflow",
    227            "sumMap",
    228            "minMap",
    229            "maxMap",
    230            "skewSamp",
    231            "skewPop",
    232            "kurtSamp",
    233            "kurtPop",
    234            "uniq",
    235            "uniqExact",
    236            "uniqCombined",
    237            "uniqCombined64",
    238            "uniqHLL12",
    239            "uniqTheta",
    240            "quantile",
    241            "quantiles",
    242            "quantileExact",
    243            "quantilesExact",
    244            "quantileExactLow",
    245            "quantilesExactLow",
    246            "quantileExactHigh",
    247            "quantilesExactHigh",
    248            "quantileExactWeighted",
    249            "quantilesExactWeighted",
    250            "quantileTiming",
    251            "quantilesTiming",
    252            "quantileTimingWeighted",
    253            "quantilesTimingWeighted",
    254            "quantileDeterministic",
    255            "quantilesDeterministic",
    256            "quantileTDigest",
    257            "quantilesTDigest",
    258            "quantileTDigestWeighted",
    259            "quantilesTDigestWeighted",
    260            "quantileBFloat16",
    261            "quantilesBFloat16",
    262            "quantileBFloat16Weighted",
    263            "quantilesBFloat16Weighted",
    264            "simpleLinearRegression",
    265            "stochasticLinearRegression",
    266            "stochasticLogisticRegression",
    267            "categoricalInformationValue",
    268            "contingency",
    269            "cramersV",
    270            "cramersVBiasCorrected",
    271            "theilsU",
    272            "maxIntersections",
    273            "maxIntersectionsPosition",
    274            "meanZTest",
    275            "quantileInterpolatedWeighted",
    276            "quantilesInterpolatedWeighted",
    277            "quantileGK",
    278            "quantilesGK",
    279            "sparkBar",
    280            "sumCount",
    281            "largestTriangleThreeBuckets",
    282            "histogram",
    283            "sequenceMatch",
    284            "sequenceCount",
    285            "windowFunnel",
    286            "retention",
    287            "uniqUpTo",
    288            "sequenceNextNode",
    289            "exponentialTimeDecayedAvg",
    290        }
    291
    292        AGG_FUNCTIONS_SUFFIXES = [
    293            "If",
    294            "Array",
    295            "ArrayIf",
    296            "Map",
    297            "SimpleState",
    298            "State",
    299            "Merge",
    300            "MergeState",
    301            "ForEach",
    302            "Distinct",
    303            "OrDefault",
    304            "OrNull",
    305            "Resample",
    306            "ArgMin",
    307            "ArgMax",
    308        ]
    309
    310        FUNC_TOKENS = {
    311            *parser.Parser.FUNC_TOKENS,
    312            TokenType.SET,
    313        }
    314
    315        AGG_FUNC_MAPPING = (
    316            lambda functions, suffixes: {
    317                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    318            }
    319        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    320
    321        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    322
    323        FUNCTION_PARSERS = {
    324            **parser.Parser.FUNCTION_PARSERS,
    325            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    326            "QUANTILE": lambda self: self._parse_quantile(),
    327        }
    328
    329        FUNCTION_PARSERS.pop("MATCH")
    330
    331        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    332        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    333
    334        RANGE_PARSERS = {
    335            **parser.Parser.RANGE_PARSERS,
    336            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    337            and self._parse_in(this, is_global=True),
    338        }
    339
    340        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    341        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    342        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    343        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    344
    345        JOIN_KINDS = {
    346            *parser.Parser.JOIN_KINDS,
    347            TokenType.ANY,
    348            TokenType.ASOF,
    349            TokenType.ARRAY,
    350        }
    351
    352        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    353            TokenType.ANY,
    354            TokenType.ARRAY,
    355            TokenType.FINAL,
    356            TokenType.FORMAT,
    357            TokenType.SETTINGS,
    358        }
    359
    360        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    361            TokenType.FORMAT,
    362        }
    363
    364        LOG_DEFAULTS_TO_LN = True
    365
    366        QUERY_MODIFIER_PARSERS = {
    367            **parser.Parser.QUERY_MODIFIER_PARSERS,
    368            TokenType.SETTINGS: lambda self: (
    369                "settings",
    370                self._advance() or self._parse_csv(self._parse_conjunction),
    371            ),
    372            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    373        }
    374
    375        CONSTRAINT_PARSERS = {
    376            **parser.Parser.CONSTRAINT_PARSERS,
    377            "INDEX": lambda self: self._parse_index_constraint(),
    378            "CODEC": lambda self: self._parse_compress(),
    379        }
    380
    381        ALTER_PARSERS = {
    382            **parser.Parser.ALTER_PARSERS,
    383            "REPLACE": lambda self: self._parse_alter_table_replace(),
    384        }
    385
    386        SCHEMA_UNNAMED_CONSTRAINTS = {
    387            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    388            "INDEX",
    389        }
    390
    391        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    392            this = super()._parse_conjunction()
    393
    394            if self._match(TokenType.PLACEHOLDER):
    395                return self.expression(
    396                    exp.If,
    397                    this=this,
    398                    true=self._parse_conjunction(),
    399                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    400                )
    401
    402            return this
    403
    404        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    405            """
    406            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    407            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    408            """
    409            if not self._match(TokenType.L_BRACE):
    410                return None
    411
    412            this = self._parse_id_var()
    413            self._match(TokenType.COLON)
    414            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    415                self._match_text_seq("IDENTIFIER") and "Identifier"
    416            )
    417
    418            if not kind:
    419                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    420            elif not self._match(TokenType.R_BRACE):
    421                self.raise_error("Expecting }")
    422
    423            return self.expression(exp.Placeholder, this=this, kind=kind)
    424
    425        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    426            this = super()._parse_in(this)
    427            this.set("is_global", is_global)
    428            return this
    429
    430        def _parse_table(
    431            self,
    432            schema: bool = False,
    433            joins: bool = False,
    434            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    435            parse_bracket: bool = False,
    436            is_db_reference: bool = False,
    437            parse_partition: bool = False,
    438        ) -> t.Optional[exp.Expression]:
    439            this = super()._parse_table(
    440                schema=schema,
    441                joins=joins,
    442                alias_tokens=alias_tokens,
    443                parse_bracket=parse_bracket,
    444                is_db_reference=is_db_reference,
    445            )
    446
    447            if self._match(TokenType.FINAL):
    448                this = self.expression(exp.Final, this=this)
    449
    450            return this
    451
    452        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    453            return super()._parse_position(haystack_first=True)
    454
    455        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    456        def _parse_cte(self) -> exp.CTE:
    457            # WITH <identifier> AS <subquery expression>
    458            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    459
    460            if not cte:
    461                # WITH <expression> AS <identifier>
    462                cte = self.expression(
    463                    exp.CTE,
    464                    this=self._parse_conjunction(),
    465                    alias=self._parse_table_alias(),
    466                    scalar=True,
    467                )
    468
    469            return cte
    470
    471        def _parse_join_parts(
    472            self,
    473        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    474            is_global = self._match(TokenType.GLOBAL) and self._prev
    475            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    476
    477            if kind_pre:
    478                kind = self._match_set(self.JOIN_KINDS) and self._prev
    479                side = self._match_set(self.JOIN_SIDES) and self._prev
    480                return is_global, side, kind
    481
    482            return (
    483                is_global,
    484                self._match_set(self.JOIN_SIDES) and self._prev,
    485                self._match_set(self.JOIN_KINDS) and self._prev,
    486            )
    487
    488        def _parse_join(
    489            self, skip_join_token: bool = False, parse_bracket: bool = False
    490        ) -> t.Optional[exp.Join]:
    491            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    492            if join:
    493                join.set("global", join.args.pop("method", None))
    494
    495            return join
    496
    497        def _parse_function(
    498            self,
    499            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    500            anonymous: bool = False,
    501            optional_parens: bool = True,
    502            any_token: bool = False,
    503        ) -> t.Optional[exp.Expression]:
    504            expr = super()._parse_function(
    505                functions=functions,
    506                anonymous=anonymous,
    507                optional_parens=optional_parens,
    508                any_token=any_token,
    509            )
    510
    511            func = expr.this if isinstance(expr, exp.Window) else expr
    512
    513            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    514            parts = (
    515                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    516            )
    517
    518            if parts:
    519                params = self._parse_func_params(func)
    520
    521                kwargs = {
    522                    "this": func.this,
    523                    "expressions": func.expressions,
    524                }
    525                if parts[1]:
    526                    kwargs["parts"] = parts
    527                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    528                else:
    529                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    530
    531                kwargs["exp_class"] = exp_class
    532                if params:
    533                    kwargs["params"] = params
    534
    535                func = self.expression(**kwargs)
    536
    537                if isinstance(expr, exp.Window):
    538                    # The window's func was parsed as Anonymous in base parser, fix its
    539                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    540                    expr.set("this", func)
    541                elif params:
    542                    # Params have blocked super()._parse_function() from parsing the following window
    543                    # (if that exists) as they're standing between the function call and the window spec
    544                    expr = self._parse_window(func)
    545                else:
    546                    expr = func
    547
    548            return expr
    549
    550        def _parse_func_params(
    551            self, this: t.Optional[exp.Func] = None
    552        ) -> t.Optional[t.List[exp.Expression]]:
    553            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    554                return self._parse_csv(self._parse_lambda)
    555
    556            if self._match(TokenType.L_PAREN):
    557                params = self._parse_csv(self._parse_lambda)
    558                self._match_r_paren(this)
    559                return params
    560
    561            return None
    562
    563        def _parse_quantile(self) -> exp.Quantile:
    564            this = self._parse_lambda()
    565            params = self._parse_func_params()
    566            if params:
    567                return self.expression(exp.Quantile, this=params[0], quantile=this)
    568            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    569
    570        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    571            return super()._parse_wrapped_id_vars(optional=True)
    572
    573        def _parse_primary_key(
    574            self, wrapped_optional: bool = False, in_props: bool = False
    575        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    576            return super()._parse_primary_key(
    577                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    578            )
    579
    580        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    581            index = self._index
    582            if self._match_text_seq("CLUSTER"):
    583                this = self._parse_id_var()
    584                if this:
    585                    return self.expression(exp.OnCluster, this=this)
    586                else:
    587                    self._retreat(index)
    588            return None
    589
    590        def _parse_index_constraint(
    591            self, kind: t.Optional[str] = None
    592        ) -> exp.IndexColumnConstraint:
    593            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    594            this = self._parse_id_var()
    595            expression = self._parse_conjunction()
    596
    597            index_type = self._match_text_seq("TYPE") and (
    598                self._parse_function() or self._parse_var()
    599            )
    600
    601            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    602
    603            return self.expression(
    604                exp.IndexColumnConstraint,
    605                this=this,
    606                expression=expression,
    607                index_type=index_type,
    608                granularity=granularity,
    609            )
    610
    611        def _parse_partition(self) -> t.Optional[exp.Partition]:
    612            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    613            if not self._match(TokenType.PARTITION):
    614                return None
    615
    616            if self._match_text_seq("ID"):
    617                # Corresponds to the PARTITION ID <string_value> syntax
    618                expressions: t.List[exp.Expression] = [
    619                    self.expression(exp.PartitionId, this=self._parse_string())
    620                ]
    621            else:
    622                expressions = self._parse_expressions()
    623
    624            return self.expression(exp.Partition, expressions=expressions)
    625
    626        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    627            partition = self._parse_partition()
    628
    629            if not partition or not self._match(TokenType.FROM):
    630                return None
    631
    632            return self.expression(
    633                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    634            )
    635
    636        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    637            if not self._match_text_seq("PROJECTION"):
    638                return None
    639
    640            return self.expression(
    641                exp.ProjectionDef,
    642                this=self._parse_id_var(),
    643                expression=self._parse_wrapped(self._parse_statement),
    644            )
    645
    646        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    647            return super()._parse_constraint() or self._parse_projection_def()
    648
    649    class Generator(generator.Generator):
    650        QUERY_HINTS = False
    651        STRUCT_DELIMITER = ("(", ")")
    652        NVL2_SUPPORTED = False
    653        TABLESAMPLE_REQUIRES_PARENS = False
    654        TABLESAMPLE_SIZE_IS_ROWS = False
    655        TABLESAMPLE_KEYWORDS = "SAMPLE"
    656        LAST_DAY_SUPPORTS_DATE_PART = False
    657        CAN_IMPLEMENT_ARRAY_ANY = True
    658        SUPPORTS_TO_NUMBER = False
    659
    660        STRING_TYPE_MAPPING = {
    661            exp.DataType.Type.CHAR: "String",
    662            exp.DataType.Type.LONGBLOB: "String",
    663            exp.DataType.Type.LONGTEXT: "String",
    664            exp.DataType.Type.MEDIUMBLOB: "String",
    665            exp.DataType.Type.MEDIUMTEXT: "String",
    666            exp.DataType.Type.TINYBLOB: "String",
    667            exp.DataType.Type.TINYTEXT: "String",
    668            exp.DataType.Type.TEXT: "String",
    669            exp.DataType.Type.VARBINARY: "String",
    670            exp.DataType.Type.VARCHAR: "String",
    671        }
    672
    673        SUPPORTED_JSON_PATH_PARTS = {
    674            exp.JSONPathKey,
    675            exp.JSONPathRoot,
    676            exp.JSONPathSubscript,
    677        }
    678
    679        TYPE_MAPPING = {
    680            **generator.Generator.TYPE_MAPPING,
    681            **STRING_TYPE_MAPPING,
    682            exp.DataType.Type.ARRAY: "Array",
    683            exp.DataType.Type.BIGINT: "Int64",
    684            exp.DataType.Type.DATE32: "Date32",
    685            exp.DataType.Type.DATETIME64: "DateTime64",
    686            exp.DataType.Type.DOUBLE: "Float64",
    687            exp.DataType.Type.ENUM: "Enum",
    688            exp.DataType.Type.ENUM8: "Enum8",
    689            exp.DataType.Type.ENUM16: "Enum16",
    690            exp.DataType.Type.FIXEDSTRING: "FixedString",
    691            exp.DataType.Type.FLOAT: "Float32",
    692            exp.DataType.Type.INT: "Int32",
    693            exp.DataType.Type.MEDIUMINT: "Int32",
    694            exp.DataType.Type.INT128: "Int128",
    695            exp.DataType.Type.INT256: "Int256",
    696            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    697            exp.DataType.Type.MAP: "Map",
    698            exp.DataType.Type.NESTED: "Nested",
    699            exp.DataType.Type.NULLABLE: "Nullable",
    700            exp.DataType.Type.SMALLINT: "Int16",
    701            exp.DataType.Type.STRUCT: "Tuple",
    702            exp.DataType.Type.TINYINT: "Int8",
    703            exp.DataType.Type.UBIGINT: "UInt64",
    704            exp.DataType.Type.UINT: "UInt32",
    705            exp.DataType.Type.UINT128: "UInt128",
    706            exp.DataType.Type.UINT256: "UInt256",
    707            exp.DataType.Type.USMALLINT: "UInt16",
    708            exp.DataType.Type.UTINYINT: "UInt8",
    709            exp.DataType.Type.IPV4: "IPv4",
    710            exp.DataType.Type.IPV6: "IPv6",
    711            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    712            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    713        }
    714
    715        TRANSFORMS = {
    716            **generator.Generator.TRANSFORMS,
    717            exp.AnyValue: rename_func("any"),
    718            exp.ApproxDistinct: rename_func("uniq"),
    719            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    720            exp.ArraySize: rename_func("LENGTH"),
    721            exp.ArraySum: rename_func("arraySum"),
    722            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    723            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    724            exp.Array: inline_array_sql,
    725            exp.CastToStrType: rename_func("CAST"),
    726            exp.CountIf: rename_func("countIf"),
    727            exp.CompressColumnConstraint: lambda self,
    728            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    729            exp.ComputedColumnConstraint: lambda self,
    730            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    731            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    732            exp.DateAdd: date_delta_sql("DATE_ADD"),
    733            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    734            exp.Explode: rename_func("arrayJoin"),
    735            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    736            exp.IsNan: rename_func("isNaN"),
    737            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    738            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    739            exp.JSONPathKey: json_path_key_only_name,
    740            exp.JSONPathRoot: lambda *_: "",
    741            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    742            exp.Nullif: rename_func("nullIf"),
    743            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    744            exp.Pivot: no_pivot_sql,
    745            exp.Quantile: _quantile_sql,
    746            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    747            exp.Rand: rename_func("randCanonical"),
    748            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    749            exp.StartsWith: rename_func("startsWith"),
    750            exp.StrPosition: lambda self, e: self.func(
    751                "position", e.this, e.args.get("substr"), e.args.get("position")
    752            ),
    753            exp.TimeToStr: lambda self, e: self.func(
    754                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    755            ),
    756            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    757            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    758            exp.MD5Digest: rename_func("MD5"),
    759            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
    760            exp.SHA: rename_func("SHA1"),
    761            exp.SHA2: lambda self, e: self.func(
    762                "SHA256" if e.text("length") == "256" else "SHA512", e.this
    763            ),
    764            exp.UnixToTime: _unix_to_time_sql,
    765            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
    766            exp.Variance: rename_func("varSamp"),
    767            exp.Stddev: rename_func("stddevSamp"),
    768        }
    769
    770        PROPERTIES_LOCATION = {
    771            **generator.Generator.PROPERTIES_LOCATION,
    772            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    773            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    774            exp.OnCluster: exp.Properties.Location.POST_NAME,
    775        }
    776
    777        JOIN_HINTS = False
    778        TABLE_HINTS = False
    779        EXPLICIT_UNION = True
    780        GROUPINGS_SEP = ""
    781        OUTER_UNION_MODIFIERS = False
    782
    783        # there's no list in docs, but it can be found in Clickhouse code
    784        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    785        ON_CLUSTER_TARGETS = {
    786            "DATABASE",
    787            "TABLE",
    788            "VIEW",
    789            "DICTIONARY",
    790            "INDEX",
    791            "FUNCTION",
    792            "NAMED COLLECTION",
    793        }
    794
    795        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    796            this = self.json_path_part(expression.this)
    797            return str(int(this) + 1) if is_int(this) else this
    798
    799        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    800            return f"AS {self.sql(expression, 'this')}"
    801
    802        def _any_to_has(
    803            self,
    804            expression: exp.EQ | exp.NEQ,
    805            default: t.Callable[[t.Any], str],
    806            prefix: str = "",
    807        ) -> str:
    808            if isinstance(expression.left, exp.Any):
    809                arr = expression.left
    810                this = expression.right
    811            elif isinstance(expression.right, exp.Any):
    812                arr = expression.right
    813                this = expression.left
    814            else:
    815                return default(expression)
    816
    817            return prefix + self.func("has", arr.this.unnest(), this)
    818
    819        def eq_sql(self, expression: exp.EQ) -> str:
    820            return self._any_to_has(expression, super().eq_sql)
    821
    822        def neq_sql(self, expression: exp.NEQ) -> str:
    823            return self._any_to_has(expression, super().neq_sql, "NOT ")
    824
    825        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    826            # Manually add a flag to make the search case-insensitive
    827            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    828            return self.func("match", expression.this, regex)
    829
    830        def datatype_sql(self, expression: exp.DataType) -> str:
    831            # String is the standard ClickHouse type, every other variant is just an alias.
    832            # Additionally, any supplied length parameter will be ignored.
    833            #
    834            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    835            if expression.this in self.STRING_TYPE_MAPPING:
    836                return "String"
    837
    838            return super().datatype_sql(expression)
    839
    840        def cte_sql(self, expression: exp.CTE) -> str:
    841            if expression.args.get("scalar"):
    842                this = self.sql(expression, "this")
    843                alias = self.sql(expression, "alias")
    844                return f"{this} AS {alias}"
    845
    846            return super().cte_sql(expression)
    847
    848        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    849            return super().after_limit_modifiers(expression) + [
    850                (
    851                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    852                    if expression.args.get("settings")
    853                    else ""
    854                ),
    855                (
    856                    self.seg("FORMAT ") + self.sql(expression, "format")
    857                    if expression.args.get("format")
    858                    else ""
    859                ),
    860            ]
    861
    862        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    863            params = self.expressions(expression, key="params", flat=True)
    864            return self.func(expression.name, *expression.expressions) + f"({params})"
    865
    866        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    867            return self.func(expression.name, *expression.expressions)
    868
    869        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    870            return self.anonymousaggfunc_sql(expression)
    871
    872        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    873            return self.parameterizedagg_sql(expression)
    874
    875        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    876            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    877
    878        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    879            return f"ON CLUSTER {self.sql(expression, 'this')}"
    880
    881        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    882            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    883                exp.Properties.Location.POST_NAME
    884            ):
    885                this_name = self.sql(expression.this, "this")
    886                this_properties = " ".join(
    887                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    888                )
    889                this_schema = self.schema_columns_sql(expression.this)
    890                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    891
    892            return super().createable_sql(expression, locations)
    893
    894        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    895            this = self.indent(self.sql(expression, "this"))
    896            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    897
    898        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    899            this = self.sql(expression, "this")
    900            this = f" {this}" if this else ""
    901            expr = self.sql(expression, "expression")
    902            expr = f" {expr}" if expr else ""
    903            index_type = self.sql(expression, "index_type")
    904            index_type = f" TYPE {index_type}" if index_type else ""
    905            granularity = self.sql(expression, "granularity")
    906            granularity = f" GRANULARITY {granularity}" if granularity else ""
    907
    908            return f"INDEX{this}{expr}{index_type}{granularity}"
    909
    910        def partition_sql(self, expression: exp.Partition) -> str:
    911            return f"PARTITION {self.expressions(expression, flat=True)}"
    912
    913        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    914            return f"ID {self.sql(expression.this)}"
    915
    916        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    917            return (
    918                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    919            )
    920
    921        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    922            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"

class ClickHouse(sqlglot.dialects.dialect.Dialect): View Source

     80class ClickHouse(Dialect):
     81    NORMALIZE_FUNCTIONS: bool | str = False
     82    NULL_ORDERING = "nulls_are_last"
     83    SUPPORTS_USER_DEFINED_TYPES = False
     84    SAFE_DIVISION = True
     85    LOG_BASE_FIRST: t.Optional[bool] = None
     86
     87    UNESCAPED_SEQUENCES = {
     88        "\\0": "\0",
     89    }
     90
     91    class Tokenizer(tokens.Tokenizer):
     92        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     93        IDENTIFIERS = ['"', "`"]
     94        STRING_ESCAPES = ["'", "\\"]
     95        BIT_STRINGS = [("0b", "")]
     96        HEX_STRINGS = [("0x", ""), ("0X", "")]
     97        HEREDOC_STRINGS = ["$"]
     98
     99        KEYWORDS = {
    100            **tokens.Tokenizer.KEYWORDS,
    101            "ATTACH": TokenType.COMMAND,
    102            "DATE32": TokenType.DATE32,
    103            "DATETIME64": TokenType.DATETIME64,
    104            "DICTIONARY": TokenType.DICTIONARY,
    105            "ENUM8": TokenType.ENUM8,
    106            "ENUM16": TokenType.ENUM16,
    107            "FINAL": TokenType.FINAL,
    108            "FIXEDSTRING": TokenType.FIXEDSTRING,
    109            "FLOAT32": TokenType.FLOAT,
    110            "FLOAT64": TokenType.DOUBLE,
    111            "GLOBAL": TokenType.GLOBAL,
    112            "INT256": TokenType.INT256,
    113            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    114            "MAP": TokenType.MAP,
    115            "NESTED": TokenType.NESTED,
    116            "SAMPLE": TokenType.TABLE_SAMPLE,
    117            "TUPLE": TokenType.STRUCT,
    118            "UINT128": TokenType.UINT128,
    119            "UINT16": TokenType.USMALLINT,
    120            "UINT256": TokenType.UINT256,
    121            "UINT32": TokenType.UINT,
    122            "UINT64": TokenType.UBIGINT,
    123            "UINT8": TokenType.UTINYINT,
    124            "IPV4": TokenType.IPV4,
    125            "IPV6": TokenType.IPV6,
    126            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
    127            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
    128            "SYSTEM": TokenType.COMMAND,
    129            "PREWHERE": TokenType.PREWHERE,
    130        }
    131
    132        SINGLE_TOKENS = {
    133            **tokens.Tokenizer.SINGLE_TOKENS,
    134            "$": TokenType.HEREDOC_STRING,
    135        }
    136
    137    class Parser(parser.Parser):
    138        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    139        # * select x from t1 union all select x from t2 limit 1;
    140        # * select x from t1 union all (select x from t2 limit 1);
    141        MODIFIERS_ATTACHED_TO_UNION = False
    142        INTERVAL_SPANS = False
    143
    144        FUNCTIONS = {
    145            **parser.Parser.FUNCTIONS,
    146            "ANY": exp.AnyValue.from_arg_list,
    147            "ARRAYSUM": exp.ArraySum.from_arg_list,
    148            "COUNTIF": _build_count_if,
    149            "DATE_ADD": lambda args: exp.DateAdd(
    150                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    151            ),
    152            "DATEADD": lambda args: exp.DateAdd(
    153                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    154            ),
    155            "DATE_DIFF": lambda args: exp.DateDiff(
    156                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    157            ),
    158            "DATEDIFF": lambda args: exp.DateDiff(
    159                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    160            ),
    161            "DATE_FORMAT": _build_date_format,
    162            "FORMATDATETIME": _build_date_format,
    163            "JSONEXTRACTSTRING": build_json_extract_path(
    164                exp.JSONExtractScalar, zero_based_indexing=False
    165            ),
    166            "MAP": parser.build_var_map,
    167            "MATCH": exp.RegexpLike.from_arg_list,
    168            "RANDCANONICAL": exp.Rand.from_arg_list,
    169            "TUPLE": exp.Struct.from_arg_list,
    170            "UNIQ": exp.ApproxDistinct.from_arg_list,
    171            "XOR": lambda args: exp.Xor(expressions=args),
    172            "MD5": exp.MD5Digest.from_arg_list,
    173            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
    174            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
    175        }
    176
    177        AGG_FUNCTIONS = {
    178            "count",
    179            "min",
    180            "max",
    181            "sum",
    182            "avg",
    183            "any",
    184            "stddevPop",
    185            "stddevSamp",
    186            "varPop",
    187            "varSamp",
    188            "corr",
    189            "covarPop",
    190            "covarSamp",
    191            "entropy",
    192            "exponentialMovingAverage",
    193            "intervalLengthSum",
    194            "kolmogorovSmirnovTest",
    195            "mannWhitneyUTest",
    196            "median",
    197            "rankCorr",
    198            "sumKahan",
    199            "studentTTest",
    200            "welchTTest",
    201            "anyHeavy",
    202            "anyLast",
    203            "boundingRatio",
    204            "first_value",
    205            "last_value",
    206            "argMin",
    207            "argMax",
    208            "avgWeighted",
    209            "topK",
    210            "topKWeighted",
    211            "deltaSum",
    212            "deltaSumTimestamp",
    213            "groupArray",
    214            "groupArrayLast",
    215            "groupUniqArray",
    216            "groupArrayInsertAt",
    217            "groupArrayMovingAvg",
    218            "groupArrayMovingSum",
    219            "groupArraySample",
    220            "groupBitAnd",
    221            "groupBitOr",
    222            "groupBitXor",
    223            "groupBitmap",
    224            "groupBitmapAnd",
    225            "groupBitmapOr",
    226            "groupBitmapXor",
    227            "sumWithOverflow",
    228            "sumMap",
    229            "minMap",
    230            "maxMap",
    231            "skewSamp",
    232            "skewPop",
    233            "kurtSamp",
    234            "kurtPop",
    235            "uniq",
    236            "uniqExact",
    237            "uniqCombined",
    238            "uniqCombined64",
    239            "uniqHLL12",
    240            "uniqTheta",
    241            "quantile",
    242            "quantiles",
    243            "quantileExact",
    244            "quantilesExact",
    245            "quantileExactLow",
    246            "quantilesExactLow",
    247            "quantileExactHigh",
    248            "quantilesExactHigh",
    249            "quantileExactWeighted",
    250            "quantilesExactWeighted",
    251            "quantileTiming",
    252            "quantilesTiming",
    253            "quantileTimingWeighted",
    254            "quantilesTimingWeighted",
    255            "quantileDeterministic",
    256            "quantilesDeterministic",
    257            "quantileTDigest",
    258            "quantilesTDigest",
    259            "quantileTDigestWeighted",
    260            "quantilesTDigestWeighted",
    261            "quantileBFloat16",
    262            "quantilesBFloat16",
    263            "quantileBFloat16Weighted",
    264            "quantilesBFloat16Weighted",
    265            "simpleLinearRegression",
    266            "stochasticLinearRegression",
    267            "stochasticLogisticRegression",
    268            "categoricalInformationValue",
    269            "contingency",
    270            "cramersV",
    271            "cramersVBiasCorrected",
    272            "theilsU",
    273            "maxIntersections",
    274            "maxIntersectionsPosition",
    275            "meanZTest",
    276            "quantileInterpolatedWeighted",
    277            "quantilesInterpolatedWeighted",
    278            "quantileGK",
    279            "quantilesGK",
    280            "sparkBar",
    281            "sumCount",
    282            "largestTriangleThreeBuckets",
    283            "histogram",
    284            "sequenceMatch",
    285            "sequenceCount",
    286            "windowFunnel",
    287            "retention",
    288            "uniqUpTo",
    289            "sequenceNextNode",
    290            "exponentialTimeDecayedAvg",
    291        }
    292
    293        AGG_FUNCTIONS_SUFFIXES = [
    294            "If",
    295            "Array",
    296            "ArrayIf",
    297            "Map",
    298            "SimpleState",
    299            "State",
    300            "Merge",
    301            "MergeState",
    302            "ForEach",
    303            "Distinct",
    304            "OrDefault",
    305            "OrNull",
    306            "Resample",
    307            "ArgMin",
    308            "ArgMax",
    309        ]
    310
    311        FUNC_TOKENS = {
    312            *parser.Parser.FUNC_TOKENS,
    313            TokenType.SET,
    314        }
    315
    316        AGG_FUNC_MAPPING = (
    317            lambda functions, suffixes: {
    318                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    319            }
    320        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    321
    322        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    323
    324        FUNCTION_PARSERS = {
    325            **parser.Parser.FUNCTION_PARSERS,
    326            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    327            "QUANTILE": lambda self: self._parse_quantile(),
    328        }
    329
    330        FUNCTION_PARSERS.pop("MATCH")
    331
    332        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    333        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    334
    335        RANGE_PARSERS = {
    336            **parser.Parser.RANGE_PARSERS,
    337            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    338            and self._parse_in(this, is_global=True),
    339        }
    340
    341        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    342        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    343        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    344        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    345
    346        JOIN_KINDS = {
    347            *parser.Parser.JOIN_KINDS,
    348            TokenType.ANY,
    349            TokenType.ASOF,
    350            TokenType.ARRAY,
    351        }
    352
    353        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    354            TokenType.ANY,
    355            TokenType.ARRAY,
    356            TokenType.FINAL,
    357            TokenType.FORMAT,
    358            TokenType.SETTINGS,
    359        }
    360
    361        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    362            TokenType.FORMAT,
    363        }
    364
    365        LOG_DEFAULTS_TO_LN = True
    366
    367        QUERY_MODIFIER_PARSERS = {
    368            **parser.Parser.QUERY_MODIFIER_PARSERS,
    369            TokenType.SETTINGS: lambda self: (
    370                "settings",
    371                self._advance() or self._parse_csv(self._parse_conjunction),
    372            ),
    373            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    374        }
    375
    376        CONSTRAINT_PARSERS = {
    377            **parser.Parser.CONSTRAINT_PARSERS,
    378            "INDEX": lambda self: self._parse_index_constraint(),
    379            "CODEC": lambda self: self._parse_compress(),
    380        }
    381
    382        ALTER_PARSERS = {
    383            **parser.Parser.ALTER_PARSERS,
    384            "REPLACE": lambda self: self._parse_alter_table_replace(),
    385        }
    386
    387        SCHEMA_UNNAMED_CONSTRAINTS = {
    388            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    389            "INDEX",
    390        }
    391
    392        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    393            this = super()._parse_conjunction()
    394
    395            if self._match(TokenType.PLACEHOLDER):
    396                return self.expression(
    397                    exp.If,
    398                    this=this,
    399                    true=self._parse_conjunction(),
    400                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    401                )
    402
    403            return this
    404
    405        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    406            """
    407            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    408            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    409            """
    410            if not self._match(TokenType.L_BRACE):
    411                return None
    412
    413            this = self._parse_id_var()
    414            self._match(TokenType.COLON)
    415            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    416                self._match_text_seq("IDENTIFIER") and "Identifier"
    417            )
    418
    419            if not kind:
    420                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    421            elif not self._match(TokenType.R_BRACE):
    422                self.raise_error("Expecting }")
    423
    424            return self.expression(exp.Placeholder, this=this, kind=kind)
    425
    426        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    427            this = super()._parse_in(this)
    428            this.set("is_global", is_global)
    429            return this
    430
    431        def _parse_table(
    432            self,
    433            schema: bool = False,
    434            joins: bool = False,
    435            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    436            parse_bracket: bool = False,
    437            is_db_reference: bool = False,
    438            parse_partition: bool = False,
    439        ) -> t.Optional[exp.Expression]:
    440            this = super()._parse_table(
    441                schema=schema,
    442                joins=joins,
    443                alias_tokens=alias_tokens,
    444                parse_bracket=parse_bracket,
    445                is_db_reference=is_db_reference,
    446            )
    447
    448            if self._match(TokenType.FINAL):
    449                this = self.expression(exp.Final, this=this)
    450
    451            return this
    452
    453        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    454            return super()._parse_position(haystack_first=True)
    455
    456        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    457        def _parse_cte(self) -> exp.CTE:
    458            # WITH <identifier> AS <subquery expression>
    459            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    460
    461            if not cte:
    462                # WITH <expression> AS <identifier>
    463                cte = self.expression(
    464                    exp.CTE,
    465                    this=self._parse_conjunction(),
    466                    alias=self._parse_table_alias(),
    467                    scalar=True,
    468                )
    469
    470            return cte
    471
    472        def _parse_join_parts(
    473            self,
    474        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    475            is_global = self._match(TokenType.GLOBAL) and self._prev
    476            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    477
    478            if kind_pre:
    479                kind = self._match_set(self.JOIN_KINDS) and self._prev
    480                side = self._match_set(self.JOIN_SIDES) and self._prev
    481                return is_global, side, kind
    482
    483            return (
    484                is_global,
    485                self._match_set(self.JOIN_SIDES) and self._prev,
    486                self._match_set(self.JOIN_KINDS) and self._prev,
    487            )
    488
    489        def _parse_join(
    490            self, skip_join_token: bool = False, parse_bracket: bool = False
    491        ) -> t.Optional[exp.Join]:
    492            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    493            if join:
    494                join.set("global", join.args.pop("method", None))
    495
    496            return join
    497
    498        def _parse_function(
    499            self,
    500            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    501            anonymous: bool = False,
    502            optional_parens: bool = True,
    503            any_token: bool = False,
    504        ) -> t.Optional[exp.Expression]:
    505            expr = super()._parse_function(
    506                functions=functions,
    507                anonymous=anonymous,
    508                optional_parens=optional_parens,
    509                any_token=any_token,
    510            )
    511
    512            func = expr.this if isinstance(expr, exp.Window) else expr
    513
    514            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    515            parts = (
    516                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    517            )
    518
    519            if parts:
    520                params = self._parse_func_params(func)
    521
    522                kwargs = {
    523                    "this": func.this,
    524                    "expressions": func.expressions,
    525                }
    526                if parts[1]:
    527                    kwargs["parts"] = parts
    528                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    529                else:
    530                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    531
    532                kwargs["exp_class"] = exp_class
    533                if params:
    534                    kwargs["params"] = params
    535
    536                func = self.expression(**kwargs)
    537
    538                if isinstance(expr, exp.Window):
    539                    # The window's func was parsed as Anonymous in base parser, fix its
    540                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    541                    expr.set("this", func)
    542                elif params:
    543                    # Params have blocked super()._parse_function() from parsing the following window
    544                    # (if that exists) as they're standing between the function call and the window spec
    545                    expr = self._parse_window(func)
    546                else:
    547                    expr = func
    548
    549            return expr
    550
    551        def _parse_func_params(
    552            self, this: t.Optional[exp.Func] = None
    553        ) -> t.Optional[t.List[exp.Expression]]:
    554            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    555                return self._parse_csv(self._parse_lambda)
    556
    557            if self._match(TokenType.L_PAREN):
    558                params = self._parse_csv(self._parse_lambda)
    559                self._match_r_paren(this)
    560                return params
    561
    562            return None
    563
    564        def _parse_quantile(self) -> exp.Quantile:
    565            this = self._parse_lambda()
    566            params = self._parse_func_params()
    567            if params:
    568                return self.expression(exp.Quantile, this=params[0], quantile=this)
    569            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    570
    571        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    572            return super()._parse_wrapped_id_vars(optional=True)
    573
    574        def _parse_primary_key(
    575            self, wrapped_optional: bool = False, in_props: bool = False
    576        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    577            return super()._parse_primary_key(
    578                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    579            )
    580
    581        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    582            index = self._index
    583            if self._match_text_seq("CLUSTER"):
    584                this = self._parse_id_var()
    585                if this:
    586                    return self.expression(exp.OnCluster, this=this)
    587                else:
    588                    self._retreat(index)
    589            return None
    590
    591        def _parse_index_constraint(
    592            self, kind: t.Optional[str] = None
    593        ) -> exp.IndexColumnConstraint:
    594            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    595            this = self._parse_id_var()
    596            expression = self._parse_conjunction()
    597
    598            index_type = self._match_text_seq("TYPE") and (
    599                self._parse_function() or self._parse_var()
    600            )
    601
    602            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    603
    604            return self.expression(
    605                exp.IndexColumnConstraint,
    606                this=this,
    607                expression=expression,
    608                index_type=index_type,
    609                granularity=granularity,
    610            )
    611
    612        def _parse_partition(self) -> t.Optional[exp.Partition]:
    613            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    614            if not self._match(TokenType.PARTITION):
    615                return None
    616
    617            if self._match_text_seq("ID"):
    618                # Corresponds to the PARTITION ID <string_value> syntax
    619                expressions: t.List[exp.Expression] = [
    620                    self.expression(exp.PartitionId, this=self._parse_string())
    621                ]
    622            else:
    623                expressions = self._parse_expressions()
    624
    625            return self.expression(exp.Partition, expressions=expressions)
    626
    627        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    628            partition = self._parse_partition()
    629
    630            if not partition or not self._match(TokenType.FROM):
    631                return None
    632
    633            return self.expression(
    634                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    635            )
    636
    637        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    638            if not self._match_text_seq("PROJECTION"):
    639                return None
    640
    641            return self.expression(
    642                exp.ProjectionDef,
    643                this=self._parse_id_var(),
    644                expression=self._parse_wrapped(self._parse_statement),
    645            )
    646
    647        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    648            return super()._parse_constraint() or self._parse_projection_def()
    649
    650    class Generator(generator.Generator):
    651        QUERY_HINTS = False
    652        STRUCT_DELIMITER = ("(", ")")
    653        NVL2_SUPPORTED = False
    654        TABLESAMPLE_REQUIRES_PARENS = False
    655        TABLESAMPLE_SIZE_IS_ROWS = False
    656        TABLESAMPLE_KEYWORDS = "SAMPLE"
    657        LAST_DAY_SUPPORTS_DATE_PART = False
    658        CAN_IMPLEMENT_ARRAY_ANY = True
    659        SUPPORTS_TO_NUMBER = False
    660
    661        STRING_TYPE_MAPPING = {
    662            exp.DataType.Type.CHAR: "String",
    663            exp.DataType.Type.LONGBLOB: "String",
    664            exp.DataType.Type.LONGTEXT: "String",
    665            exp.DataType.Type.MEDIUMBLOB: "String",
    666            exp.DataType.Type.MEDIUMTEXT: "String",
    667            exp.DataType.Type.TINYBLOB: "String",
    668            exp.DataType.Type.TINYTEXT: "String",
    669            exp.DataType.Type.TEXT: "String",
    670            exp.DataType.Type.VARBINARY: "String",
    671            exp.DataType.Type.VARCHAR: "String",
    672        }
    673
    674        SUPPORTED_JSON_PATH_PARTS = {
    675            exp.JSONPathKey,
    676            exp.JSONPathRoot,
    677            exp.JSONPathSubscript,
    678        }
    679
    680        TYPE_MAPPING = {
    681            **generator.Generator.TYPE_MAPPING,
    682            **STRING_TYPE_MAPPING,
    683            exp.DataType.Type.ARRAY: "Array",
    684            exp.DataType.Type.BIGINT: "Int64",
    685            exp.DataType.Type.DATE32: "Date32",
    686            exp.DataType.Type.DATETIME64: "DateTime64",
    687            exp.DataType.Type.DOUBLE: "Float64",
    688            exp.DataType.Type.ENUM: "Enum",
    689            exp.DataType.Type.ENUM8: "Enum8",
    690            exp.DataType.Type.ENUM16: "Enum16",
    691            exp.DataType.Type.FIXEDSTRING: "FixedString",
    692            exp.DataType.Type.FLOAT: "Float32",
    693            exp.DataType.Type.INT: "Int32",
    694            exp.DataType.Type.MEDIUMINT: "Int32",
    695            exp.DataType.Type.INT128: "Int128",
    696            exp.DataType.Type.INT256: "Int256",
    697            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    698            exp.DataType.Type.MAP: "Map",
    699            exp.DataType.Type.NESTED: "Nested",
    700            exp.DataType.Type.NULLABLE: "Nullable",
    701            exp.DataType.Type.SMALLINT: "Int16",
    702            exp.DataType.Type.STRUCT: "Tuple",
    703            exp.DataType.Type.TINYINT: "Int8",
    704            exp.DataType.Type.UBIGINT: "UInt64",
    705            exp.DataType.Type.UINT: "UInt32",
    706            exp.DataType.Type.UINT128: "UInt128",
    707            exp.DataType.Type.UINT256: "UInt256",
    708            exp.DataType.Type.USMALLINT: "UInt16",
    709            exp.DataType.Type.UTINYINT: "UInt8",
    710            exp.DataType.Type.IPV4: "IPv4",
    711            exp.DataType.Type.IPV6: "IPv6",
    712            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    713            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    714        }
    715
    716        TRANSFORMS = {
    717            **generator.Generator.TRANSFORMS,
    718            exp.AnyValue: rename_func("any"),
    719            exp.ApproxDistinct: rename_func("uniq"),
    720            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    721            exp.ArraySize: rename_func("LENGTH"),
    722            exp.ArraySum: rename_func("arraySum"),
    723            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    724            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    725            exp.Array: inline_array_sql,
    726            exp.CastToStrType: rename_func("CAST"),
    727            exp.CountIf: rename_func("countIf"),
    728            exp.CompressColumnConstraint: lambda self,
    729            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    730            exp.ComputedColumnConstraint: lambda self,
    731            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    732            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    733            exp.DateAdd: date_delta_sql("DATE_ADD"),
    734            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    735            exp.Explode: rename_func("arrayJoin"),
    736            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    737            exp.IsNan: rename_func("isNaN"),
    738            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    739            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    740            exp.JSONPathKey: json_path_key_only_name,
    741            exp.JSONPathRoot: lambda *_: "",
    742            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    743            exp.Nullif: rename_func("nullIf"),
    744            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    745            exp.Pivot: no_pivot_sql,
    746            exp.Quantile: _quantile_sql,
    747            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    748            exp.Rand: rename_func("randCanonical"),
    749            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    750            exp.StartsWith: rename_func("startsWith"),
    751            exp.StrPosition: lambda self, e: self.func(
    752                "position", e.this, e.args.get("substr"), e.args.get("position")
    753            ),
    754            exp.TimeToStr: lambda self, e: self.func(
    755                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    756            ),
    757            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    758            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    759            exp.MD5Digest: rename_func("MD5"),
    760            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
    761            exp.SHA: rename_func("SHA1"),
    762            exp.SHA2: lambda self, e: self.func(
    763                "SHA256" if e.text("length") == "256" else "SHA512", e.this
    764            ),
    765            exp.UnixToTime: _unix_to_time_sql,
    766            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
    767            exp.Variance: rename_func("varSamp"),
    768            exp.Stddev: rename_func("stddevSamp"),
    769        }
    770
    771        PROPERTIES_LOCATION = {
    772            **generator.Generator.PROPERTIES_LOCATION,
    773            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    774            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    775            exp.OnCluster: exp.Properties.Location.POST_NAME,
    776        }
    777
    778        JOIN_HINTS = False
    779        TABLE_HINTS = False
    780        EXPLICIT_UNION = True
    781        GROUPINGS_SEP = ""
    782        OUTER_UNION_MODIFIERS = False
    783
    784        # there's no list in docs, but it can be found in Clickhouse code
    785        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    786        ON_CLUSTER_TARGETS = {
    787            "DATABASE",
    788            "TABLE",
    789            "VIEW",
    790            "DICTIONARY",
    791            "INDEX",
    792            "FUNCTION",
    793            "NAMED COLLECTION",
    794        }
    795
    796        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    797            this = self.json_path_part(expression.this)
    798            return str(int(this) + 1) if is_int(this) else this
    799
    800        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    801            return f"AS {self.sql(expression, 'this')}"
    802
    803        def _any_to_has(
    804            self,
    805            expression: exp.EQ | exp.NEQ,
    806            default: t.Callable[[t.Any], str],
    807            prefix: str = "",
    808        ) -> str:
    809            if isinstance(expression.left, exp.Any):
    810                arr = expression.left
    811                this = expression.right
    812            elif isinstance(expression.right, exp.Any):
    813                arr = expression.right
    814                this = expression.left
    815            else:
    816                return default(expression)
    817
    818            return prefix + self.func("has", arr.this.unnest(), this)
    819
    820        def eq_sql(self, expression: exp.EQ) -> str:
    821            return self._any_to_has(expression, super().eq_sql)
    822
    823        def neq_sql(self, expression: exp.NEQ) -> str:
    824            return self._any_to_has(expression, super().neq_sql, "NOT ")
    825
    826        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    827            # Manually add a flag to make the search case-insensitive
    828            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    829            return self.func("match", expression.this, regex)
    830
    831        def datatype_sql(self, expression: exp.DataType) -> str:
    832            # String is the standard ClickHouse type, every other variant is just an alias.
    833            # Additionally, any supplied length parameter will be ignored.
    834            #
    835            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    836            if expression.this in self.STRING_TYPE_MAPPING:
    837                return "String"
    838
    839            return super().datatype_sql(expression)
    840
    841        def cte_sql(self, expression: exp.CTE) -> str:
    842            if expression.args.get("scalar"):
    843                this = self.sql(expression, "this")
    844                alias = self.sql(expression, "alias")
    845                return f"{this} AS {alias}"
    846
    847            return super().cte_sql(expression)
    848
    849        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    850            return super().after_limit_modifiers(expression) + [
    851                (
    852                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    853                    if expression.args.get("settings")
    854                    else ""
    855                ),
    856                (
    857                    self.seg("FORMAT ") + self.sql(expression, "format")
    858                    if expression.args.get("format")
    859                    else ""
    860                ),
    861            ]
    862
    863        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    864            params = self.expressions(expression, key="params", flat=True)
    865            return self.func(expression.name, *expression.expressions) + f"({params})"
    866
    867        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    868            return self.func(expression.name, *expression.expressions)
    869
    870        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    871            return self.anonymousaggfunc_sql(expression)
    872
    873        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    874            return self.parameterizedagg_sql(expression)
    875
    876        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    877            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    878
    879        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    880            return f"ON CLUSTER {self.sql(expression, 'this')}"
    881
    882        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    883            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    884                exp.Properties.Location.POST_NAME
    885            ):
    886                this_name = self.sql(expression.this, "this")
    887                this_properties = " ".join(
    888                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    889                )
    890                this_schema = self.schema_columns_sql(expression.this)
    891                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    892
    893            return super().createable_sql(expression, locations)
    894
    895        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    896            this = self.indent(self.sql(expression, "this"))
    897            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    898
    899        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    900            this = self.sql(expression, "this")
    901            this = f" {this}" if this else ""
    902            expr = self.sql(expression, "expression")
    903            expr = f" {expr}" if expr else ""
    904            index_type = self.sql(expression, "index_type")
    905            index_type = f" TYPE {index_type}" if index_type else ""
    906            granularity = self.sql(expression, "granularity")
    907            granularity = f" GRANULARITY {granularity}" if granularity else ""
    908
    909            return f"INDEX{this}{expr}{index_type}{granularity}"
    910
    911        def partition_sql(self, expression: exp.Partition) -> str:
    912            return f"PARTITION {self.expressions(expression, flat=True)}"
    913
    914        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    915            return f"ID {self.sql(expression.this)}"
    916
    917        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    918            return (
    919                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    920            )
    921
    922        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    923            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

###### Possible values:

> "upper" or True: Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.

NULL_ORDERING = 'nulls_are_last'

Default `NULL` ordering method to use if not explicitly set. Possible values: `"nulls_are_small"`, `"nulls_are_large"`, `"nulls_are_last"`

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

Whether division by zero throws an error (`False`) or returns NULL (`True`).

LOG_BASE_FIRST: Optional[bool] = None

Whether the base comes first in the `LOG` function. Possible values: `True`, `False`, `None` (two arguments are not supported by `LOG`)

UNESCAPED_SEQUENCES = {'\\a': '\x07', '\\b': '\x08', '\\f': '\x0c', '\\n': '\n', '\\r': '\r', '\\t': '\t', '\\v': '\x0b', '\\\\': '\\', '\\0': '\x00'}

Mapping of an escaped sequence (`\n`) to its unescaped version (`` ).

tokenizer_class = <class 'ClickHouse.Tokenizer'>
parser_class = <class 'ClickHouse.Parser'>
generator_class = <class 'ClickHouse.Generator'>
TIME_TRIE: Dict = {}
FORMAT_TRIE: Dict = {}
INVERSE_TIME_MAPPING: Dict[str, str] = {}
INVERSE_TIME_TRIE: Dict = {}
ESCAPED_SEQUENCES: Dict[str, str] = {'\x07': '\\a', '\x08': '\\b', '\x0c': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\x0b': '\\v', '\\': '\\\\', '\x00': '\\0'}
QUOTE_START = "'"
QUOTE_END = "'"
IDENTIFIER_START = '"'
IDENTIFIER_END = '"'
BIT_START: Optional[str] = '0b'
BIT_END: Optional[str] = ''
HEX_START: Optional[str] = '0x'
HEX_END: Optional[str] = ''
BYTE_START: Optional[str] = None
BYTE_END: Optional[str] = None
UNICODE_START: Optional[str] = None
UNICODE_END: Optional[str] = None

##### Inherited Members

sqlglot.dialects.dialect.Dialect
  Dialect
  INDEX_OFFSET
  WEEK_OFFSET
  UNNEST_COLUMN_ONLY
  ALIAS_POST_TABLESAMPLE
  TABLESAMPLE_SIZE_IS_PERCENT
  NORMALIZATION_STRATEGY
  IDENTIFIERS_CAN_START_WITH_DIGIT
  DPIPE_IS_STRING_CONCAT
  STRICT_STRING_CONCAT
  SUPPORTS_SEMI_ANTI_JOIN
  TYPED_DIVISION
  CONCAT_COALESCE
  HEX_LOWERCASE
  DATE_FORMAT
  DATEINT_FORMAT
  TIME_FORMAT
  TIME_MAPPING
  FORMAT_MAPPING
  PSEUDOCOLUMNS
  PREFER_CTE_ALIAS_COLUMN
  COPY_PARAMS_ARE_CSV
  get_or_raise
  format_time
  normalize_identifier
  case_sensitive
  can_identify
  quote_identifier
  to_json_path
  parse
  parse_into
  generate
  transpile
  tokenize
  tokenizer
  parser
  generator

class ClickHouse.Tokenizer(sqlglot.tokens.Tokenizer): View Source

     91    class Tokenizer(tokens.Tokenizer):
     92        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     93        IDENTIFIERS = ['"', "`"]
     94        STRING_ESCAPES = ["'", "\\"]
     95        BIT_STRINGS = [("0b", "")]
     96        HEX_STRINGS = [("0x", ""), ("0X", "")]
     97        HEREDOC_STRINGS = ["$"]
     98
     99        KEYWORDS = {
    100            **tokens.Tokenizer.KEYWORDS,
    101            "ATTACH": TokenType.COMMAND,
    102            "DATE32": TokenType.DATE32,
    103            "DATETIME64": TokenType.DATETIME64,
    104            "DICTIONARY": TokenType.DICTIONARY,
    105            "ENUM8": TokenType.ENUM8,
    106            "ENUM16": TokenType.ENUM16,
    107            "FINAL": TokenType.FINAL,
    108            "FIXEDSTRING": TokenType.FIXEDSTRING,
    109            "FLOAT32": TokenType.FLOAT,
    110            "FLOAT64": TokenType.DOUBLE,
    111            "GLOBAL": TokenType.GLOBAL,
    112            "INT256": TokenType.INT256,
    113            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    114            "MAP": TokenType.MAP,
    115            "NESTED": TokenType.NESTED,
    116            "SAMPLE": TokenType.TABLE_SAMPLE,
    117            "TUPLE": TokenType.STRUCT,
    118            "UINT128": TokenType.UINT128,
    119            "UINT16": TokenType.USMALLINT,
    120            "UINT256": TokenType.UINT256,
    121            "UINT32": TokenType.UINT,
    122            "UINT64": TokenType.UBIGINT,
    123            "UINT8": TokenType.UTINYINT,
    124            "IPV4": TokenType.IPV4,
    125            "IPV6": TokenType.IPV6,
    126            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
    127            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
    128            "SYSTEM": TokenType.COMMAND,
    129            "PREWHERE": TokenType.PREWHERE,
    130        }
    131
    132        SINGLE_TOKENS = {
    133            **tokens.Tokenizer.SINGLE_TOKENS,
    134            "$": TokenType.HEREDOC_STRING,
    135        }

COMMENTS = ['--', '#', '#!', ('/*', '*/')]
IDENTIFIERS = ['"', '`']
STRING_ESCAPES = ["'", '\\']
BIT_STRINGS = [('0b', '')]
HEX_STRINGS = [('0x', ''), ('0X', '')]
HEREDOC_STRINGS = ['$']
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.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'>, '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_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'>, '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'>, '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'>, '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'>, 'INT128': <TokenType.INT128: 'INT128'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'UINT': <TokenType.UINT: 'UINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, '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'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, '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.VARBINARY: 'VARBINARY'>, '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.TIMESTAMP: 'TIMESTAMP'>, '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'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, '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'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATE32': <TokenType.DATE32: 'DATE32'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>, 'IPV4': <TokenType.IPV4: 'IPV4'>, 'IPV6': <TokenType.IPV6: 'IPV6'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, 'SYSTEM': <TokenType.COMMAND: 'COMMAND'>, 'PREWHERE': <TokenType.PREWHERE: 'PREWHERE'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, '#': <TokenType.HASH: 'HASH'>, "'": <TokenType.UNKNOWN: 'UNKNOWN'>, '`': <TokenType.UNKNOWN: 'UNKNOWN'>, '"': <TokenType.UNKNOWN: 'UNKNOWN'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}

##### Inherited Members

sqlglot.tokens.Tokenizer
  Tokenizer
  BYTE_STRINGS
  RAW_STRINGS
  UNICODE_STRINGS
  IDENTIFIER_ESCAPES
  QUOTES
  VAR_SINGLE_TOKENS
  HEREDOC_TAG_IS_IDENTIFIER
  HEREDOC_STRING_ALTERNATIVE
  WHITE_SPACE
  COMMANDS
  COMMAND_PREFIX_TOKENS
  NUMERIC_LITERALS
  dialect
  reset
  tokenize
  tokenize_rs
  size
  sql
  tokens

class ClickHouse.Parser(sqlglot.parser.Parser): View Source

    137    class Parser(parser.Parser):
    138        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    139        # * select x from t1 union all select x from t2 limit 1;
    140        # * select x from t1 union all (select x from t2 limit 1);
    141        MODIFIERS_ATTACHED_TO_UNION = False
    142        INTERVAL_SPANS = False
    143
    144        FUNCTIONS = {
    145            **parser.Parser.FUNCTIONS,
    146            "ANY": exp.AnyValue.from_arg_list,
    147            "ARRAYSUM": exp.ArraySum.from_arg_list,
    148            "COUNTIF": _build_count_if,
    149            "DATE_ADD": lambda args: exp.DateAdd(
    150                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    151            ),
    152            "DATEADD": lambda args: exp.DateAdd(
    153                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    154            ),
    155            "DATE_DIFF": lambda args: exp.DateDiff(
    156                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    157            ),
    158            "DATEDIFF": lambda args: exp.DateDiff(
    159                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    160            ),
    161            "DATE_FORMAT": _build_date_format,
    162            "FORMATDATETIME": _build_date_format,
    163            "JSONEXTRACTSTRING": build_json_extract_path(
    164                exp.JSONExtractScalar, zero_based_indexing=False
    165            ),
    166            "MAP": parser.build_var_map,
    167            "MATCH": exp.RegexpLike.from_arg_list,
    168            "RANDCANONICAL": exp.Rand.from_arg_list,
    169            "TUPLE": exp.Struct.from_arg_list,
    170            "UNIQ": exp.ApproxDistinct.from_arg_list,
    171            "XOR": lambda args: exp.Xor(expressions=args),
    172            "MD5": exp.MD5Digest.from_arg_list,
    173            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
    174            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
    175        }
    176
    177        AGG_FUNCTIONS = {
    178            "count",
    179            "min",
    180            "max",
    181            "sum",
    182            "avg",
    183            "any",
    184            "stddevPop",
    185            "stddevSamp",
    186            "varPop",
    187            "varSamp",
    188            "corr",
    189            "covarPop",
    190            "covarSamp",
    191            "entropy",
    192            "exponentialMovingAverage",
    193            "intervalLengthSum",
    194            "kolmogorovSmirnovTest",
    195            "mannWhitneyUTest",
    196            "median",
    197            "rankCorr",
    198            "sumKahan",
    199            "studentTTest",
    200            "welchTTest",
    201            "anyHeavy",
    202            "anyLast",
    203            "boundingRatio",
    204            "first_value",
    205            "last_value",
    206            "argMin",
    207            "argMax",
    208            "avgWeighted",
    209            "topK",
    210            "topKWeighted",
    211            "deltaSum",
    212            "deltaSumTimestamp",
    213            "groupArray",
    214            "groupArrayLast",
    215            "groupUniqArray",
    216            "groupArrayInsertAt",
    217            "groupArrayMovingAvg",
    218            "groupArrayMovingSum",
    219            "groupArraySample",
    220            "groupBitAnd",
    221            "groupBitOr",
    222            "groupBitXor",
    223            "groupBitmap",
    224            "groupBitmapAnd",
    225            "groupBitmapOr",
    226            "groupBitmapXor",
    227            "sumWithOverflow",
    228            "sumMap",
    229            "minMap",
    230            "maxMap",
    231            "skewSamp",
    232            "skewPop",
    233            "kurtSamp",
    234            "kurtPop",
    235            "uniq",
    236            "uniqExact",
    237            "uniqCombined",
    238            "uniqCombined64",
    239            "uniqHLL12",
    240            "uniqTheta",
    241            "quantile",
    242            "quantiles",
    243            "quantileExact",
    244            "quantilesExact",
    245            "quantileExactLow",
    246            "quantilesExactLow",
    247            "quantileExactHigh",
    248            "quantilesExactHigh",
    249            "quantileExactWeighted",
    250            "quantilesExactWeighted",
    251            "quantileTiming",
    252            "quantilesTiming",
    253            "quantileTimingWeighted",
    254            "quantilesTimingWeighted",
    255            "quantileDeterministic",
    256            "quantilesDeterministic",
    257            "quantileTDigest",
    258            "quantilesTDigest",
    259            "quantileTDigestWeighted",
    260            "quantilesTDigestWeighted",
    261            "quantileBFloat16",
    262            "quantilesBFloat16",
    263            "quantileBFloat16Weighted",
    264            "quantilesBFloat16Weighted",
    265            "simpleLinearRegression",
    266            "stochasticLinearRegression",
    267            "stochasticLogisticRegression",
    268            "categoricalInformationValue",
    269            "contingency",
    270            "cramersV",
    271            "cramersVBiasCorrected",
    272            "theilsU",
    273            "maxIntersections",
    274            "maxIntersectionsPosition",
    275            "meanZTest",
    276            "quantileInterpolatedWeighted",
    277            "quantilesInterpolatedWeighted",
    278            "quantileGK",
    279            "quantilesGK",
    280            "sparkBar",
    281            "sumCount",
    282            "largestTriangleThreeBuckets",
    283            "histogram",
    284            "sequenceMatch",
    285            "sequenceCount",
    286            "windowFunnel",
    287            "retention",
    288            "uniqUpTo",
    289            "sequenceNextNode",
    290            "exponentialTimeDecayedAvg",
    291        }
    292
    293        AGG_FUNCTIONS_SUFFIXES = [
    294            "If",
    295            "Array",
    296            "ArrayIf",
    297            "Map",
    298            "SimpleState",
    299            "State",
    300            "Merge",
    301            "MergeState",
    302            "ForEach",
    303            "Distinct",
    304            "OrDefault",
    305            "OrNull",
    306            "Resample",
    307            "ArgMin",
    308            "ArgMax",
    309        ]
    310
    311        FUNC_TOKENS = {
    312            *parser.Parser.FUNC_TOKENS,
    313            TokenType.SET,
    314        }
    315
    316        AGG_FUNC_MAPPING = (
    317            lambda functions, suffixes: {
    318                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    319            }
    320        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    321
    322        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    323
    324        FUNCTION_PARSERS = {
    325            **parser.Parser.FUNCTION_PARSERS,
    326            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    327            "QUANTILE": lambda self: self._parse_quantile(),
    328        }
    329
    330        FUNCTION_PARSERS.pop("MATCH")
    331
    332        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    333        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    334
    335        RANGE_PARSERS = {
    336            **parser.Parser.RANGE_PARSERS,
    337            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    338            and self._parse_in(this, is_global=True),
    339        }
    340
    341        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    342        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    343        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    344        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    345
    346        JOIN_KINDS = {
    347            *parser.Parser.JOIN_KINDS,
    348            TokenType.ANY,
    349            TokenType.ASOF,
    350            TokenType.ARRAY,
    351        }
    352
    353        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    354            TokenType.ANY,
    355            TokenType.ARRAY,
    356            TokenType.FINAL,
    357            TokenType.FORMAT,
    358            TokenType.SETTINGS,
    359        }
    360
    361        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    362            TokenType.FORMAT,
    363        }
    364
    365        LOG_DEFAULTS_TO_LN = True
    366
    367        QUERY_MODIFIER_PARSERS = {
    368            **parser.Parser.QUERY_MODIFIER_PARSERS,
    369            TokenType.SETTINGS: lambda self: (
    370                "settings",
    371                self._advance() or self._parse_csv(self._parse_conjunction),
    372            ),
    373            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    374        }
    375
    376        CONSTRAINT_PARSERS = {
    377            **parser.Parser.CONSTRAINT_PARSERS,
    378            "INDEX": lambda self: self._parse_index_constraint(),
    379            "CODEC": lambda self: self._parse_compress(),
    380        }
    381
    382        ALTER_PARSERS = {
    383            **parser.Parser.ALTER_PARSERS,
    384            "REPLACE": lambda self: self._parse_alter_table_replace(),
    385        }
    386
    387        SCHEMA_UNNAMED_CONSTRAINTS = {
    388            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    389            "INDEX",
    390        }
    391
    392        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    393            this = super()._parse_conjunction()
    394
    395            if self._match(TokenType.PLACEHOLDER):
    396                return self.expression(
    397                    exp.If,
    398                    this=this,
    399                    true=self._parse_conjunction(),
    400                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    401                )
    402
    403            return this
    404
    405        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    406            """
    407            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    408            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    409            """
    410            if not self._match(TokenType.L_BRACE):
    411                return None
    412
    413            this = self._parse_id_var()
    414            self._match(TokenType.COLON)
    415            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    416                self._match_text_seq("IDENTIFIER") and "Identifier"
    417            )
    418
    419            if not kind:
    420                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    421            elif not self._match(TokenType.R_BRACE):
    422                self.raise_error("Expecting }")
    423
    424            return self.expression(exp.Placeholder, this=this, kind=kind)
    425
    426        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    427            this = super()._parse_in(this)
    428            this.set("is_global", is_global)
    429            return this
    430
    431        def _parse_table(
    432            self,
    433            schema: bool = False,
    434            joins: bool = False,
    435            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    436            parse_bracket: bool = False,
    437            is_db_reference: bool = False,
    438            parse_partition: bool = False,
    439        ) -> t.Optional[exp.Expression]:
    440            this = super()._parse_table(
    441                schema=schema,
    442                joins=joins,
    443                alias_tokens=alias_tokens,
    444                parse_bracket=parse_bracket,
    445                is_db_reference=is_db_reference,
    446            )
    447
    448            if self._match(TokenType.FINAL):
    449                this = self.expression(exp.Final, this=this)
    450
    451            return this
    452
    453        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    454            return super()._parse_position(haystack_first=True)
    455
    456        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    457        def _parse_cte(self) -> exp.CTE:
    458            # WITH <identifier> AS <subquery expression>
    459            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    460
    461            if not cte:
    462                # WITH <expression> AS <identifier>
    463                cte = self.expression(
    464                    exp.CTE,
    465                    this=self._parse_conjunction(),
    466                    alias=self._parse_table_alias(),
    467                    scalar=True,
    468                )
    469
    470            return cte
    471
    472        def _parse_join_parts(
    473            self,
    474        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    475            is_global = self._match(TokenType.GLOBAL) and self._prev
    476            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    477
    478            if kind_pre:
    479                kind = self._match_set(self.JOIN_KINDS) and self._prev
    480                side = self._match_set(self.JOIN_SIDES) and self._prev
    481                return is_global, side, kind
    482
    483            return (
    484                is_global,
    485                self._match_set(self.JOIN_SIDES) and self._prev,
    486                self._match_set(self.JOIN_KINDS) and self._prev,
    487            )
    488
    489        def _parse_join(
    490            self, skip_join_token: bool = False, parse_bracket: bool = False
    491        ) -> t.Optional[exp.Join]:
    492            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    493            if join:
    494                join.set("global", join.args.pop("method", None))
    495
    496            return join
    497
    498        def _parse_function(
    499            self,
    500            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    501            anonymous: bool = False,
    502            optional_parens: bool = True,
    503            any_token: bool = False,
    504        ) -> t.Optional[exp.Expression]:
    505            expr = super()._parse_function(
    506                functions=functions,
    507                anonymous=anonymous,
    508                optional_parens=optional_parens,
    509                any_token=any_token,
    510            )
    511
    512            func = expr.this if isinstance(expr, exp.Window) else expr
    513
    514            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    515            parts = (
    516                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    517            )
    518
    519            if parts:
    520                params = self._parse_func_params(func)
    521
    522                kwargs = {
    523                    "this": func.this,
    524                    "expressions": func.expressions,
    525                }
    526                if parts[1]:
    527                    kwargs["parts"] = parts
    528                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    529                else:
    530                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    531
    532                kwargs["exp_class"] = exp_class
    533                if params:
    534                    kwargs["params"] = params
    535
    536                func = self.expression(**kwargs)
    537
    538                if isinstance(expr, exp.Window):
    539                    # The window's func was parsed as Anonymous in base parser, fix its
    540                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    541                    expr.set("this", func)
    542                elif params:
    543                    # Params have blocked super()._parse_function() from parsing the following window
    544                    # (if that exists) as they're standing between the function call and the window spec
    545                    expr = self._parse_window(func)
    546                else:
    547                    expr = func
    548
    549            return expr
    550
    551        def _parse_func_params(
    552            self, this: t.Optional[exp.Func] = None
    553        ) -> t.Optional[t.List[exp.Expression]]:
    554            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    555                return self._parse_csv(self._parse_lambda)
    556
    557            if self._match(TokenType.L_PAREN):
    558                params = self._parse_csv(self._parse_lambda)
    559                self._match_r_paren(this)
    560                return params
    561
    562            return None
    563
    564        def _parse_quantile(self) -> exp.Quantile:
    565            this = self._parse_lambda()
    566            params = self._parse_func_params()
    567            if params:
    568                return self.expression(exp.Quantile, this=params[0], quantile=this)
    569            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    570
    571        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    572            return super()._parse_wrapped_id_vars(optional=True)
    573
    574        def _parse_primary_key(
    575            self, wrapped_optional: bool = False, in_props: bool = False
    576        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    577            return super()._parse_primary_key(
    578                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    579            )
    580
    581        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    582            index = self._index
    583            if self._match_text_seq("CLUSTER"):
    584                this = self._parse_id_var()
    585                if this:
    586                    return self.expression(exp.OnCluster, this=this)
    587                else:
    588                    self._retreat(index)
    589            return None
    590
    591        def _parse_index_constraint(
    592            self, kind: t.Optional[str] = None
    593        ) -> exp.IndexColumnConstraint:
    594            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    595            this = self._parse_id_var()
    596            expression = self._parse_conjunction()
    597
    598            index_type = self._match_text_seq("TYPE") and (
    599                self._parse_function() or self._parse_var()
    600            )
    601
    602            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    603
    604            return self.expression(
    605                exp.IndexColumnConstraint,
    606                this=this,
    607                expression=expression,
    608                index_type=index_type,
    609                granularity=granularity,
    610            )
    611
    612        def _parse_partition(self) -> t.Optional[exp.Partition]:
    613            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    614            if not self._match(TokenType.PARTITION):
    615                return None
    616
    617            if self._match_text_seq("ID"):
    618                # Corresponds to the PARTITION ID <string_value> syntax
    619                expressions: t.List[exp.Expression] = [
    620                    self.expression(exp.PartitionId, this=self._parse_string())
    621                ]
    622            else:
    623                expressions = self._parse_expressions()
    624
    625            return self.expression(exp.Partition, expressions=expressions)
    626
    627        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    628            partition = self._parse_partition()
    629
    630            if not partition or not self._match(TokenType.FROM):
    631                return None
    632
    633            return self.expression(
    634                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    635            )
    636
    637        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    638            if not self._match_text_seq("PROJECTION"):
    639                return None
    640
    641            return self.expression(
    642                exp.ProjectionDef,
    643                this=self._parse_id_var(),
    644                expression=self._parse_wrapped(self._parse_statement),
    645            )
    646
    647        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    648            return super()._parse_constraint() or self._parse_projection_def()

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

MODIFIERS_ATTACHED_TO_UNION = False
INTERVAL_SPANS = False
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'>>, '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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Array'>>, 'ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAgg'>>, '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_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'>>, '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_OVERLAPS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayOverlaps'>>, '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_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'>>, 'AVG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Avg'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Chr'>>, 'CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Chr'>>, 'COALESCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'IFNULL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'NVL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'COLLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Collate'>>, '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'>>, 'CONVERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Convert'>>, 'CORR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Corr'>>, 'COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Count'>>, 'COUNT_IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CountIf'>>, 'COUNTIF': <function _build_count_if>, '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_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_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentUser'>>, 'DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Date'>>, 'DATE_ADD': <function ClickHouse.Parser.<lambda>>, 'DATEDIFF': <function ClickHouse.Parser.<lambda>>, 'DATE_DIFF': <function ClickHouse.Parser.<lambda>>, 'DATE_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATE_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateStrToDate'>>, 'DATE_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateSub'>>, '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_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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Day'>>, 'DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfMonth'>>, 'DAYOFMONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfMonth'>>, 'DAY_OF_WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeek'>>, 'DAYOFWEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeek'>>, 'DAY_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfYear'>>, 'DAYOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfYear'>>, 'DECODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Decode'>>, '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'>>, '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'>>, 'EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Extract'>>, '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'>>, 'GENERATE_DATE_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateDateArray'>>, 'GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, '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'>>, '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_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'>>, 'JSON_EXTRACT': <function build_extract_json_with_path.<locals>._builder>, '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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEVENSHTEIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Levenshtein'>>, '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.MD5Digest'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MAP': <function build_var_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'>>, 'MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Min'>>, 'MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Month'>>, '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'>>, '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'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quarter'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_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'>>, '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'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Split'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sqrt'>>, '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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToDate'>>, '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'>>, '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'>>, 'SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sum'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToChar'>>, 'TO_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToDays'>>, '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_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'>>, 'UNHEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Unhex'>>, 'UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixDate'>>, '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'>>, 'UPPER': <function build_upper>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Week'>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WEEKOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WHEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.When'>>, 'X_M_L_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.XMLTable'>>, 'XOR': <function ClickHouse.Parser.<lambda>>, 'YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Year'>>, '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>>, 'MOD': <function build_mod>, 'TO_HEX': <function build_hex>, 'ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'ARRAYSUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySum'>>, 'DATEADD': <function ClickHouse.Parser.<lambda>>, 'DATE_FORMAT': <function _build_date_format>, 'FORMATDATETIME': <function _build_date_format>, 'JSONEXTRACTSTRING': <function build_json_extract_path.<locals>._builder>, 'MATCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'RANDCANONICAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'TUPLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Struct'>>, 'UNIQ': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'SHA256': <function ClickHouse.Parser.<lambda>>, 'SHA512': <function ClickHouse.Parser.<lambda>>}
AGG_FUNCTIONS = {'min', 'quantilesTimingWeighted', 'uniqCombined64', 'quantilesBFloat16Weighted', 'stochasticLinearRegression', 'simpleLinearRegression', 'quantileBFloat16', 'quantiles', 'argMax', 'sumWithOverflow', 'intervalLengthSum', 'uniqHLL12', 'quantilesTDigest', 'quantileInterpolatedWeighted', 'quantileBFloat16Weighted', 'studentTTest', 'boundingRatio', 'groupBitmapOr', 'welchTTest', 'kurtPop', 'quantilesGK', 'quantileExactLow', 'skewSamp', 'varPop', 'maxIntersections', 'histogram', 'stddevSamp', 'quantilesExact', 'uniq', 'anyLast', 'groupBitmapAnd', 'anyHeavy', 'quantilesTiming', 'avgWeighted', 'deltaSum', 'groupBitAnd', 'sumKahan', 'kurtSamp', 'entropy', 'groupBitmapXor', 'last_value', 'quantileTDigest', 'kolmogorovSmirnovTest', 'sumCount', 'contingency', 'quantileExact', 'stddevPop', 'sparkBar', 'max', 'covarPop', 'groupArrayLast', 'groupArrayMovingAvg', 'largestTriangleThreeBuckets', 'quantilesExactHigh', 'avg', 'quantile', 'groupArraySample', 'quantileGK', 'quantilesDeterministic', 'quantilesExactLow', 'maxMap', 'sumMap', 'sum', 'topK', 'quantilesInterpolatedWeighted', 'sequenceMatch', 'quantileTimingWeighted', 'uniqUpTo', 'argMin', 'quantileExactHigh', 'uniqTheta', 'uniqExact', 'quantileTiming', 'uniqCombined', 'groupBitOr', 'sequenceCount', 'groupArray', 'any', 'quantileExactWeighted', 'first_value', 'stochasticLogisticRegression', 'quantilesBFloat16', 'covarSamp', 'groupBitmap', 'rankCorr', 'meanZTest', 'groupUniqArray', 'groupArrayInsertAt', 'topKWeighted', 'count', 'quantilesTDigestWeighted', 'quantilesExactWeighted', 'theilsU', 'mannWhitneyUTest', 'groupBitXor', 'exponentialMovingAverage', 'skewPop', 'exponentialTimeDecayedAvg', 'quantileTDigestWeighted', 'quantileDeterministic', 'deltaSumTimestamp', 'varSamp', 'cramersV', 'sequenceNextNode', 'maxIntersectionsPosition', 'median', 'groupArrayMovingSum', 'categoricalInformationValue', 'windowFunnel', 'cramersVBiasCorrected', 'corr', 'retention', 'minMap'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
FUNC_TOKENS = {<TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INET: 'INET'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.JSONB: 'JSONB'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.SOME: 'SOME'>, <TokenType.BIT: 'BIT'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.INT256: 'INT256'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.INT: 'INT'>, <TokenType.XML: 'XML'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.MERGE: 'MERGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.DATE: 'DATE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.FIRST: 'FIRST'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.BINARY: 'BINARY'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.SUPER: 'SUPER'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.UINT: 'UINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.GLOB: 'GLOB'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.LIKE: 'LIKE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.JSON: 'JSON'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.ENUM: 'ENUM'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.ALL: 'ALL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.TABLE: 'TABLE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.SET: 'SET'>, <TokenType.XOR: 'XOR'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TIME: 'TIME'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.IPV6: 'IPV6'>, <TokenType.NAME: 'NAME'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.ANY: 'ANY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.MAP: 'MAP'>, <TokenType.RANGE: 'RANGE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.IPV4: 'IPV4'>, <TokenType.TEXT: 'TEXT'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.INSERT: 'INSERT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.VAR: 'VAR'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.UUID: 'UUID'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.ROW: 'ROW'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.CHAR: 'CHAR'>, <TokenType.NULL: 'NULL'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.DATE32: 'DATE32'>, <TokenType.UTINYINT: 'UTINYINT'>}
AGG_FUNC_MAPPING = {'minIf': ('min', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'quantilesIf': ('quantiles', 'If'), 'argMaxIf': ('argMax', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'varPopIf': ('varPop', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'histogramIf': ('histogram', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'uniqIf': ('uniq', 'If'), 'anyLastIf': ('anyLast', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'entropyIf': ('entropy', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'last_valueIf': ('last_value', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'sumCountIf': ('sumCount', 'If'), 'contingencyIf': ('contingency', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'maxIf': ('max', 'If'), 'covarPopIf': ('covarPop', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'avgIf': ('avg', 'If'), 'quantileIf': ('quantile', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'maxMapIf': ('maxMap', 'If'), 'sumMapIf': ('sumMap', 'If'), 'sumIf': ('sum', 'If'), 'topKIf': ('topK', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'sequenceMatchIf': ('sequenceMatch', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'uniqUpToIf': ('uniqUpTo', 'If'), 'argMinIf': ('argMin', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'sequenceCountIf': ('sequenceCount', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'anyIf': ('any', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'first_valueIf': ('first_value', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'countIf': ('count', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'theilsUIf': ('theilsU', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'skewPopIf': ('skewPop', 'If'), 'exponentialTimeDecayedAvgIf': ('exponentialTimeDecayedAvg', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'varSampIf': ('varSamp', 'If'), 'cramersVIf': ('cramersV', 'If'), 'sequenceNextNodeIf': ('sequenceNextNode', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'medianIf': ('median', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'windowFunnelIf': ('windowFunnel', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'corrIf': ('corr', 'If'), 'retentionIf': ('retention', 'If'), 'minMapIf': ('minMap', 'If'), 'minArray': ('min', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'varPopArray': ('varPop', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'histogramArray': ('histogram', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'uniqArray': ('uniq', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'entropyArray': ('entropy', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'maxArray': ('max', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'avgArray': ('avg', 'Array'), 'quantileArray': ('quantile', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'sumArray': ('sum', 'Array'), 'topKArray': ('topK', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'sequenceMatchArray': ('sequenceMatch', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'uniqUpToArray': ('uniqUpTo', 'Array'), 'argMinArray': ('argMin', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'sequenceCountArray': ('sequenceCount', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'anyArray': ('any', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'countArray': ('count', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'exponentialTimeDecayedAvgArray': ('exponentialTimeDecayedAvg', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'sequenceNextNodeArray': ('sequenceNextNode', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'medianArray': ('median', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'windowFunnelArray': ('windowFunnel', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'corrArray': ('corr', 'Array'), 'retentionArray': ('retention', 'Array'), 'minMapArray': ('minMap', 'Array'), 'minArrayIf': ('min', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'histogramArrayIf': ('histogram', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'sequenceMatchArrayIf': ('sequenceMatch', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'uniqUpToArrayIf': ('uniqUpTo', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'sequenceCountArrayIf': ('sequenceCount', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'exponentialTimeDecayedAvgArrayIf': ('exponentialTimeDecayedAvg', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'sequenceNextNodeArrayIf': ('sequenceNextNode', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'windowFunnelArrayIf': ('windowFunnel', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'retentionArrayIf': ('retention', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'minMap': ('minMap', ''), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'varPopMap': ('varPop', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'histogramMap': ('histogram', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'uniqMap': ('uniq', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'entropyMap': ('entropy', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'maxMap': ('maxMap', ''), 'covarPopMap': ('covarPop', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'avgMap': ('avg', 'Map'), 'quantileMap': ('quantile', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'sumMap': ('sumMap', ''), 'topKMap': ('topK', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'sequenceMatchMap': ('sequenceMatch', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'uniqUpToMap': ('uniqUpTo', 'Map'), 'argMinMap': ('argMin', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'sequenceCountMap': ('sequenceCount', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'anyMap': ('any', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'countMap': ('count', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'exponentialTimeDecayedAvgMap': ('exponentialTimeDecayedAvg', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'sequenceNextNodeMap': ('sequenceNextNode', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'medianMap': ('median', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'windowFunnelMap': ('windowFunnel', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'corrMap': ('corr', 'Map'), 'retentionMap': ('retention', 'Map'), 'minMapMap': ('minMap', 'Map'), 'minSimpleState': ('min', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'histogramSimpleState': ('histogram', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'sequenceMatchSimpleState': ('sequenceMatch', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'uniqUpToSimpleState': ('uniqUpTo', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'sequenceCountSimpleState': ('sequenceCount', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'exponentialTimeDecayedAvgSimpleState': ('exponentialTimeDecayedAvg', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'sequenceNextNodeSimpleState': ('sequenceNextNode', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'windowFunnelSimpleState': ('windowFunnel', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'retentionSimpleState': ('retention', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'minState': ('min', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'quantilesState': ('quantiles', 'State'), 'argMaxState': ('argMax', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'skewSampState': ('skewSamp', 'State'), 'varPopState': ('varPop', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'histogramState': ('histogram', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'uniqState': ('uniq', 'State'), 'anyLastState': ('anyLast', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'entropyState': ('entropy', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'last_valueState': ('last_value', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'sumCountState': ('sumCount', 'State'), 'contingencyState': ('contingency', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'maxState': ('max', 'State'), 'covarPopState': ('covarPop', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'avgState': ('avg', 'State'), 'quantileState': ('quantile', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'maxMapState': ('maxMap', 'State'), 'sumMapState': ('sumMap', 'State'), 'sumState': ('sum', 'State'), 'topKState': ('topK', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'sequenceMatchState': ('sequenceMatch', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'uniqUpToState': ('uniqUpTo', 'State'), 'argMinState': ('argMin', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'sequenceCountState': ('sequenceCount', 'State'), 'groupArrayState': ('groupArray', 'State'), 'anyState': ('any', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'first_valueState': ('first_value', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'covarSampState': ('covarSamp', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'countState': ('count', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'theilsUState': ('theilsU', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'skewPopState': ('skewPop', 'State'), 'exponentialTimeDecayedAvgState': ('exponentialTimeDecayedAvg', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'varSampState': ('varSamp', 'State'), 'cramersVState': ('cramersV', 'State'), 'sequenceNextNodeState': ('sequenceNextNode', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'medianState': ('median', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'windowFunnelState': ('windowFunnel', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'corrState': ('corr', 'State'), 'retentionState': ('retention', 'State'), 'minMapState': ('minMap', 'State'), 'minMerge': ('min', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'histogramMerge': ('histogram', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'maxMerge': ('max', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'sequenceMatchMerge': ('sequenceMatch', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'uniqUpToMerge': ('uniqUpTo', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'sequenceCountMerge': ('sequenceCount', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'anyMerge': ('any', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'countMerge': ('count', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'exponentialTimeDecayedAvgMerge': ('exponentialTimeDecayedAvg', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'sequenceNextNodeMerge': ('sequenceNextNode', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'medianMerge': ('median', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'windowFunnelMerge': ('windowFunnel', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'retentionMerge': ('retention', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'minMergeState': ('min', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'histogramMergeState': ('histogram', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'sequenceMatchMergeState': ('sequenceMatch', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'uniqUpToMergeState': ('uniqUpTo', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'sequenceCountMergeState': ('sequenceCount', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'exponentialTimeDecayedAvgMergeState': ('exponentialTimeDecayedAvg', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'sequenceNextNodeMergeState': ('sequenceNextNode', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'windowFunnelMergeState': ('windowFunnel', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'retentionMergeState': ('retention', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'minForEach': ('min', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'histogramForEach': ('histogram', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'sequenceMatchForEach': ('sequenceMatch', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'uniqUpToForEach': ('uniqUpTo', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'sequenceCountForEach': ('sequenceCount', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'exponentialTimeDecayedAvgForEach': ('exponentialTimeDecayedAvg', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'sequenceNextNodeForEach': ('sequenceNextNode', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'windowFunnelForEach': ('windowFunnel', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'retentionForEach': ('retention', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'minDistinct': ('min', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'histogramDistinct': ('histogram', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'sequenceMatchDistinct': ('sequenceMatch', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'uniqUpToDistinct': ('uniqUpTo', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'sequenceCountDistinct': ('sequenceCount', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'exponentialTimeDecayedAvgDistinct': ('exponentialTimeDecayedAvg', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'sequenceNextNodeDistinct': ('sequenceNextNode', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'windowFunnelDistinct': ('windowFunnel', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'retentionDistinct': ('retention', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'minOrDefault': ('min', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'histogramOrDefault': ('histogram', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'sequenceMatchOrDefault': ('sequenceMatch', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'uniqUpToOrDefault': ('uniqUpTo', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'sequenceCountOrDefault': ('sequenceCount', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'exponentialTimeDecayedAvgOrDefault': ('exponentialTimeDecayedAvg', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'sequenceNextNodeOrDefault': ('sequenceNextNode', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'windowFunnelOrDefault': ('windowFunnel', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'retentionOrDefault': ('retention', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'minOrNull': ('min', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'histogramOrNull': ('histogram', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'sequenceMatchOrNull': ('sequenceMatch', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'uniqUpToOrNull': ('uniqUpTo', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'sequenceCountOrNull': ('sequenceCount', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'exponentialTimeDecayedAvgOrNull': ('exponentialTimeDecayedAvg', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'sequenceNextNodeOrNull': ('sequenceNextNode', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'windowFunnelOrNull': ('windowFunnel', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'retentionOrNull': ('retention', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'minResample': ('min', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'histogramResample': ('histogram', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'maxResample': ('max', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'avgResample': ('avg', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'sumResample': ('sum', 'Resample'), 'topKResample': ('topK', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'sequenceMatchResample': ('sequenceMatch', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'uniqUpToResample': ('uniqUpTo', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'sequenceCountResample': ('sequenceCount', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'anyResample': ('any', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'countResample': ('count', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'exponentialTimeDecayedAvgResample': ('exponentialTimeDecayedAvg', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'sequenceNextNodeResample': ('sequenceNextNode', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'medianResample': ('median', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'windowFunnelResample': ('windowFunnel', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'corrResample': ('corr', 'Resample'), 'retentionResample': ('retention', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'minArgMin': ('min', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'histogramArgMin': ('histogram', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'sequenceMatchArgMin': ('sequenceMatch', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'uniqUpToArgMin': ('uniqUpTo', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'sequenceCountArgMin': ('sequenceCount', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'exponentialTimeDecayedAvgArgMin': ('exponentialTimeDecayedAvg', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'sequenceNextNodeArgMin': ('sequenceNextNode', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'windowFunnelArgMin': ('windowFunnel', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'retentionArgMin': ('retention', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'minArgMax': ('min', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'histogramArgMax': ('histogram', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'sequenceMatchArgMax': ('sequenceMatch', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'uniqUpToArgMax': ('uniqUpTo', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'sequenceCountArgMax': ('sequenceCount', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'exponentialTimeDecayedAvgArgMax': ('exponentialTimeDecayedAvg', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'sequenceNextNodeArgMax': ('sequenceNextNode', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'windowFunnelArgMax': ('windowFunnel', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'retentionArgMax': ('retention', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'min': ('min', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'uniqCombined64': ('uniqCombined64', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'quantiles': ('quantiles', ''), 'argMax': ('argMax', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'uniqHLL12': ('uniqHLL12', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'studentTTest': ('studentTTest', ''), 'boundingRatio': ('boundingRatio', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'welchTTest': ('welchTTest', ''), 'kurtPop': ('kurtPop', ''), 'quantilesGK': ('quantilesGK', ''), 'quantileExactLow': ('quantileExactLow', ''), 'skewSamp': ('skewSamp', ''), 'varPop': ('varPop', ''), 'maxIntersections': ('maxIntersections', ''), 'histogram': ('histogram', ''), 'stddevSamp': ('stddevSamp', ''), 'quantilesExact': ('quantilesExact', ''), 'uniq': ('uniq', ''), 'anyLast': ('anyLast', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'anyHeavy': ('anyHeavy', ''), 'quantilesTiming': ('quantilesTiming', ''), 'avgWeighted': ('avgWeighted', ''), 'deltaSum': ('deltaSum', ''), 'groupBitAnd': ('groupBitAnd', ''), 'sumKahan': ('sumKahan', ''), 'kurtSamp': ('kurtSamp', ''), 'entropy': ('entropy', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'last_value': ('last_value', ''), 'quantileTDigest': ('quantileTDigest', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'sumCount': ('sumCount', ''), 'contingency': ('contingency', ''), 'quantileExact': ('quantileExact', ''), 'stddevPop': ('stddevPop', ''), 'sparkBar': ('sparkBar', ''), 'max': ('max', ''), 'covarPop': ('covarPop', ''), 'groupArrayLast': ('groupArrayLast', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'avg': ('avg', ''), 'quantile': ('quantile', ''), 'groupArraySample': ('groupArraySample', ''), 'quantileGK': ('quantileGK', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'sum': ('sum', ''), 'topK': ('topK', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'sequenceMatch': ('sequenceMatch', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'uniqUpTo': ('uniqUpTo', ''), 'argMin': ('argMin', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'uniqTheta': ('uniqTheta', ''), 'uniqExact': ('uniqExact', ''), 'quantileTiming': ('quantileTiming', ''), 'uniqCombined': ('uniqCombined', ''), 'groupBitOr': ('groupBitOr', ''), 'sequenceCount': ('sequenceCount', ''), 'groupArray': ('groupArray', ''), 'any': ('any', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'first_value': ('first_value', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'covarSamp': ('covarSamp', ''), 'groupBitmap': ('groupBitmap', ''), 'rankCorr': ('rankCorr', ''), 'meanZTest': ('meanZTest', ''), 'groupUniqArray': ('groupUniqArray', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'topKWeighted': ('topKWeighted', ''), 'count': ('count', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'theilsU': ('theilsU', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'groupBitXor': ('groupBitXor', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'skewPop': ('skewPop', ''), 'exponentialTimeDecayedAvg': ('exponentialTimeDecayedAvg', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'varSamp': ('varSamp', ''), 'cramersV': ('cramersV', ''), 'sequenceNextNode': ('sequenceNextNode', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'median': ('median', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'windowFunnel': ('windowFunnel', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'corr': ('corr', ''), 'retention': ('retention', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'TUPLE', 'STRUCT'}
FUNCTION_PARSERS = {'CAST': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'JSON_OBJECT': <function Parser.<lambda>>, 'JSON_OBJECTAGG': <function Parser.<lambda>>, 'JSON_TABLE': <function Parser.<lambda>>, 'OPENJSON': <function Parser.<lambda>>, 'POSITION': <function Parser.<lambda>>, 'PREDICT': <function Parser.<lambda>>, 'SAFE_CAST': <function Parser.<lambda>>, 'STRING_AGG': <function Parser.<lambda>>, 'SUBSTRING': <function Parser.<lambda>>, 'TRIM': <function Parser.<lambda>>, 'TRY_CAST': <function Parser.<lambda>>, 'TRY_CONVERT': <function Parser.<lambda>>, 'ARRAYJOIN': <function ClickHouse.Parser.<lambda>>, 'QUANTILE': <function ClickHouse.Parser.<lambda>>}
NO_PAREN_FUNCTION_PARSERS = {'CASE': <function Parser.<lambda>>, 'IF': <function Parser.<lambda>>, 'NEXT': <function Parser.<lambda>>}
RANGE_PARSERS = {<TokenType.BETWEEN: 'BETWEEN'>: <function Parser.<lambda>>, <TokenType.GLOB: 'GLOB'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.ILIKE: 'ILIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.IN: 'IN'>: <function Parser.<lambda>>, <TokenType.IRLIKE: 'IRLIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.IS: 'IS'>: <function Parser.<lambda>>, <TokenType.LIKE: 'LIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.OVERLAPS: 'OVERLAPS'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.RLIKE: 'RLIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.SIMILAR_TO: 'SIMILAR_TO'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.FOR: 'FOR'>: <function Parser.<lambda>>, <TokenType.GLOBAL: 'GLOBAL'>: <function ClickHouse.Parser.<lambda>>}
COLUMN_OPERATORS = {<TokenType.DOT: 'DOT'>: None, <TokenType.DCOLON: 'DCOLON'>: <function Parser.<lambda>>, <TokenType.ARROW: 'ARROW'>: <function Parser.<lambda>>, <TokenType.DARROW: 'DARROW'>: <function Parser.<lambda>>, <TokenType.HASH_ARROW: 'HASH_ARROW'>: <function Parser.<lambda>>, <TokenType.DHASH_ARROW: 'DHASH_ARROW'>: <function Parser.<lambda>>}
JOIN_KINDS = {<TokenType.ANTI: 'ANTI'>, <TokenType.ANY: 'ANY'>, <TokenType.ASOF: 'ASOF'>, <TokenType.INNER: 'INNER'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.OUTER: 'OUTER'>, <TokenType.SEMI: 'SEMI'>, <TokenType.CROSS: 'CROSS'>}
TABLE_ALIAS_TOKENS = {<TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INET: 'INET'>, <TokenType.MODEL: 'MODEL'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.JSONB: 'JSONB'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.SOME: 'SOME'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.BIT: 'BIT'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT256: 'INT256'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.INT: 'INT'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.XML: 'XML'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.MERGE: 'MERGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.DATE: 'DATE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.FIRST: 'FIRST'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.BINARY: 'BINARY'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TAG: 'TAG'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.SUPER: 'SUPER'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.UINT: 'UINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.DESC: 'DESC'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.VIEW: 'VIEW'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.JSON: 'JSON'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ROWS: 'ROWS'>, <TokenType.FALSE: 'FALSE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.ENUM: 'ENUM'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.CASE: 'CASE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.ALL: 'ALL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.USE: 'USE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.DELETE: 'DELETE'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.IS: 'IS'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.KILL: 'KILL'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.SET: 'SET'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.DIV: 'DIV'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TIME: 'TIME'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.CACHE: 'CACHE'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.IPV6: 'IPV6'>, <TokenType.COPY: 'COPY'>, <TokenType.NAME: 'NAME'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.TOP: 'TOP'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.LOAD: 'LOAD'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.MAP: 'MAP'>, <TokenType.RANGE: 'RANGE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.IPV4: 'IPV4'>, <TokenType.TEXT: 'TEXT'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.MONEY: 'MONEY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.VAR: 'VAR'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TRUE: 'TRUE'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.UUID: 'UUID'>, <TokenType.ROW: 'ROW'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.CHAR: 'CHAR'>, <TokenType.ASC: 'ASC'>, <TokenType.NULL: 'NULL'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.END: 'END'>, <TokenType.DATE32: 'DATE32'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UTINYINT: 'UTINYINT'>}
ALIAS_TOKENS = {<TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INET: 'INET'>, <TokenType.MODEL: 'MODEL'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.JSONB: 'JSONB'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.SOME: 'SOME'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.BIT: 'BIT'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.SEMI: 'SEMI'>, <TokenType.LEFT: 'LEFT'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT256: 'INT256'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.INT: 'INT'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.XML: 'XML'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.MERGE: 'MERGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.DATE: 'DATE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.FIRST: 'FIRST'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.BINARY: 'BINARY'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TAG: 'TAG'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.SHOW: 'SHOW'>, <TokenType.SUPER: 'SUPER'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.FULL: 'FULL'>, <TokenType.UINT: 'UINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.DESC: 'DESC'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.VIEW: 'VIEW'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.JSON: 'JSON'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ROWS: 'ROWS'>, <TokenType.FALSE: 'FALSE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.ENUM: 'ENUM'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.CASE: 'CASE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.ALL: 'ALL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.APPLY: 'APPLY'>, <TokenType.USE: 'USE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.DELETE: 'DELETE'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.IS: 'IS'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.ASOF: 'ASOF'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.KILL: 'KILL'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.SET: 'SET'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.FINAL: 'FINAL'>, <TokenType.DIV: 'DIV'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TIME: 'TIME'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.CACHE: 'CACHE'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.IPV6: 'IPV6'>, <TokenType.COPY: 'COPY'>, <TokenType.NAME: 'NAME'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.TOP: 'TOP'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.LOAD: 'LOAD'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.ANY: 'ANY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.UINT256: 'UINT256'>, <TokenType.MAP: 'MAP'>, <TokenType.RANGE: 'RANGE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.IPV4: 'IPV4'>, <TokenType.TEXT: 'TEXT'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.MONEY: 'MONEY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.VAR: 'VAR'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TRUE: 'TRUE'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.UUID: 'UUID'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.ROW: 'ROW'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.CHAR: 'CHAR'>, <TokenType.ASC: 'ASC'>, <TokenType.ANTI: 'ANTI'>, <TokenType.NULL: 'NULL'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.END: 'END'>, <TokenType.DATE32: 'DATE32'>, <TokenType.NEXT: 'NEXT'>, <TokenType.ESCAPE: 'ESCAPE'>}
LOG_DEFAULTS_TO_LN = True
QUERY_MODIFIER_PARSERS = {<TokenType.MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'>: <function Parser.<lambda>>, <TokenType.PREWHERE: 'PREWHERE'>: <function Parser.<lambda>>, <TokenType.WHERE: 'WHERE'>: <function Parser.<lambda>>, <TokenType.GROUP_BY: 'GROUP_BY'>: <function Parser.<lambda>>, <TokenType.HAVING: 'HAVING'>: <function Parser.<lambda>>, <TokenType.QUALIFY: 'QUALIFY'>: <function Parser.<lambda>>, <TokenType.WINDOW: 'WINDOW'>: <function Parser.<lambda>>, <TokenType.ORDER_BY: 'ORDER_BY'>: <function Parser.<lambda>>, <TokenType.LIMIT: 'LIMIT'>: <function Parser.<lambda>>, <TokenType.FETCH: 'FETCH'>: <function Parser.<lambda>>, <TokenType.OFFSET: 'OFFSET'>: <function Parser.<lambda>>, <TokenType.FOR: 'FOR'>: <function Parser.<lambda>>, <TokenType.LOCK: 'LOCK'>: <function Parser.<lambda>>, <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>: <function Parser.<lambda>>, <TokenType.USING: 'USING'>: <function Parser.<lambda>>, <TokenType.CLUSTER_BY: 'CLUSTER_BY'>: <function Parser.<lambda>>, <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>: <function Parser.<lambda>>, <TokenType.SORT_BY: 'SORT_BY'>: <function Parser.<lambda>>, <TokenType.CONNECT_BY: 'CONNECT_BY'>: <function Parser.<lambda>>, <TokenType.START_WITH: 'START_WITH'>: <function Parser.<lambda>>, <TokenType.SETTINGS: 'SETTINGS'>: <function ClickHouse.Parser.<lambda>>, <TokenType.FORMAT: 'FORMAT'>: <function ClickHouse.Parser.<lambda>>}
CONSTRAINT_PARSERS = {'AUTOINCREMENT': <function Parser.<lambda>>, 'AUTO_INCREMENT': <function Parser.<lambda>>, 'CASESPECIFIC': <function Parser.<lambda>>, 'CHARACTER SET': <function Parser.<lambda>>, 'CHECK': <function Parser.<lambda>>, 'COLLATE': <function Parser.<lambda>>, 'COMMENT': <function Parser.<lambda>>, 'COMPRESS': <function Parser.<lambda>>, 'CLUSTERED': <function Parser.<lambda>>, 'NONCLUSTERED': <function Parser.<lambda>>, 'DEFAULT': <function Parser.<lambda>>, 'ENCODE': <function Parser.<lambda>>, 'EPHEMERAL': <function Parser.<lambda>>, 'EXCLUDE': <function Parser.<lambda>>, 'FOREIGN KEY': <function Parser.<lambda>>, 'FORMAT': <function Parser.<lambda>>, 'GENERATED': <function Parser.<lambda>>, 'IDENTITY': <function Parser.<lambda>>, 'INLINE': <function Parser.<lambda>>, 'LIKE': <function Parser.<lambda>>, 'NOT': <function Parser.<lambda>>, 'NULL': <function Parser.<lambda>>, 'ON': <function Parser.<lambda>>, 'PATH': <function Parser.<lambda>>, 'PERIOD': <function Parser.<lambda>>, 'PRIMARY KEY': <function Parser.<lambda>>, 'REFERENCES': <function Parser.<lambda>>, 'TITLE': <function Parser.<lambda>>, 'TTL': <function Parser.<lambda>>, 'UNIQUE': <function Parser.<lambda>>, 'UPPERCASE': <function Parser.<lambda>>, 'WITH': <function Parser.<lambda>>, 'INDEX': <function ClickHouse.Parser.<lambda>>, 'CODEC': <function ClickHouse.Parser.<lambda>>}
ALTER_PARSERS = {'ADD': <function Parser.<lambda>>, 'ALTER': <function Parser.<lambda>>, 'CLUSTER BY': <function Parser.<lambda>>, 'DELETE': <function Parser.<lambda>>, 'DROP': <function Parser.<lambda>>, 'RENAME': <function Parser.<lambda>>, 'REPLACE': <function ClickHouse.Parser.<lambda>>}
SCHEMA_UNNAMED_CONSTRAINTS = {'EXCLUDE', 'INDEX', 'PERIOD', 'FOREIGN KEY', 'LIKE', 'CHECK', 'PRIMARY KEY', 'UNIQUE'}
SHOW_TRIE: Dict = {}
SET_TRIE: Dict = {'GLOBAL': {0: True}, 'LOCAL': {0: True}, 'SESSION': {0: True}, 'TRANSACTION': {0: True}}

##### Inherited Members

sqlglot.parser.Parser
  Parser
  NO_PAREN_FUNCTIONS
  STRUCT_TYPE_TOKENS
  NESTED_TYPE_TOKENS
  ENUM_TYPE_TOKENS
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  RESERVED_TOKENS
  DB_CREATABLES
  CREATABLES
  ID_VAR_TOKENS
  INTERVAL_VARS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  CONJUNCTION
  EQUALITY
  COMPARISON
  BITWISE
  TERM
  FACTOR
  EXPONENT
  TIMES
  TIMESTAMPS
  SET_OPERATIONS
  JOIN_METHODS
  JOIN_SIDES
  JOIN_HINTS
  LAMBDAS
  EXPRESSION_PARSERS
  STATEMENT_PARSERS
  UNARY_PARSERS
  STRING_PARSERS
  NUMERIC_PARSERS
  PRIMARY_PARSERS
  PLACEHOLDER_PARSERS
  PROPERTY_PARSERS
  ALTER_ALTER_PARSERS
  INVALID_FUNC_NAME_TOKENS
  KEY_VALUE_DEFINITIONS
  SET_PARSERS
  SHOW_PARSERS
  TYPE_LITERAL_PARSERS
  TYPE_CONVERTER
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  CONFLICT_ACTIONS
  CREATE_SEQUENCE
  ISOLATED_LOADING_OPTIONS
  USABLES
  CAST_ACTIONS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  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
  STRICT_CAST
  PREFIXED_PIVOT_COLUMNS
  IDENTIFY_PIVOT_STRINGS
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
  TABLESAMPLE_CSV
  DEFAULT_SAMPLING_METHOD
  SET_REQUIRES_ASSIGNMENT_DELIMITER
  TRIM_PATTERN_FIRST
  STRING_ALIASES
  UNION_MODIFIERS
  NO_PAREN_IF_COMMANDS
  JSON_ARROWS_REQUIRE_JSON_TYPE
  VALUES_FOLLOWED_BY_PAREN
  SUPPORTS_IMPLICIT_UNNEST
  SUPPORTS_PARTITION_SELECTION
  error_level
  error_message_context
  max_errors
  dialect
  reset
  parse
  parse_into
  check_errors
  raise_error
  expression
  validate_expression
  errors
  sql

class ClickHouse.Generator(sqlglot.generator.Generator): View Source

    650    class Generator(generator.Generator):
    651        QUERY_HINTS = False
    652        STRUCT_DELIMITER = ("(", ")")
    653        NVL2_SUPPORTED = False
    654        TABLESAMPLE_REQUIRES_PARENS = False
    655        TABLESAMPLE_SIZE_IS_ROWS = False
    656        TABLESAMPLE_KEYWORDS = "SAMPLE"
    657        LAST_DAY_SUPPORTS_DATE_PART = False
    658        CAN_IMPLEMENT_ARRAY_ANY = True
    659        SUPPORTS_TO_NUMBER = False
    660
    661        STRING_TYPE_MAPPING = {
    662            exp.DataType.Type.CHAR: "String",
    663            exp.DataType.Type.LONGBLOB: "String",
    664            exp.DataType.Type.LONGTEXT: "String",
    665            exp.DataType.Type.MEDIUMBLOB: "String",
    666            exp.DataType.Type.MEDIUMTEXT: "String",
    667            exp.DataType.Type.TINYBLOB: "String",
    668            exp.DataType.Type.TINYTEXT: "String",
    669            exp.DataType.Type.TEXT: "String",
    670            exp.DataType.Type.VARBINARY: "String",
    671            exp.DataType.Type.VARCHAR: "String",
    672        }
    673
    674        SUPPORTED_JSON_PATH_PARTS = {
    675            exp.JSONPathKey,
    676            exp.JSONPathRoot,
    677            exp.JSONPathSubscript,
    678        }
    679
    680        TYPE_MAPPING = {
    681            **generator.Generator.TYPE_MAPPING,
    682            **STRING_TYPE_MAPPING,
    683            exp.DataType.Type.ARRAY: "Array",
    684            exp.DataType.Type.BIGINT: "Int64",
    685            exp.DataType.Type.DATE32: "Date32",
    686            exp.DataType.Type.DATETIME64: "DateTime64",
    687            exp.DataType.Type.DOUBLE: "Float64",
    688            exp.DataType.Type.ENUM: "Enum",
    689            exp.DataType.Type.ENUM8: "Enum8",
    690            exp.DataType.Type.ENUM16: "Enum16",
    691            exp.DataType.Type.FIXEDSTRING: "FixedString",
    692            exp.DataType.Type.FLOAT: "Float32",
    693            exp.DataType.Type.INT: "Int32",
    694            exp.DataType.Type.MEDIUMINT: "Int32",
    695            exp.DataType.Type.INT128: "Int128",
    696            exp.DataType.Type.INT256: "Int256",
    697            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    698            exp.DataType.Type.MAP: "Map",
    699            exp.DataType.Type.NESTED: "Nested",
    700            exp.DataType.Type.NULLABLE: "Nullable",
    701            exp.DataType.Type.SMALLINT: "Int16",
    702            exp.DataType.Type.STRUCT: "Tuple",
    703            exp.DataType.Type.TINYINT: "Int8",
    704            exp.DataType.Type.UBIGINT: "UInt64",
    705            exp.DataType.Type.UINT: "UInt32",
    706            exp.DataType.Type.UINT128: "UInt128",
    707            exp.DataType.Type.UINT256: "UInt256",
    708            exp.DataType.Type.USMALLINT: "UInt16",
    709            exp.DataType.Type.UTINYINT: "UInt8",
    710            exp.DataType.Type.IPV4: "IPv4",
    711            exp.DataType.Type.IPV6: "IPv6",
    712            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    713            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    714        }
    715
    716        TRANSFORMS = {
    717            **generator.Generator.TRANSFORMS,
    718            exp.AnyValue: rename_func("any"),
    719            exp.ApproxDistinct: rename_func("uniq"),
    720            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    721            exp.ArraySize: rename_func("LENGTH"),
    722            exp.ArraySum: rename_func("arraySum"),
    723            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    724            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    725            exp.Array: inline_array_sql,
    726            exp.CastToStrType: rename_func("CAST"),
    727            exp.CountIf: rename_func("countIf"),
    728            exp.CompressColumnConstraint: lambda self,
    729            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    730            exp.ComputedColumnConstraint: lambda self,
    731            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    732            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    733            exp.DateAdd: date_delta_sql("DATE_ADD"),
    734            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    735            exp.Explode: rename_func("arrayJoin"),
    736            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    737            exp.IsNan: rename_func("isNaN"),
    738            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    739            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    740            exp.JSONPathKey: json_path_key_only_name,
    741            exp.JSONPathRoot: lambda *_: "",
    742            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    743            exp.Nullif: rename_func("nullIf"),
    744            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    745            exp.Pivot: no_pivot_sql,
    746            exp.Quantile: _quantile_sql,
    747            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    748            exp.Rand: rename_func("randCanonical"),
    749            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    750            exp.StartsWith: rename_func("startsWith"),
    751            exp.StrPosition: lambda self, e: self.func(
    752                "position", e.this, e.args.get("substr"), e.args.get("position")
    753            ),
    754            exp.TimeToStr: lambda self, e: self.func(
    755                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    756            ),
    757            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    758            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    759            exp.MD5Digest: rename_func("MD5"),
    760            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
    761            exp.SHA: rename_func("SHA1"),
    762            exp.SHA2: lambda self, e: self.func(
    763                "SHA256" if e.text("length") == "256" else "SHA512", e.this
    764            ),
    765            exp.UnixToTime: _unix_to_time_sql,
    766            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
    767            exp.Variance: rename_func("varSamp"),
    768            exp.Stddev: rename_func("stddevSamp"),
    769        }
    770
    771        PROPERTIES_LOCATION = {
    772            **generator.Generator.PROPERTIES_LOCATION,
    773            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    774            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    775            exp.OnCluster: exp.Properties.Location.POST_NAME,
    776        }
    777
    778        JOIN_HINTS = False
    779        TABLE_HINTS = False
    780        EXPLICIT_UNION = True
    781        GROUPINGS_SEP = ""
    782        OUTER_UNION_MODIFIERS = False
    783
    784        # there's no list in docs, but it can be found in Clickhouse code
    785        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    786        ON_CLUSTER_TARGETS = {
    787            "DATABASE",
    788            "TABLE",
    789            "VIEW",
    790            "DICTIONARY",
    791            "INDEX",
    792            "FUNCTION",
    793            "NAMED COLLECTION",
    794        }
    795
    796        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    797            this = self.json_path_part(expression.this)
    798            return str(int(this) + 1) if is_int(this) else this
    799
    800        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    801            return f"AS {self.sql(expression, 'this')}"
    802
    803        def _any_to_has(
    804            self,
    805            expression: exp.EQ | exp.NEQ,
    806            default: t.Callable[[t.Any], str],
    807            prefix: str = "",
    808        ) -> str:
    809            if isinstance(expression.left, exp.Any):
    810                arr = expression.left
    811                this = expression.right
    812            elif isinstance(expression.right, exp.Any):
    813                arr = expression.right
    814                this = expression.left
    815            else:
    816                return default(expression)
    817
    818            return prefix + self.func("has", arr.this.unnest(), this)
    819
    820        def eq_sql(self, expression: exp.EQ) -> str:
    821            return self._any_to_has(expression, super().eq_sql)
    822
    823        def neq_sql(self, expression: exp.NEQ) -> str:
    824            return self._any_to_has(expression, super().neq_sql, "NOT ")
    825
    826        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    827            # Manually add a flag to make the search case-insensitive
    828            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    829            return self.func("match", expression.this, regex)
    830
    831        def datatype_sql(self, expression: exp.DataType) -> str:
    832            # String is the standard ClickHouse type, every other variant is just an alias.
    833            # Additionally, any supplied length parameter will be ignored.
    834            #
    835            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    836            if expression.this in self.STRING_TYPE_MAPPING:
    837                return "String"
    838
    839            return super().datatype_sql(expression)
    840
    841        def cte_sql(self, expression: exp.CTE) -> str:
    842            if expression.args.get("scalar"):
    843                this = self.sql(expression, "this")
    844                alias = self.sql(expression, "alias")
    845                return f"{this} AS {alias}"
    846
    847            return super().cte_sql(expression)
    848
    849        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    850            return super().after_limit_modifiers(expression) + [
    851                (
    852                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    853                    if expression.args.get("settings")
    854                    else ""
    855                ),
    856                (
    857                    self.seg("FORMAT ") + self.sql(expression, "format")
    858                    if expression.args.get("format")
    859                    else ""
    860                ),
    861            ]
    862
    863        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    864            params = self.expressions(expression, key="params", flat=True)
    865            return self.func(expression.name, *expression.expressions) + f"({params})"
    866
    867        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    868            return self.func(expression.name, *expression.expressions)
    869
    870        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    871            return self.anonymousaggfunc_sql(expression)
    872
    873        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    874            return self.parameterizedagg_sql(expression)
    875
    876        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    877            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    878
    879        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    880            return f"ON CLUSTER {self.sql(expression, 'this')}"
    881
    882        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    883            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    884                exp.Properties.Location.POST_NAME
    885            ):
    886                this_name = self.sql(expression.this, "this")
    887                this_properties = " ".join(
    888                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    889                )
    890                this_schema = self.schema_columns_sql(expression.this)
    891                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    892
    893            return super().createable_sql(expression, locations)
    894
    895        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    896            this = self.indent(self.sql(expression, "this"))
    897            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    898
    899        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    900            this = self.sql(expression, "this")
    901            this = f" {this}" if this else ""
    902            expr = self.sql(expression, "expression")
    903            expr = f" {expr}" if expr else ""
    904            index_type = self.sql(expression, "index_type")
    905            index_type = f" TYPE {index_type}" if index_type else ""
    906            granularity = self.sql(expression, "granularity")
    907            granularity = f" GRANULARITY {granularity}" if granularity else ""
    908
    909            return f"INDEX{this}{expr}{index_type}{granularity}"
    910
    911        def partition_sql(self, expression: exp.Partition) -> str:
    912            return f"PARTITION {self.expressions(expression, flat=True)}"
    913
    914        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    915            return f"ID {self.sql(expression.this)}"
    916
    917        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    918            return (
    919                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    920            )
    921
    922        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    923            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"

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 `WHERE` clause. 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

QUERY_HINTS = False
STRUCT_DELIMITER = ('(', ')')
NVL2_SUPPORTED = False
TABLESAMPLE_REQUIRES_PARENS = False
TABLESAMPLE_SIZE_IS_ROWS = False
TABLESAMPLE_KEYWORDS = 'SAMPLE'
LAST_DAY_SUPPORTS_DATE_PART = False
CAN_IMPLEMENT_ARRAY_ANY = True
SUPPORTS_TO_NUMBER = False
STRING_TYPE_MAPPING = {<Type.CHAR: 'CHAR'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String'}
SUPPORTED_JSON_PATH_PARTS = {<class 'sqlglot.expressions.JSONPathRoot'>, <class 'sqlglot.expressions.JSONPathSubscript'>, <class 'sqlglot.expressions.JSONPathKey'>}
TYPE_MAPPING = {<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.INET: 'INET'>: 'INET', <Type.ROWVERSION: 'ROWVERSION'>: 'VARBINARY', <Type.CHAR: 'CHAR'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String', <Type.ARRAY: 'ARRAY'>: 'Array', <Type.BIGINT: 'BIGINT'>: 'Int64', <Type.DATE32: 'DATE32'>: 'Date32', <Type.DATETIME64: 'DATETIME64'>: 'DateTime64', <Type.DOUBLE: 'DOUBLE'>: 'Float64', <Type.ENUM: 'ENUM'>: 'Enum', <Type.ENUM8: 'ENUM8'>: 'Enum8', <Type.ENUM16: 'ENUM16'>: 'Enum16', <Type.FIXEDSTRING: 'FIXEDSTRING'>: 'FixedString', <Type.FLOAT: 'FLOAT'>: 'Float32', <Type.INT: 'INT'>: 'Int32', <Type.MEDIUMINT: 'MEDIUMINT'>: 'Int32', <Type.INT128: 'INT128'>: 'Int128', <Type.INT256: 'INT256'>: 'Int256', <Type.LOWCARDINALITY: 'LOWCARDINALITY'>: 'LowCardinality', <Type.MAP: 'MAP'>: 'Map', <Type.NESTED: 'NESTED'>: 'Nested', <Type.NULLABLE: 'NULLABLE'>: 'Nullable', <Type.SMALLINT: 'SMALLINT'>: 'Int16', <Type.STRUCT: 'STRUCT'>: 'Tuple', <Type.TINYINT: 'TINYINT'>: 'Int8', <Type.UBIGINT: 'UBIGINT'>: 'UInt64', <Type.UINT: 'UINT'>: 'UInt32', <Type.UINT128: 'UINT128'>: 'UInt128', <Type.UINT256: 'UINT256'>: 'UInt256', <Type.USMALLINT: 'USMALLINT'>: 'UInt16', <Type.UTINYINT: 'UTINYINT'>: 'UInt8', <Type.IPV4: 'IPV4'>: 'IPv4', <Type.IPV6: 'IPV6'>: 'IPv6', <Type.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>: 'AggregateFunction', <Type.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>: 'SimpleAggregateFunction'}
TRANSFORMS = {<class 'sqlglot.expressions.JSONPathKey'>: <function json_path_key_only_name>, <class 'sqlglot.expressions.JSONPathRoot'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.AllowedValuesProperty'>: <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.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.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DateFormatColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DefaultColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EncodeColumnConstraint'>: <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.ExternalProperty'>: <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.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.JSONExtract'>: <function json_extract_segments.<locals>._json_extract_segments>, <class 'sqlglot.expressions.JSONExtractScalar'>: <function json_extract_segments.<locals>._json_extract_segments>, <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.OutputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PathColumnConstraint'>: <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.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.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Timestamp'>: <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.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UnloggedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VarMap'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.ViewAttributeProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithOperator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AnyValue'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ApproxDistinct'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArrayFilter'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.ArraySize'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArraySum'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArgMax'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.ArgMin'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.Array'>: <function inline_array_sql>, <class 'sqlglot.expressions.CastToStrType'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CountIf'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CompressColumnConstraint'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.ComputedColumnConstraint'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.CurrentDate'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.DateAdd'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.DateDiff'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.Explode'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Final'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.IsNan'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Map'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Nullif'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.PartitionedByProperty'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Pivot'>: <function no_pivot_sql>, <class 'sqlglot.expressions.Quantile'>: <function _quantile_sql>, <class 'sqlglot.expressions.RegexpLike'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Rand'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.StartsWith'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.StrPosition'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.TimeToStr'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Xor'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.MD5Digest'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.MD5'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.SHA'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.SHA2'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.UnixToTime'>: <function _unix_to_time_sql>, <class 'sqlglot.expressions.TimestampTrunc'>: <function timestamptrunc_sql.<locals>._timestamptrunc_sql>, <class 'sqlglot.expressions.Variance'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Stddev'>: <function rename_func.<locals>.<lambda>>}
PROPERTIES_LOCATION = {<class 'sqlglot.expressions.AllowedValuesProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AlgorithmProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.AutoIncrementProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BackupProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BlockCompressionProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CharacterSetProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ChecksumProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CollateProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Cluster'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ClusteredByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DataBlocksizeProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.DefinerProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.DictRange'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DictProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistStyleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.EngineProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExternalProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.FallbackProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.FileFormatProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.FreespaceProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.GlobalProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.HeapProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.InheritsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.IcebergProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.InputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.IsolatedLoadingProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.JournalProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.LanguageProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LikeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LocationProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LockProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LockingProperty'>: <Location.POST_ALIAS: 'POST_ALIAS'>, <class 'sqlglot.expressions.LogProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.MaterializedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.MergeBlockRatioProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.OnProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCommitProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.Order'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OutputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedOfProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PrimaryKey'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Property'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ReturnsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatDelimitedProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatSerdeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SampleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SchemaCommentProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SerdeProperties'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Set'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SettingsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SetProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.SetConfigProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SharingProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SequenceProperties'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SortKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.StabilityProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TemporaryProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ToTableProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TransientProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.TransformModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.MergeTreeTTL'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.UnloggedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ViewAttributeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.VolatileProperty'>: <Location.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.WithDataProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.WithSystemVersioningProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCluster'>: <Location.POST_NAME: 'POST_NAME'>}
JOIN_HINTS = False
TABLE_HINTS = False
EXPLICIT_UNION = True
GROUPINGS_SEP = ''
OUTER_UNION_MODIFIERS = False
ON_CLUSTER_TARGETS = {'TABLE', 'NAMED COLLECTION', 'DICTIONARY', 'INDEX', 'VIEW', 'DATABASE', 'FUNCTION'}
def likeproperty_sql(self, expression: sqlglot.expressions.LikeProperty) -> str: View Source

    800        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    801            return f"AS {self.sql(expression, 'this')}"

def eq_sql(self, expression: sqlglot.expressions.EQ) -> str: View Source

    820        def eq_sql(self, expression: exp.EQ) -> str:
    821            return self._any_to_has(expression, super().eq_sql)

def neq_sql(self, expression: sqlglot.expressions.NEQ) -> str: View Source

    823        def neq_sql(self, expression: exp.NEQ) -> str:
    824            return self._any_to_has(expression, super().neq_sql, "NOT ")

def regexpilike_sql(self, expression: sqlglot.expressions.RegexpILike) -> str: View Source

    826        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    827            # Manually add a flag to make the search case-insensitive
    828            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    829            return self.func("match", expression.this, regex)

def datatype_sql(self, expression: sqlglot.expressions.DataType) -> str: View Source

    831        def datatype_sql(self, expression: exp.DataType) -> str:
    832            # String is the standard ClickHouse type, every other variant is just an alias.
    833            # Additionally, any supplied length parameter will be ignored.
    834            #
    835            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    836            if expression.this in self.STRING_TYPE_MAPPING:
    837                return "String"
    838
    839            return super().datatype_sql(expression)

def cte_sql(self, expression: sqlglot.expressions.CTE) -> str: View Source

    841        def cte_sql(self, expression: exp.CTE) -> str:
    842            if expression.args.get("scalar"):
    843                this = self.sql(expression, "this")
    844                alias = self.sql(expression, "alias")
    845                return f"{this} AS {alias}"
    846
    847            return super().cte_sql(expression)

def after_limit_modifiers(self, expression: sqlglot.expressions.Expression) -> List[str]: View Source

    849        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    850            return super().after_limit_modifiers(expression) + [
    851                (
    852                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    853                    if expression.args.get("settings")
    854                    else ""
    855                ),
    856                (
    857                    self.seg("FORMAT ") + self.sql(expression, "format")
    858                    if expression.args.get("format")
    859                    else ""
    860                ),
    861            ]

def parameterizedagg_sql(self, expression: sqlglot.expressions.ParameterizedAgg) -> str: View Source

    863        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    864            params = self.expressions(expression, key="params", flat=True)
    865            return self.func(expression.name, *expression.expressions) + f"({params})"

def anonymousaggfunc_sql(self, expression: sqlglot.expressions.AnonymousAggFunc) -> str: View Source

    867        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    868            return self.func(expression.name, *expression.expressions)

def combinedaggfunc_sql(self, expression: sqlglot.expressions.CombinedAggFunc) -> str: View Source

    870        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    871            return self.anonymousaggfunc_sql(expression)

def combinedparameterizedagg_sql(self, expression: sqlglot.expressions.CombinedParameterizedAgg) -> str: View Source

    873        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    874            return self.parameterizedagg_sql(expression)

def placeholder_sql(self, expression: sqlglot.expressions.Placeholder) -> str: View Source

    876        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    877            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"

def oncluster_sql(self, expression: sqlglot.expressions.OnCluster) -> str: View Source

    879        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    880            return f"ON CLUSTER {self.sql(expression, 'this')}"

def createable_sql( self, expression: sqlglot.expressions.Create, locations: DefaultDict) -> str: View Source

    882        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    883            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    884                exp.Properties.Location.POST_NAME
    885            ):
    886                this_name = self.sql(expression.this, "this")
    887                this_properties = " ".join(
    888                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    889                )
    890                this_schema = self.schema_columns_sql(expression.this)
    891                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    892
    893            return super().createable_sql(expression, locations)

def prewhere_sql(self, expression: sqlglot.expressions.PreWhere) -> str: View Source

    895        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    896            this = self.indent(self.sql(expression, "this"))
    897            return f"{self.seg('PREWHERE')}{self.sep()}{this}"

def indexcolumnconstraint_sql(self, expression: sqlglot.expressions.IndexColumnConstraint) -> str: View Source

    899        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    900            this = self.sql(expression, "this")
    901            this = f" {this}" if this else ""
    902            expr = self.sql(expression, "expression")
    903            expr = f" {expr}" if expr else ""
    904            index_type = self.sql(expression, "index_type")
    905            index_type = f" TYPE {index_type}" if index_type else ""
    906            granularity = self.sql(expression, "granularity")
    907            granularity = f" GRANULARITY {granularity}" if granularity else ""
    908
    909            return f"INDEX{this}{expr}{index_type}{granularity}"

def partition_sql(self, expression: sqlglot.expressions.Partition) -> str: View Source

    911        def partition_sql(self, expression: exp.Partition) -> str:
    912            return f"PARTITION {self.expressions(expression, flat=True)}"

def partitionid_sql(self, expression: sqlglot.expressions.PartitionId) -> str: View Source

    914        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    915            return f"ID {self.sql(expression.this)}"

def replacepartition_sql(self, expression: sqlglot.expressions.ReplacePartition) -> str: View Source

    917        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    918            return (
    919                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    920            )

def projectiondef_sql(self, expression: sqlglot.expressions.ProjectionDef) -> str: View Source

    922        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    923            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"

SELECT_KINDS: Tuple[str, ...] = ()
TRY_SUPPORTED = False
AFTER_HAVING_MODIFIER_TRANSFORMS = {'qualify': <function Generator.<lambda>>, 'windows': <function Generator.<lambda>>}

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  IGNORE_NULLS_IN_FUNC
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  COLUMN_JOIN_MARKS_SUPPORTED
  EXTRACT_ALLOWS_QUOTES
  TZ_TO_WITH_TIME_ZONE
  VALUES_AS_TABLE
  ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
  UNNEST_WITH_ORDINALITY
  AGGREGATE_FILTER_SUPPORTED
  SEMI_ANTI_JOIN_WITH_SIDE
  COMPUTED_COLUMN_WITH_TYPE
  SUPPORTS_TABLE_COPY
  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
  JSON_KEY_VALUE_PAIR_SEP
  INSERT_OVERWRITE
  SUPPORTS_SELECT_INTO
  SUPPORTS_UNLOGGED_TABLES
  SUPPORTS_CREATE_TABLE_LIKE
  LIKE_PROPERTY_INSIDE_SCHEMA
  MULTI_ARG_DISTINCT
  JSON_TYPE_REQUIRED_FOR_EXTRACTION
  JSON_PATH_BRACKETED_KEY_SUPPORTED
  JSON_PATH_SINGLE_QUOTE_ESCAPE
  COPY_PARAMS_ARE_WRAPPED
  COPY_PARAMS_EQ_REQUIRED
  COPY_HAS_INTO_KEYWORD
  STAR_EXCEPT
  HEX_FUNC
  TIME_PART_SINGULARS
  TOKEN_MAPPING
  PARAMETER_TOKEN
  NAMED_PLACEHOLDER_TOKEN
  RESERVED_KEYWORDS
  WITH_SEPARATED_COMMENTS
  EXCLUDE_COMMENTS
  UNWRAPPED_INTERVAL_VALUES
  PARAMETERIZABLE_TEXT_TYPES
  EXPRESSIONS_WITHOUT_NESTED_CTES
  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
  pad_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
  computedcolumnconstraint_sql
  autoincrementcolumnconstraint_sql
  compresscolumnconstraint_sql
  generatedasidentitycolumnconstraint_sql
  generatedasrowcolumnconstraint_sql
  periodforsystemtimeconstraint_sql
  notnullcolumnconstraint_sql
  transformcolumnconstraint_sql
  primarykeycolumnconstraint_sql
  uniquecolumnconstraint_sql
  create_sql
  sequenceproperties_sql
  clone_sql
  describe_sql
  heredoc_sql
  prepend_ctes
  with_sql
  tablealias_sql
  bitstring_sql
  hexstring_sql
  bytestring_sql
  unicodestring_sql
  rawstring_sql
  datatypeparam_sql
  directory_sql
  delete_sql
  drop_sql
  except_sql
  except_op
  fetch_sql
  filter_sql
  hint_sql
  indexparameters_sql
  index_sql
  identifier_sql
  hex_sql
  lowerhex_sql
  inputoutputformat_sql
  national_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_name
  property_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
  intersect_sql
  intersect_op
  introducer_sql
  kill_sql
  pseudotype_sql
  objectidentifier_sql
  onconflict_sql
  returning_sql
  rowformatdelimitedproperty_sql
  withtablehint_sql
  indextablehint_sql
  historicaldata_sql
  table_parts
  table_sql
  tablesample_sql
  pivot_sql
  version_sql
  tuple_sql
  update_sql
  values_sql
  var_sql
  into_sql
  from_sql
  group_sql
  having_sql
  connect_sql
  prior_sql
  join_sql
  lambda_sql
  lateral_op
  lateral_sql
  limit_sql
  offset_sql
  setitem_sql
  set_sql
  pragma_sql
  lock_sql
  literal_sql
  escape_str
  loaddata_sql
  null_sql
  boolean_sql
  order_sql
  withfill_sql
  cluster_sql
  distribute_sql
  sort_sql
  ordered_sql
  matchrecognizemeasure_sql
  matchrecognize_sql
  query_modifiers
  queryoption_sql
  offset_limit_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  subquery_sql
  qualify_sql
  set_operations
  union_sql
  union_op
  unnest_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
  extract_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
  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
  attimezone_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
  cast_sql
  currentdate_sql
  currenttimestamp_sql
  collate_sql
  command_sql
  comment_sql
  mergetreettlaction_sql
  mergetreettl_sql
  transaction_sql
  commit_sql
  rollback_sql
  altercolumn_sql
  alterdiststyle_sql
  altersortkey_sql
  renametable_sql
  renamecolumn_sql
  altertable_sql
  add_column_sql
  droppartition_sql
  addconstraint_sql
  distinct_sql
  ignorenulls_sql
  respectnulls_sql
  havingmax_sql
  intdiv_sql
  dpipe_sql
  div_sql
  overlaps_sql
  distance_sql
  dot_sql
  propertyeq_sql
  escape_sql
  glob_sql
  gt_sql
  gte_sql
  ilike_sql
  ilikeany_sql
  is_sql
  like_sql
  likeany_sql
  similarto_sql
  lt_sql
  lte_sql
  mod_sql
  mul_sql
  nullsafeeq_sql
  nullsafeneq_sql
  slice_sql
  sub_sql
  trycast_sql
  try_sql
  log_sql
  use_sql
  binary
  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
  merge_sql
  tochar_sql
  tonumber_sql
  dictproperty_sql
  dictrange_sql
  dictsubproperty_sql
  clusteredbyproperty_sql
  anyvalue_sql
  querytransform_sql
  indexconstraintoption_sql
  checkcolumnconstraint_sql
  nvl2_sql
  comprehension_sql
  columnprefix_sql
  opclass_sql
  predict_sql
  forin_sql
  refresh_sql
  operator_sql
  toarray_sql
  tsordstotime_sql
  tsordstotimestamp_sql
  tsordstodate_sql
  unixdate_sql
  lastday_sql
  dateadd_sql
  arrayany_sql
  generateseries_sql
  struct_sql
  partitionrange_sql
  truncatetable_sql
  convert_sql
  copyparameter_sql
  credentials_sql
  copy_sql
  semicolon_sql