sqlglot.dialects.clickhouse API documentation

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

DATEΤΙΜΕ_DELTA = typing.Union[sqlglot.expressions.DateAdd, sqlglot.expressions.DateDiff, sqlglot.expressions.DateSub, sqlglot.expressions.TimestampSub, sqlglot.expressions.TimestampAdd]
class ClickHouse(sqlglot.dialects.dialect.Dialect): View Source

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

FORCE_EARLY_ALIAS_REF_EXPANSION = True

Whether alias reference expansion (_expand_alias_refs()) should run before column qualification (_qualify_columns()).

###### For example:

> WITH data AS ( SELECT 1 AS id, 2 AS my_id ) SELECT id AS my_id FROM data WHERE my_id = 1 GROUP BY my_id, HAVING my_id = 1

In most dialects "my_id" would refer to "data.my_id" (which is done in _qualify_columns()) across the query, except: - BigQuery, which will forward the alias to GROUP BY + HAVING clauses i.e it resolves to "WHERE my_id = 1 GROUP BY id HAVING id = 1" - Clickhouse, which will forward the alias across the query i.e it resolves to "WHERE id = 1 GROUP BY id HAVING id = 1"

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 (`` ).

SUPPORTS_COLUMN_JOIN_MARKS = False

Whether the old-style outer join (+) syntax is supported.

tokenizer_class = <class 'ClickHouse.Tokenizer'>
jsonpath_tokenizer_class = <class 'sqlglot.tokens.JSONPathTokenizer'>
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 = {}
INVERSE_FORMAT_MAPPING: Dict[str, str] = {}
INVERSE_FORMAT_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
  COPY_PARAMS_ARE_CSV
  TYPED_DIVISION
  CONCAT_COALESCE
  HEX_LOWERCASE
  DATE_FORMAT
  DATEINT_FORMAT
  TIME_FORMAT
  TIME_MAPPING
  FORMAT_MAPPING
  PSEUDOCOLUMNS
  PREFER_CTE_ALIAS_COLUMN
  EXPAND_ALIAS_REFS_EARLY_ONLY_IN_GROUP_BY
  SUPPORTS_ORDER_BY_ALL
  DATE_PART_MAPPING
  TYPE_TO_EXPRESSIONS
  ANNOTATORS
  get_or_raise
  format_time
  settings
  normalize_identifier
  case_sensitive
  can_identify
  quote_identifier
  to_json_path
  parse
  parse_into
  generate
  transpile
  tokenize
  tokenizer
  jsonpath_tokenizer
  parser
  generator

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

    112    class Tokenizer(tokens.Tokenizer):
    113        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
    114        IDENTIFIERS = ['"', "`"]
    115        STRING_ESCAPES = ["'", "\\"]
    116        BIT_STRINGS = [("0b", "")]
    117        HEX_STRINGS = [("0x", ""), ("0X", "")]
    118        HEREDOC_STRINGS = ["$"]
    119
    120        KEYWORDS = {
    121            **tokens.Tokenizer.KEYWORDS,
    122            "ATTACH": TokenType.COMMAND,
    123            "DATE32": TokenType.DATE32,
    124            "DATETIME64": TokenType.DATETIME64,
    125            "DICTIONARY": TokenType.DICTIONARY,
    126            "ENUM8": TokenType.ENUM8,
    127            "ENUM16": TokenType.ENUM16,
    128            "FINAL": TokenType.FINAL,
    129            "FIXEDSTRING": TokenType.FIXEDSTRING,
    130            "FLOAT32": TokenType.FLOAT,
    131            "FLOAT64": TokenType.DOUBLE,
    132            "GLOBAL": TokenType.GLOBAL,
    133            "INT256": TokenType.INT256,
    134            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    135            "MAP": TokenType.MAP,
    136            "NESTED": TokenType.NESTED,
    137            "SAMPLE": TokenType.TABLE_SAMPLE,
    138            "TUPLE": TokenType.STRUCT,
    139            "UINT128": TokenType.UINT128,
    140            "UINT16": TokenType.USMALLINT,
    141            "UINT256": TokenType.UINT256,
    142            "UINT32": TokenType.UINT,
    143            "UINT64": TokenType.UBIGINT,
    144            "UINT8": TokenType.UTINYINT,
    145            "IPV4": TokenType.IPV4,
    146            "IPV6": TokenType.IPV6,
    147            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
    148            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
    149            "SYSTEM": TokenType.COMMAND,
    150            "PREWHERE": TokenType.PREWHERE,
    151        }
    152        KEYWORDS.pop("/*+")
    153
    154        SINGLE_TOKENS = {
    155            **tokens.Tokenizer.SINGLE_TOKENS,
    156            "$": TokenType.HEREDOC_STRING,
    157        }

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.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'>, 'STRAIGHT_JOIN': <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'TRUNCATE': <TokenType.TRUNCATE: 'TRUNCATE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, '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'>, 'LIST': <TokenType.LIST: 'LIST'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'JSONB': <TokenType.JSONB: 'JSONB'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, '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'>, 'VECTOR': <TokenType.VECTOR: 'VECTOR'>, '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
  STRING_ESCAPES_ALLOWED_IN_RAW_STRINGS
  WHITE_SPACE
  COMMANDS
  COMMAND_PREFIX_TOKENS
  NUMERIC_LITERALS
  dialect
  reset
  tokenize
  tokenize_rs
  size
  sql
  tokens

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

    159    class Parser(parser.Parser):
    160        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    161        # * select x from t1 union all select x from t2 limit 1;
    162        # * select x from t1 union all (select x from t2 limit 1);
    163        MODIFIERS_ATTACHED_TO_SET_OP = False
    164        INTERVAL_SPANS = False
    165
    166        FUNCTIONS = {
    167            **parser.Parser.FUNCTIONS,
    168            "ANY": exp.AnyValue.from_arg_list,
    169            "ARRAYSUM": exp.ArraySum.from_arg_list,
    170            "COUNTIF": _build_count_if,
    171            "DATE_ADD": build_date_delta(exp.DateAdd, default_unit=None),
    172            "DATEADD": build_date_delta(exp.DateAdd, default_unit=None),
    173            "DATE_DIFF": build_date_delta(exp.DateDiff, default_unit=None),
    174            "DATEDIFF": build_date_delta(exp.DateDiff, default_unit=None),
    175            "DATE_FORMAT": _build_date_format,
    176            "DATE_SUB": build_date_delta(exp.DateSub, default_unit=None),
    177            "DATESUB": build_date_delta(exp.DateSub, default_unit=None),
    178            "FORMATDATETIME": _build_date_format,
    179            "JSONEXTRACTSTRING": build_json_extract_path(
    180                exp.JSONExtractScalar, zero_based_indexing=False
    181            ),
    182            "MAP": parser.build_var_map,
    183            "MATCH": exp.RegexpLike.from_arg_list,
    184            "RANDCANONICAL": exp.Rand.from_arg_list,
    185            "TUPLE": exp.Struct.from_arg_list,
    186            "TIMESTAMP_SUB": build_date_delta(exp.TimestampSub, default_unit=None),
    187            "TIMESTAMPSUB": build_date_delta(exp.TimestampSub, default_unit=None),
    188            "TIMESTAMP_ADD": build_date_delta(exp.TimestampAdd, default_unit=None),
    189            "TIMESTAMPADD": build_date_delta(exp.TimestampAdd, default_unit=None),
    190            "UNIQ": exp.ApproxDistinct.from_arg_list,
    191            "XOR": lambda args: exp.Xor(expressions=args),
    192            "MD5": exp.MD5Digest.from_arg_list,
    193            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
    194            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
    195        }
    196
    197        AGG_FUNCTIONS = {
    198            "count",
    199            "min",
    200            "max",
    201            "sum",
    202            "avg",
    203            "any",
    204            "stddevPop",
    205            "stddevSamp",
    206            "varPop",
    207            "varSamp",
    208            "corr",
    209            "covarPop",
    210            "covarSamp",
    211            "entropy",
    212            "exponentialMovingAverage",
    213            "intervalLengthSum",
    214            "kolmogorovSmirnovTest",
    215            "mannWhitneyUTest",
    216            "median",
    217            "rankCorr",
    218            "sumKahan",
    219            "studentTTest",
    220            "welchTTest",
    221            "anyHeavy",
    222            "anyLast",
    223            "boundingRatio",
    224            "first_value",
    225            "last_value",
    226            "argMin",
    227            "argMax",
    228            "avgWeighted",
    229            "topK",
    230            "topKWeighted",
    231            "deltaSum",
    232            "deltaSumTimestamp",
    233            "groupArray",
    234            "groupArrayLast",
    235            "groupUniqArray",
    236            "groupArrayInsertAt",
    237            "groupArrayMovingAvg",
    238            "groupArrayMovingSum",
    239            "groupArraySample",
    240            "groupBitAnd",
    241            "groupBitOr",
    242            "groupBitXor",
    243            "groupBitmap",
    244            "groupBitmapAnd",
    245            "groupBitmapOr",
    246            "groupBitmapXor",
    247            "sumWithOverflow",
    248            "sumMap",
    249            "minMap",
    250            "maxMap",
    251            "skewSamp",
    252            "skewPop",
    253            "kurtSamp",
    254            "kurtPop",
    255            "uniq",
    256            "uniqExact",
    257            "uniqCombined",
    258            "uniqCombined64",
    259            "uniqHLL12",
    260            "uniqTheta",
    261            "quantile",
    262            "quantiles",
    263            "quantileExact",
    264            "quantilesExact",
    265            "quantileExactLow",
    266            "quantilesExactLow",
    267            "quantileExactHigh",
    268            "quantilesExactHigh",
    269            "quantileExactWeighted",
    270            "quantilesExactWeighted",
    271            "quantileTiming",
    272            "quantilesTiming",
    273            "quantileTimingWeighted",
    274            "quantilesTimingWeighted",
    275            "quantileDeterministic",
    276            "quantilesDeterministic",
    277            "quantileTDigest",
    278            "quantilesTDigest",
    279            "quantileTDigestWeighted",
    280            "quantilesTDigestWeighted",
    281            "quantileBFloat16",
    282            "quantilesBFloat16",
    283            "quantileBFloat16Weighted",
    284            "quantilesBFloat16Weighted",
    285            "simpleLinearRegression",
    286            "stochasticLinearRegression",
    287            "stochasticLogisticRegression",
    288            "categoricalInformationValue",
    289            "contingency",
    290            "cramersV",
    291            "cramersVBiasCorrected",
    292            "theilsU",
    293            "maxIntersections",
    294            "maxIntersectionsPosition",
    295            "meanZTest",
    296            "quantileInterpolatedWeighted",
    297            "quantilesInterpolatedWeighted",
    298            "quantileGK",
    299            "quantilesGK",
    300            "sparkBar",
    301            "sumCount",
    302            "largestTriangleThreeBuckets",
    303            "histogram",
    304            "sequenceMatch",
    305            "sequenceCount",
    306            "windowFunnel",
    307            "retention",
    308            "uniqUpTo",
    309            "sequenceNextNode",
    310            "exponentialTimeDecayedAvg",
    311        }
    312
    313        AGG_FUNCTIONS_SUFFIXES = [
    314            "If",
    315            "Array",
    316            "ArrayIf",
    317            "Map",
    318            "SimpleState",
    319            "State",
    320            "Merge",
    321            "MergeState",
    322            "ForEach",
    323            "Distinct",
    324            "OrDefault",
    325            "OrNull",
    326            "Resample",
    327            "ArgMin",
    328            "ArgMax",
    329        ]
    330
    331        FUNC_TOKENS = {
    332            *parser.Parser.FUNC_TOKENS,
    333            TokenType.SET,
    334        }
    335
    336        RESERVED_TOKENS = parser.Parser.RESERVED_TOKENS - {TokenType.SELECT}
    337
    338        ID_VAR_TOKENS = {
    339            *parser.Parser.ID_VAR_TOKENS,
    340            TokenType.LIKE,
    341        }
    342
    343        AGG_FUNC_MAPPING = (
    344            lambda functions, suffixes: {
    345                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    346            }
    347        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    348
    349        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    350
    351        FUNCTION_PARSERS = {
    352            **parser.Parser.FUNCTION_PARSERS,
    353            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    354            "QUANTILE": lambda self: self._parse_quantile(),
    355        }
    356
    357        FUNCTION_PARSERS.pop("MATCH")
    358
    359        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    360        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    361
    362        RANGE_PARSERS = {
    363            **parser.Parser.RANGE_PARSERS,
    364            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    365            and self._parse_in(this, is_global=True),
    366        }
    367
    368        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    369        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    370        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    371        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    372
    373        JOIN_KINDS = {
    374            *parser.Parser.JOIN_KINDS,
    375            TokenType.ANY,
    376            TokenType.ASOF,
    377            TokenType.ARRAY,
    378        }
    379
    380        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    381            TokenType.ANY,
    382            TokenType.ARRAY,
    383            TokenType.FINAL,
    384            TokenType.FORMAT,
    385            TokenType.SETTINGS,
    386        }
    387
    388        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    389            TokenType.FORMAT,
    390        }
    391
    392        LOG_DEFAULTS_TO_LN = True
    393
    394        QUERY_MODIFIER_PARSERS = {
    395            **parser.Parser.QUERY_MODIFIER_PARSERS,
    396            TokenType.SETTINGS: lambda self: (
    397                "settings",
    398                self._advance() or self._parse_csv(self._parse_assignment),
    399            ),
    400            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    401        }
    402
    403        CONSTRAINT_PARSERS = {
    404            **parser.Parser.CONSTRAINT_PARSERS,
    405            "INDEX": lambda self: self._parse_index_constraint(),
    406            "CODEC": lambda self: self._parse_compress(),
    407        }
    408
    409        ALTER_PARSERS = {
    410            **parser.Parser.ALTER_PARSERS,
    411            "REPLACE": lambda self: self._parse_alter_table_replace(),
    412        }
    413
    414        SCHEMA_UNNAMED_CONSTRAINTS = {
    415            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    416            "INDEX",
    417        }
    418
    419        def _parse_extract(self) -> exp.Extract | exp.Anonymous:
    420            index = self._index
    421            this = self._parse_bitwise()
    422            if self._match(TokenType.FROM):
    423                self._retreat(index)
    424                return super()._parse_extract()
    425
    426            # We return Anonymous here because extract and regexpExtract have different semantics,
    427            # so parsing extract(foo, bar) into RegexpExtract can potentially break queries. E.g.,
    428            # `extract('foobar', 'b')` works, but CH crashes for `regexpExtract('foobar', 'b')`.
    429            #
    430            # TODO: can we somehow convert the former into an equivalent `regexpExtract` call?
    431            self._match(TokenType.COMMA)
    432            return self.expression(
    433                exp.Anonymous, this="extract", expressions=[this, self._parse_bitwise()]
    434            )
    435
    436        def _parse_assignment(self) -> t.Optional[exp.Expression]:
    437            this = super()._parse_assignment()
    438
    439            if self._match(TokenType.PLACEHOLDER):
    440                return self.expression(
    441                    exp.If,
    442                    this=this,
    443                    true=self._parse_assignment(),
    444                    false=self._match(TokenType.COLON) and self._parse_assignment(),
    445                )
    446
    447            return this
    448
    449        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    450            """
    451            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    452            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    453            """
    454            if not self._match(TokenType.L_BRACE):
    455                return None
    456
    457            this = self._parse_id_var()
    458            self._match(TokenType.COLON)
    459            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    460                self._match_text_seq("IDENTIFIER") and "Identifier"
    461            )
    462
    463            if not kind:
    464                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    465            elif not self._match(TokenType.R_BRACE):
    466                self.raise_error("Expecting }")
    467
    468            return self.expression(exp.Placeholder, this=this, kind=kind)
    469
    470        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    471            this = super()._parse_in(this)
    472            this.set("is_global", is_global)
    473            return this
    474
    475        def _parse_table(
    476            self,
    477            schema: bool = False,
    478            joins: bool = False,
    479            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    480            parse_bracket: bool = False,
    481            is_db_reference: bool = False,
    482            parse_partition: bool = False,
    483        ) -> t.Optional[exp.Expression]:
    484            this = super()._parse_table(
    485                schema=schema,
    486                joins=joins,
    487                alias_tokens=alias_tokens,
    488                parse_bracket=parse_bracket,
    489                is_db_reference=is_db_reference,
    490            )
    491
    492            if self._match(TokenType.FINAL):
    493                this = self.expression(exp.Final, this=this)
    494
    495            return this
    496
    497        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    498            return super()._parse_position(haystack_first=True)
    499
    500        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    501        def _parse_cte(self) -> exp.CTE:
    502            # WITH <identifier> AS <subquery expression>
    503            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    504
    505            if not cte:
    506                # WITH <expression> AS <identifier>
    507                cte = self.expression(
    508                    exp.CTE,
    509                    this=self._parse_assignment(),
    510                    alias=self._parse_table_alias(),
    511                    scalar=True,
    512                )
    513
    514            return cte
    515
    516        def _parse_join_parts(
    517            self,
    518        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    519            is_global = self._match(TokenType.GLOBAL) and self._prev
    520            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    521
    522            if kind_pre:
    523                kind = self._match_set(self.JOIN_KINDS) and self._prev
    524                side = self._match_set(self.JOIN_SIDES) and self._prev
    525                return is_global, side, kind
    526
    527            return (
    528                is_global,
    529                self._match_set(self.JOIN_SIDES) and self._prev,
    530                self._match_set(self.JOIN_KINDS) and self._prev,
    531            )
    532
    533        def _parse_join(
    534            self, skip_join_token: bool = False, parse_bracket: bool = False
    535        ) -> t.Optional[exp.Join]:
    536            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    537            if join:
    538                join.set("global", join.args.pop("method", None))
    539
    540            return join
    541
    542        def _parse_function(
    543            self,
    544            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    545            anonymous: bool = False,
    546            optional_parens: bool = True,
    547            any_token: bool = False,
    548        ) -> t.Optional[exp.Expression]:
    549            expr = super()._parse_function(
    550                functions=functions,
    551                anonymous=anonymous,
    552                optional_parens=optional_parens,
    553                any_token=any_token,
    554            )
    555
    556            func = expr.this if isinstance(expr, exp.Window) else expr
    557
    558            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    559            parts = (
    560                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    561            )
    562
    563            if parts:
    564                params = self._parse_func_params(func)
    565
    566                kwargs = {
    567                    "this": func.this,
    568                    "expressions": func.expressions,
    569                }
    570                if parts[1]:
    571                    kwargs["parts"] = parts
    572                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    573                else:
    574                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    575
    576                kwargs["exp_class"] = exp_class
    577                if params:
    578                    kwargs["params"] = params
    579
    580                func = self.expression(**kwargs)
    581
    582                if isinstance(expr, exp.Window):
    583                    # The window's func was parsed as Anonymous in base parser, fix its
    584                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    585                    expr.set("this", func)
    586                elif params:
    587                    # Params have blocked super()._parse_function() from parsing the following window
    588                    # (if that exists) as they're standing between the function call and the window spec
    589                    expr = self._parse_window(func)
    590                else:
    591                    expr = func
    592
    593            return expr
    594
    595        def _parse_func_params(
    596            self, this: t.Optional[exp.Func] = None
    597        ) -> t.Optional[t.List[exp.Expression]]:
    598            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    599                return self._parse_csv(self._parse_lambda)
    600
    601            if self._match(TokenType.L_PAREN):
    602                params = self._parse_csv(self._parse_lambda)
    603                self._match_r_paren(this)
    604                return params
    605
    606            return None
    607
    608        def _parse_quantile(self) -> exp.Quantile:
    609            this = self._parse_lambda()
    610            params = self._parse_func_params()
    611            if params:
    612                return self.expression(exp.Quantile, this=params[0], quantile=this)
    613            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    614
    615        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    616            return super()._parse_wrapped_id_vars(optional=True)
    617
    618        def _parse_primary_key(
    619            self, wrapped_optional: bool = False, in_props: bool = False
    620        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    621            return super()._parse_primary_key(
    622                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    623            )
    624
    625        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    626            index = self._index
    627            if self._match_text_seq("CLUSTER"):
    628                this = self._parse_id_var()
    629                if this:
    630                    return self.expression(exp.OnCluster, this=this)
    631                else:
    632                    self._retreat(index)
    633            return None
    634
    635        def _parse_index_constraint(
    636            self, kind: t.Optional[str] = None
    637        ) -> exp.IndexColumnConstraint:
    638            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    639            this = self._parse_id_var()
    640            expression = self._parse_assignment()
    641
    642            index_type = self._match_text_seq("TYPE") and (
    643                self._parse_function() or self._parse_var()
    644            )
    645
    646            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    647
    648            return self.expression(
    649                exp.IndexColumnConstraint,
    650                this=this,
    651                expression=expression,
    652                index_type=index_type,
    653                granularity=granularity,
    654            )
    655
    656        def _parse_partition(self) -> t.Optional[exp.Partition]:
    657            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    658            if not self._match(TokenType.PARTITION):
    659                return None
    660
    661            if self._match_text_seq("ID"):
    662                # Corresponds to the PARTITION ID <string_value> syntax
    663                expressions: t.List[exp.Expression] = [
    664                    self.expression(exp.PartitionId, this=self._parse_string())
    665                ]
    666            else:
    667                expressions = self._parse_expressions()
    668
    669            return self.expression(exp.Partition, expressions=expressions)
    670
    671        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    672            partition = self._parse_partition()
    673
    674            if not partition or not self._match(TokenType.FROM):
    675                return None
    676
    677            return self.expression(
    678                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    679            )
    680
    681        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    682            if not self._match_text_seq("PROJECTION"):
    683                return None
    684
    685            return self.expression(
    686                exp.ProjectionDef,
    687                this=self._parse_id_var(),
    688                expression=self._parse_wrapped(self._parse_statement),
    689            )
    690
    691        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    692            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_SET_OP = 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'>>, 'ARRAY_HAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'ARRAY_CONTAINS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, 'ARRAY_HAS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, 'FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_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 build_date_delta.<locals>._builder>, 'DATEDIFF': <function build_date_delta.<locals>._builder>, 'DATE_DIFF': <function build_date_delta.<locals>._builder>, 'DATE_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATE_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateStrToDate'>>, 'DATE_SUB': <function build_date_delta.<locals>._builder>, 'DATE_TO_DATE_STR': <function Parser.<lambda>>, 'DATE_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateToDi'>>, 'DATE_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateTrunc'>>, 'DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Datetime'>>, 'DATETIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeAdd'>>, 'DATETIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeDiff'>>, 'DATETIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeSub'>>, 'DATETIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeTrunc'>>, 'DAY': <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'>>, 'GAP_FILL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GapFill'>>, '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_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBContains'>>, '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'>>, 'LIST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.List'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ln'>>, 'LOG': <function build_logarithm>, 'LOGICAL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOLAND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'LOGICAL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOLOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'LOWER': <function build_lower>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'LOWER_HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LowerHex'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.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'>>, 'OBJECT_INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ObjectInsert'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pad'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quarter'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_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'>>, 'STDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'STR_TO_DATE': <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'>>, 'STRING_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, 'SPLIT_BY_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Time'>>, 'TIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeAdd'>>, 'TIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeDiff'>>, 'TIME_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIMEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIME_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToDate'>>, 'TIME_STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToTime'>>, 'TIME_STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToUnix'>>, 'TIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeSub'>>, 'TIME_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToStr'>>, 'TIME_TO_TIME_STR': <function Parser.<lambda>>, 'TIME_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToUnix'>>, 'TIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeTrunc'>>, 'TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Timestamp'>>, 'TIMESTAMP_ADD': <function build_date_delta.<locals>._builder>, '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': <function build_date_delta.<locals>._builder>, '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'>>, 'UNNEST': <function Parser.<lambda>>, '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>>, 'LPAD': <function Parser.<lambda>>, 'LEFTPAD': <function Parser.<lambda>>, 'MOD': <function build_mod>, 'RPAD': <function Parser.<lambda>>, 'RIGHTPAD': <function Parser.<lambda>>, 'SCOPE_RESOLUTION': <function Parser.<lambda>>, '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 build_date_delta.<locals>._builder>, 'DATE_FORMAT': <function _build_date_format>, 'DATESUB': <function build_date_delta.<locals>._builder>, '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'>>, 'TIMESTAMPSUB': <function build_date_delta.<locals>._builder>, 'TIMESTAMPADD': <function build_date_delta.<locals>._builder>, 'UNIQ': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'SHA256': <function ClickHouse.Parser.<lambda>>, 'SHA512': <function ClickHouse.Parser.<lambda>>}
AGG_FUNCTIONS = {'uniq', 'uniqCombined64', 'stochasticLogisticRegression', 'uniqUpTo', 'quantilesTimingWeighted', 'maxIntersectionsPosition', 'kurtSamp', 'groupArraySample', 'windowFunnel', 'sequenceMatch', 'max', 'anyHeavy', 'quantileDeterministic', 'quantiles', 'boundingRatio', 'retention', 'cramersV', 'groupBitAnd', 'groupUniqArray', 'sparkBar', 'quantileGK', 'quantileBFloat16', 'covarSamp', 'sumKahan', 'uniqCombined', 'stddevSamp', 'groupBitXor', 'varPop', 'anyLast', 'quantilesBFloat16Weighted', 'quantilesTiming', 'topKWeighted', 'quantilesTDigest', 'maxMap', 'uniqExact', 'simpleLinearRegression', 'varSamp', 'stddevPop', 'groupArrayInsertAt', 'argMax', 'quantilesExactHigh', 'quantileTDigestWeighted', 'theilsU', 'maxIntersections', 'meanZTest', 'sumWithOverflow', 'exponentialMovingAverage', 'deltaSum', 'sequenceCount', 'quantilesBFloat16', 'topK', 'sumCount', 'sum', 'rankCorr', 'quantileTimingWeighted', 'quantilesExactLow', 'quantileExactLow', 'exponentialTimeDecayedAvg', 'contingency', 'categoricalInformationValue', 'uniqTheta', 'studentTTest', 'quantileInterpolatedWeighted', 'largestTriangleThreeBuckets', 'groupArrayMovingSum', 'groupBitmap', 'quantileTiming', 'median', 'quantileBFloat16Weighted', 'quantilesGK', 'groupBitOr', 'corr', 'intervalLengthSum', 'any', 'quantileExactHigh', 'quantileExact', 'entropy', 'first_value', 'sumMap', 'argMin', 'count', 'sequenceNextNode', 'covarPop', 'welchTTest', 'groupBitmapOr', 'quantile', 'cramersVBiasCorrected', 'groupArrayLast', 'uniqHLL12', 'groupBitmapXor', 'groupArray', 'avg', 'kurtPop', 'groupArrayMovingAvg', 'quantileExactWeighted', 'deltaSumTimestamp', 'minMap', 'mannWhitneyUTest', 'quantilesExact', 'skewPop', 'stochasticLinearRegression', 'skewSamp', 'histogram', 'groupBitmapAnd', 'last_value', 'quantilesExactWeighted', 'quantileTDigest', 'quantilesDeterministic', 'min', 'quantilesTDigestWeighted', 'avgWeighted', 'quantilesInterpolatedWeighted', 'kolmogorovSmirnovTest'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
FUNC_TOKENS = {<TokenType.UNNEST: 'UNNEST'>, <TokenType.TEXT: 'TEXT'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.ANY: 'ANY'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.LIST: 'LIST'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.UINT256: 'UINT256'>, <TokenType.SUPER: 'SUPER'>, <TokenType.RANGE: 'RANGE'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.INSERT: 'INSERT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPV6: 'IPV6'>, <TokenType.ALL: 'ALL'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.ROW: 'ROW'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.IPV4: 'IPV4'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.SOME: 'SOME'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.INT: 'INT'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NESTED: 'NESTED'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NAME: 'NAME'>, <TokenType.NULL: 'NULL'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.LIKE: 'LIKE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.INET: 'INET'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.VAR: 'VAR'>, <TokenType.BINARY: 'BINARY'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.DATE: 'DATE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.XML: 'XML'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.ENUM: 'ENUM'>, <TokenType.XOR: 'XOR'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TIME: 'TIME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.GLOB: 'GLOB'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.CHAR: 'CHAR'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.INDEX: 'INDEX'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.JSON: 'JSON'>, <TokenType.SET: 'SET'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.BIT: 'BIT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UINT: 'UINT'>, <TokenType.UUID: 'UUID'>, <TokenType.INT256: 'INT256'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.OFFSET: 'OFFSET'>}
RESERVED_TOKENS = {<TokenType.PARAMETER: 'PARAMETER'>, <TokenType.L_BRACE: 'L_BRACE'>, <TokenType.R_PAREN: 'R_PAREN'>, <TokenType.TILDA: 'TILDA'>, <TokenType.NOT: 'NOT'>, <TokenType.EQ: 'EQ'>, <TokenType.BACKSLASH: 'BACKSLASH'>, <TokenType.CARET: 'CARET'>, <TokenType.PIPE: 'PIPE'>, <TokenType.R_BRACKET: 'R_BRACKET'>, <TokenType.AMP: 'AMP'>, <TokenType.PLUS: 'PLUS'>, <TokenType.LT: 'LT'>, <TokenType.STAR: 'STAR'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.SLASH: 'SLASH'>, <TokenType.MOD: 'MOD'>, <TokenType.DASH: 'DASH'>, <TokenType.L_PAREN: 'L_PAREN'>, <TokenType.L_BRACKET: 'L_BRACKET'>, <TokenType.GT: 'GT'>, <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, <TokenType.R_BRACE: 'R_BRACE'>, <TokenType.HASH: 'HASH'>, <TokenType.COMMA: 'COMMA'>, <TokenType.SEMICOLON: 'SEMICOLON'>, <TokenType.COLON: 'COLON'>, <TokenType.DOT: 'DOT'>}
ID_VAR_TOKENS = {<TokenType.UNNEST: 'UNNEST'>, <TokenType.TEXT: 'TEXT'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.ANY: 'ANY'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.FULL: 'FULL'>, <TokenType.LIST: 'LIST'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.TRUE: 'TRUE'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TAG: 'TAG'>, <TokenType.UINT256: 'UINT256'>, <TokenType.SUPER: 'SUPER'>, <TokenType.RANGE: 'RANGE'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.LEFT: 'LEFT'>, <TokenType.IPV6: 'IPV6'>, <TokenType.ASOF: 'ASOF'>, <TokenType.ALL: 'ALL'>, <TokenType.NEXT: 'NEXT'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.TOP: 'TOP'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.ROWS: 'ROWS'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.ROW: 'ROW'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.SEMI: 'SEMI'>, <TokenType.IPV4: 'IPV4'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.DELETE: 'DELETE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DIV: 'DIV'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.FALSE: 'FALSE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USE: 'USE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.SOME: 'SOME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CASE: 'CASE'>, <TokenType.INT: 'INT'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.ASC: 'ASC'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.NESTED: 'NESTED'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.FINAL: 'FINAL'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NAME: 'NAME'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.NULL: 'NULL'>, <TokenType.LIKE: 'LIKE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.COPY: 'COPY'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.INET: 'INET'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.VAR: 'VAR'>, <TokenType.BINARY: 'BINARY'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.SHOW: 'SHOW'>, <TokenType.DATE: 'DATE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.VIEW: 'VIEW'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.XML: 'XML'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.DESC: 'DESC'>, <TokenType.ENUM: 'ENUM'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TIME: 'TIME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.CHAR: 'CHAR'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.IS: 'IS'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.KEEP: 'KEEP'>, <TokenType.INDEX: 'INDEX'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.JSON: 'JSON'>, <TokenType.SET: 'SET'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.BIT: 'BIT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.UINT: 'UINT'>, <TokenType.KILL: 'KILL'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UUID: 'UUID'>, <TokenType.APPLY: 'APPLY'>, <TokenType.INT256: 'INT256'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.ANTI: 'ANTI'>}
AGG_FUNC_MAPPING = {'uniqIf': ('uniq', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'uniqUpToIf': ('uniqUpTo', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'windowFunnelIf': ('windowFunnel', 'If'), 'sequenceMatchIf': ('sequenceMatch', 'If'), 'maxIf': ('max', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'quantilesIf': ('quantiles', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'retentionIf': ('retention', 'If'), 'cramersVIf': ('cramersV', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'varPopIf': ('varPop', 'If'), 'anyLastIf': ('anyLast', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'maxMapIf': ('maxMap', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'varSampIf': ('varSamp', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'argMaxIf': ('argMax', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'theilsUIf': ('theilsU', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'sequenceCountIf': ('sequenceCount', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'topKIf': ('topK', 'If'), 'sumCountIf': ('sumCount', 'If'), 'sumIf': ('sum', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'exponentialTimeDecayedAvgIf': ('exponentialTimeDecayedAvg', 'If'), 'contingencyIf': ('contingency', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'medianIf': ('median', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'corrIf': ('corr', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'anyIf': ('any', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'entropyIf': ('entropy', 'If'), 'first_valueIf': ('first_value', 'If'), 'sumMapIf': ('sumMap', 'If'), 'argMinIf': ('argMin', 'If'), 'countIf': ('count', 'If'), 'sequenceNextNodeIf': ('sequenceNextNode', 'If'), 'covarPopIf': ('covarPop', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'quantileIf': ('quantile', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'avgIf': ('avg', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'minMapIf': ('minMap', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'skewPopIf': ('skewPop', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'histogramIf': ('histogram', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'last_valueIf': ('last_value', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'minIf': ('min', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'uniqArray': ('uniq', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'uniqUpToArray': ('uniqUpTo', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'windowFunnelArray': ('windowFunnel', 'Array'), 'sequenceMatchArray': ('sequenceMatch', 'Array'), 'maxArray': ('max', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'retentionArray': ('retention', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'varPopArray': ('varPop', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'sequenceCountArray': ('sequenceCount', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'topKArray': ('topK', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'sumArray': ('sum', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'exponentialTimeDecayedAvgArray': ('exponentialTimeDecayedAvg', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'medianArray': ('median', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'corrArray': ('corr', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'anyArray': ('any', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'entropyArray': ('entropy', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'argMinArray': ('argMin', 'Array'), 'countArray': ('count', 'Array'), 'sequenceNextNodeArray': ('sequenceNextNode', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'quantileArray': ('quantile', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'avgArray': ('avg', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'minMapArray': ('minMap', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'histogramArray': ('histogram', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'minArray': ('min', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'uniqUpToArrayIf': ('uniqUpTo', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'windowFunnelArrayIf': ('windowFunnel', 'ArrayIf'), 'sequenceMatchArrayIf': ('sequenceMatch', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'retentionArrayIf': ('retention', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'sequenceCountArrayIf': ('sequenceCount', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'exponentialTimeDecayedAvgArrayIf': ('exponentialTimeDecayedAvg', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'sequenceNextNodeArrayIf': ('sequenceNextNode', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'histogramArrayIf': ('histogram', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'uniqMap': ('uniq', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'uniqUpToMap': ('uniqUpTo', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'windowFunnelMap': ('windowFunnel', 'Map'), 'sequenceMatchMap': ('sequenceMatch', 'Map'), 'maxMap': ('maxMap', ''), 'anyHeavyMap': ('anyHeavy', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'retentionMap': ('retention', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'varPopMap': ('varPop', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'sequenceCountMap': ('sequenceCount', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'topKMap': ('topK', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'sumMap': ('sumMap', ''), 'rankCorrMap': ('rankCorr', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'exponentialTimeDecayedAvgMap': ('exponentialTimeDecayedAvg', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'medianMap': ('median', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'corrMap': ('corr', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'anyMap': ('any', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'entropyMap': ('entropy', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'argMinMap': ('argMin', 'Map'), 'countMap': ('count', 'Map'), 'sequenceNextNodeMap': ('sequenceNextNode', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'quantileMap': ('quantile', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'avgMap': ('avg', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'minMapMap': ('minMap', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'histogramMap': ('histogram', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'minMap': ('minMap', ''), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'uniqUpToSimpleState': ('uniqUpTo', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'windowFunnelSimpleState': ('windowFunnel', 'SimpleState'), 'sequenceMatchSimpleState': ('sequenceMatch', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'retentionSimpleState': ('retention', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'sequenceCountSimpleState': ('sequenceCount', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'exponentialTimeDecayedAvgSimpleState': ('exponentialTimeDecayedAvg', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'sequenceNextNodeSimpleState': ('sequenceNextNode', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'histogramSimpleState': ('histogram', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'uniqState': ('uniq', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'uniqUpToState': ('uniqUpTo', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'windowFunnelState': ('windowFunnel', 'State'), 'sequenceMatchState': ('sequenceMatch', 'State'), 'maxState': ('max', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'quantilesState': ('quantiles', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'retentionState': ('retention', 'State'), 'cramersVState': ('cramersV', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'covarSampState': ('covarSamp', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'varPopState': ('varPop', 'State'), 'anyLastState': ('anyLast', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'maxMapState': ('maxMap', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'varSampState': ('varSamp', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'argMaxState': ('argMax', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'theilsUState': ('theilsU', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'sequenceCountState': ('sequenceCount', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'topKState': ('topK', 'State'), 'sumCountState': ('sumCount', 'State'), 'sumState': ('sum', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'exponentialTimeDecayedAvgState': ('exponentialTimeDecayedAvg', 'State'), 'contingencyState': ('contingency', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'medianState': ('median', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'corrState': ('corr', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'anyState': ('any', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'entropyState': ('entropy', 'State'), 'first_valueState': ('first_value', 'State'), 'sumMapState': ('sumMap', 'State'), 'argMinState': ('argMin', 'State'), 'countState': ('count', 'State'), 'sequenceNextNodeState': ('sequenceNextNode', 'State'), 'covarPopState': ('covarPop', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'quantileState': ('quantile', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'groupArrayState': ('groupArray', 'State'), 'avgState': ('avg', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'minMapState': ('minMap', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'skewPopState': ('skewPop', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'skewSampState': ('skewSamp', 'State'), 'histogramState': ('histogram', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'last_valueState': ('last_value', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'minState': ('min', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'uniqMerge': ('uniq', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'uniqUpToMerge': ('uniqUpTo', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'windowFunnelMerge': ('windowFunnel', 'Merge'), 'sequenceMatchMerge': ('sequenceMatch', 'Merge'), 'maxMerge': ('max', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'retentionMerge': ('retention', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'sequenceCountMerge': ('sequenceCount', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'exponentialTimeDecayedAvgMerge': ('exponentialTimeDecayedAvg', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'medianMerge': ('median', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'anyMerge': ('any', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'countMerge': ('count', 'Merge'), 'sequenceNextNodeMerge': ('sequenceNextNode', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'histogramMerge': ('histogram', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'minMerge': ('min', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'uniqMergeState': ('uniq', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'uniqUpToMergeState': ('uniqUpTo', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'windowFunnelMergeState': ('windowFunnel', 'MergeState'), 'sequenceMatchMergeState': ('sequenceMatch', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'retentionMergeState': ('retention', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'sequenceCountMergeState': ('sequenceCount', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'exponentialTimeDecayedAvgMergeState': ('exponentialTimeDecayedAvg', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'sequenceNextNodeMergeState': ('sequenceNextNode', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'histogramMergeState': ('histogram', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'uniqForEach': ('uniq', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'uniqUpToForEach': ('uniqUpTo', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'windowFunnelForEach': ('windowFunnel', 'ForEach'), 'sequenceMatchForEach': ('sequenceMatch', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'retentionForEach': ('retention', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'sequenceCountForEach': ('sequenceCount', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'exponentialTimeDecayedAvgForEach': ('exponentialTimeDecayedAvg', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'sequenceNextNodeForEach': ('sequenceNextNode', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'histogramForEach': ('histogram', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'uniqDistinct': ('uniq', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'uniqUpToDistinct': ('uniqUpTo', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'windowFunnelDistinct': ('windowFunnel', 'Distinct'), 'sequenceMatchDistinct': ('sequenceMatch', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'retentionDistinct': ('retention', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'sequenceCountDistinct': ('sequenceCount', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'exponentialTimeDecayedAvgDistinct': ('exponentialTimeDecayedAvg', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'sequenceNextNodeDistinct': ('sequenceNextNode', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'histogramDistinct': ('histogram', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'uniqUpToOrDefault': ('uniqUpTo', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'windowFunnelOrDefault': ('windowFunnel', 'OrDefault'), 'sequenceMatchOrDefault': ('sequenceMatch', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'retentionOrDefault': ('retention', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'sequenceCountOrDefault': ('sequenceCount', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'exponentialTimeDecayedAvgOrDefault': ('exponentialTimeDecayedAvg', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'sequenceNextNodeOrDefault': ('sequenceNextNode', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'histogramOrDefault': ('histogram', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'uniqOrNull': ('uniq', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'uniqUpToOrNull': ('uniqUpTo', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'windowFunnelOrNull': ('windowFunnel', 'OrNull'), 'sequenceMatchOrNull': ('sequenceMatch', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'retentionOrNull': ('retention', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'sequenceCountOrNull': ('sequenceCount', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'exponentialTimeDecayedAvgOrNull': ('exponentialTimeDecayedAvg', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'sequenceNextNodeOrNull': ('sequenceNextNode', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'histogramOrNull': ('histogram', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'uniqResample': ('uniq', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'uniqUpToResample': ('uniqUpTo', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'windowFunnelResample': ('windowFunnel', 'Resample'), 'sequenceMatchResample': ('sequenceMatch', 'Resample'), 'maxResample': ('max', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'retentionResample': ('retention', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'sequenceCountResample': ('sequenceCount', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'topKResample': ('topK', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'sumResample': ('sum', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'exponentialTimeDecayedAvgResample': ('exponentialTimeDecayedAvg', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'medianResample': ('median', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'corrResample': ('corr', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'anyResample': ('any', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'countResample': ('count', 'Resample'), 'sequenceNextNodeResample': ('sequenceNextNode', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'avgResample': ('avg', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'histogramResample': ('histogram', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'minResample': ('min', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'uniqArgMin': ('uniq', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'uniqUpToArgMin': ('uniqUpTo', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'windowFunnelArgMin': ('windowFunnel', 'ArgMin'), 'sequenceMatchArgMin': ('sequenceMatch', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'retentionArgMin': ('retention', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'sequenceCountArgMin': ('sequenceCount', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'exponentialTimeDecayedAvgArgMin': ('exponentialTimeDecayedAvg', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'sequenceNextNodeArgMin': ('sequenceNextNode', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'histogramArgMin': ('histogram', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'uniqArgMax': ('uniq', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'uniqUpToArgMax': ('uniqUpTo', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'windowFunnelArgMax': ('windowFunnel', 'ArgMax'), 'sequenceMatchArgMax': ('sequenceMatch', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'retentionArgMax': ('retention', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'sequenceCountArgMax': ('sequenceCount', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'exponentialTimeDecayedAvgArgMax': ('exponentialTimeDecayedAvg', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'sequenceNextNodeArgMax': ('sequenceNextNode', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'histogramArgMax': ('histogram', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'uniq': ('uniq', ''), 'uniqCombined64': ('uniqCombined64', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'uniqUpTo': ('uniqUpTo', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'kurtSamp': ('kurtSamp', ''), 'groupArraySample': ('groupArraySample', ''), 'windowFunnel': ('windowFunnel', ''), 'sequenceMatch': ('sequenceMatch', ''), 'max': ('max', ''), 'anyHeavy': ('anyHeavy', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'quantiles': ('quantiles', ''), 'boundingRatio': ('boundingRatio', ''), 'retention': ('retention', ''), 'cramersV': ('cramersV', ''), 'groupBitAnd': ('groupBitAnd', ''), 'groupUniqArray': ('groupUniqArray', ''), 'sparkBar': ('sparkBar', ''), 'quantileGK': ('quantileGK', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'covarSamp': ('covarSamp', ''), 'sumKahan': ('sumKahan', ''), 'uniqCombined': ('uniqCombined', ''), 'stddevSamp': ('stddevSamp', ''), 'groupBitXor': ('groupBitXor', ''), 'varPop': ('varPop', ''), 'anyLast': ('anyLast', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'quantilesTiming': ('quantilesTiming', ''), 'topKWeighted': ('topKWeighted', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'uniqExact': ('uniqExact', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'varSamp': ('varSamp', ''), 'stddevPop': ('stddevPop', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'argMax': ('argMax', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'theilsU': ('theilsU', ''), 'maxIntersections': ('maxIntersections', ''), 'meanZTest': ('meanZTest', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'deltaSum': ('deltaSum', ''), 'sequenceCount': ('sequenceCount', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'topK': ('topK', ''), 'sumCount': ('sumCount', ''), 'sum': ('sum', ''), 'rankCorr': ('rankCorr', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'quantileExactLow': ('quantileExactLow', ''), 'exponentialTimeDecayedAvg': ('exponentialTimeDecayedAvg', ''), 'contingency': ('contingency', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'uniqTheta': ('uniqTheta', ''), 'studentTTest': ('studentTTest', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'groupBitmap': ('groupBitmap', ''), 'quantileTiming': ('quantileTiming', ''), 'median': ('median', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'quantilesGK': ('quantilesGK', ''), 'groupBitOr': ('groupBitOr', ''), 'corr': ('corr', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'any': ('any', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'quantileExact': ('quantileExact', ''), 'entropy': ('entropy', ''), 'first_value': ('first_value', ''), 'argMin': ('argMin', ''), 'count': ('count', ''), 'sequenceNextNode': ('sequenceNextNode', ''), 'covarPop': ('covarPop', ''), 'welchTTest': ('welchTTest', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'quantile': ('quantile', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'groupArrayLast': ('groupArrayLast', ''), 'uniqHLL12': ('uniqHLL12', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'groupArray': ('groupArray', ''), 'avg': ('avg', ''), 'kurtPop': ('kurtPop', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'quantilesExact': ('quantilesExact', ''), 'skewPop': ('skewPop', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'skewSamp': ('skewSamp', ''), 'histogram': ('histogram', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'last_value': ('last_value', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'quantileTDigest': ('quantileTDigest', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'min': ('min', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'avgWeighted': ('avgWeighted', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'STRUCT', 'TUPLE'}
FUNCTION_PARSERS = {'CAST': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'GAP_FILL': <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>>, 'CONNECT_BY_ROOT': <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>._parse_binary_range>, <TokenType.ILIKE: 'ILIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IN: 'IN'>: <function Parser.<lambda>>, <TokenType.IRLIKE: 'IRLIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IS: 'IS'>: <function Parser.<lambda>>, <TokenType.LIKE: 'LIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OVERLAPS: 'OVERLAPS'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.RLIKE: 'RLIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.SIMILAR_TO: 'SIMILAR_TO'>: <function binary_range_parser.<locals>._parse_binary_range>, <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.OUTER: 'OUTER'>, <TokenType.ASOF: 'ASOF'>, <TokenType.ANY: 'ANY'>, <TokenType.SEMI: 'SEMI'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.INNER: 'INNER'>, <TokenType.CROSS: 'CROSS'>, <TokenType.ANTI: 'ANTI'>}
TABLE_ALIAS_TOKENS = {<TokenType.UNNEST: 'UNNEST'>, <TokenType.TEXT: 'TEXT'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.LIST: 'LIST'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.TRUE: 'TRUE'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TAG: 'TAG'>, <TokenType.UINT256: 'UINT256'>, <TokenType.SUPER: 'SUPER'>, <TokenType.RANGE: 'RANGE'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPV6: 'IPV6'>, <TokenType.ALL: 'ALL'>, <TokenType.NEXT: 'NEXT'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.TOP: 'TOP'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.ROWS: 'ROWS'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.ROW: 'ROW'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.IPV4: 'IPV4'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.DELETE: 'DELETE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DIV: 'DIV'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.FALSE: 'FALSE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USE: 'USE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.SOME: 'SOME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CASE: 'CASE'>, <TokenType.INT: 'INT'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.ASC: 'ASC'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.NESTED: 'NESTED'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NAME: 'NAME'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.NULL: 'NULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.COPY: 'COPY'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.INET: 'INET'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.VAR: 'VAR'>, <TokenType.BINARY: 'BINARY'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.SHOW: 'SHOW'>, <TokenType.DATE: 'DATE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.VIEW: 'VIEW'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.XML: 'XML'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.DESC: 'DESC'>, <TokenType.ENUM: 'ENUM'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TIME: 'TIME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.CHAR: 'CHAR'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.IS: 'IS'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.INDEX: 'INDEX'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.JSON: 'JSON'>, <TokenType.SET: 'SET'>, <TokenType.BIT: 'BIT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.UINT: 'UINT'>, <TokenType.KILL: 'KILL'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UUID: 'UUID'>, <TokenType.INT256: 'INT256'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ENUM8: 'ENUM8'>}
ALIAS_TOKENS = {<TokenType.UNNEST: 'UNNEST'>, <TokenType.TEXT: 'TEXT'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.ANY: 'ANY'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.FULL: 'FULL'>, <TokenType.LIST: 'LIST'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.TRUE: 'TRUE'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TAG: 'TAG'>, <TokenType.UINT256: 'UINT256'>, <TokenType.SUPER: 'SUPER'>, <TokenType.RANGE: 'RANGE'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.LEFT: 'LEFT'>, <TokenType.IPV6: 'IPV6'>, <TokenType.ASOF: 'ASOF'>, <TokenType.ALL: 'ALL'>, <TokenType.NEXT: 'NEXT'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.TOP: 'TOP'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.ROWS: 'ROWS'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.ROW: 'ROW'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.SEMI: 'SEMI'>, <TokenType.IPV4: 'IPV4'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.DELETE: 'DELETE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DIV: 'DIV'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.FALSE: 'FALSE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USE: 'USE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.SOME: 'SOME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CASE: 'CASE'>, <TokenType.INT: 'INT'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.ASC: 'ASC'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.NESTED: 'NESTED'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT128: 'INT128'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.FINAL: 'FINAL'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.NAME: 'NAME'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.NULL: 'NULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.COPY: 'COPY'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.INET: 'INET'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.VAR: 'VAR'>, <TokenType.BINARY: 'BINARY'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.SHOW: 'SHOW'>, <TokenType.DATE: 'DATE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.VIEW: 'VIEW'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.XML: 'XML'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.DESC: 'DESC'>, <TokenType.ENUM: 'ENUM'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TIME: 'TIME'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.CHAR: 'CHAR'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.IS: 'IS'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.KEEP: 'KEEP'>, <TokenType.INDEX: 'INDEX'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.JSON: 'JSON'>, <TokenType.SET: 'SET'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.BIT: 'BIT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.UINT: 'UINT'>, <TokenType.KILL: 'KILL'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UUID: 'UUID'>, <TokenType.APPLY: 'APPLY'>, <TokenType.INT256: 'INT256'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.ANTI: 'ANTI'>}
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>>, 'SET': <function Parser.<lambda>>, 'REPLACE': <function ClickHouse.Parser.<lambda>>}
SCHEMA_UNNAMED_CONSTRAINTS = {'EXCLUDE', 'PERIOD', 'LIKE', 'FOREIGN KEY', 'PRIMARY KEY', 'CHECK', 'INDEX', '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
  DB_CREATABLES
  CREATABLES
  INTERVAL_VARS
  ARRAY_CONSTRUCTORS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  CONJUNCTION
  ASSIGNMENT
  DISJUNCTION
  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_CONVERTERS
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  CONFLICT_ACTIONS
  CREATE_SEQUENCE
  ISOLATED_LOADING_OPTIONS
  USABLES
  CAST_ACTIONS
  SCHEMA_BINDING_OPTIONS
  KEY_CONSTRAINT_OPTIONS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  HISTORICAL_DATA_PREFIX
  HISTORICAL_DATA_KIND
  OPCLASS_FOLLOW_KEYWORDS
  OPTYPE_FOLLOW_TOKENS
  TABLE_INDEX_HINT_TOKENS
  VIEW_ATTRIBUTES
  WINDOW_ALIAS_TOKENS
  WINDOW_BEFORE_PAREN_TOKENS
  WINDOW_SIDES
  JSON_KEY_VALUE_SEPARATOR_TOKENS
  FETCH_TOKENS
  ADD_CONSTRAINT_TOKENS
  DISTINCT_TOKENS
  NULL_TOKENS
  UNNEST_OFFSET_ALIAS_TOKENS
  SELECT_START_TOKENS
  COPY_INTO_VARLEN_OPTIONS
  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
  SET_OP_MODIFIERS
  NO_PAREN_IF_COMMANDS
  JSON_ARROWS_REQUIRE_JSON_TYPE
  COLON_IS_VARIANT_EXTRACT
  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

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

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

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

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

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

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

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

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

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

    875        def datatype_sql(self, expression: exp.DataType) -> str:
    876            # String is the standard ClickHouse type, every other variant is just an alias.
    877            # Additionally, any supplied length parameter will be ignored.
    878            #
    879            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    880            if expression.this in self.STRING_TYPE_MAPPING:
    881                return "String"
    882
    883            return super().datatype_sql(expression)

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

    885        def cte_sql(self, expression: exp.CTE) -> str:
    886            if expression.args.get("scalar"):
    887                this = self.sql(expression, "this")
    888                alias = self.sql(expression, "alias")
    889                return f"{this} AS {alias}"
    890
    891            return super().cte_sql(expression)

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

    893        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    894            return super().after_limit_modifiers(expression) + [
    895                (
    896                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    897                    if expression.args.get("settings")
    898                    else ""
    899                ),
    900                (
    901                    self.seg("FORMAT ") + self.sql(expression, "format")
    902                    if expression.args.get("format")
    903                    else ""
    904                ),
    905            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

    926        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    927            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    928                exp.Properties.Location.POST_NAME
    929            ):
    930                this_name = self.sql(expression.this, "this")
    931                this_properties = " ".join(
    932                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    933                )
    934                this_schema = self.schema_columns_sql(expression.this)
    935                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    936
    937            return super().createable_sql(expression, locations)

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

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

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

    943        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    944            this = self.sql(expression, "this")
    945            this = f" {this}" if this else ""
    946            expr = self.sql(expression, "expression")
    947            expr = f" {expr}" if expr else ""
    948            index_type = self.sql(expression, "index_type")
    949            index_type = f" TYPE {index_type}" if index_type else ""
    950            granularity = self.sql(expression, "granularity")
    951            granularity = f" GRANULARITY {granularity}" if granularity else ""
    952
    953            return f"INDEX{this}{expr}{index_type}{granularity}"

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

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

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

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

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

    961        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    962            return (
    963                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    964            )

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

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

SELECT_KINDS: Tuple[str, ...] = ()
TRY_SUPPORTED = False
SUPPORTS_UESCAPE = False
AFTER_HAVING_MODIFIER_TRANSFORMS = {'windows': <function Generator.<lambda>>, 'qualify': <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
  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
  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
  WITH_PROPERTIES_PREFIX
  QUOTE_JSON_PATH
  PAD_FILL_PATTERN_IS_REQUIRED
  PARSE_JSON_NAME
  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
  options_modifier
  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
  alterset_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
  datadeletionproperty_sql
  maskingpolicycolumnconstraint_sql
  gapfill_sql
  scope_resolution
  scoperesolution_sql
  parsejson_sql
  length_sql
  rand_sql
  strtodate_sql
  strtotime_sql
  changes_sql
  pad_sql