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, transforms
      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        AGG_FUNC_MAPPING = (
    336            lambda functions, suffixes: {
    337                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    338            }
    339        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    340
    341        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    342
    343        FUNCTION_PARSERS = {
    344            **parser.Parser.FUNCTION_PARSERS,
    345            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    346            "QUANTILE": lambda self: self._parse_quantile(),
    347        }
    348
    349        FUNCTION_PARSERS.pop("MATCH")
    350
    351        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    352        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    353
    354        RANGE_PARSERS = {
    355            **parser.Parser.RANGE_PARSERS,
    356            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    357            and self._parse_in(this, is_global=True),
    358        }
    359
    360        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    361        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    362        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    363        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    364
    365        JOIN_KINDS = {
    366            *parser.Parser.JOIN_KINDS,
    367            TokenType.ANY,
    368            TokenType.ASOF,
    369            TokenType.ARRAY,
    370        }
    371
    372        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    373            TokenType.ANY,
    374            TokenType.ARRAY,
    375            TokenType.FINAL,
    376            TokenType.FORMAT,
    377            TokenType.SETTINGS,
    378        }
    379
    380        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    381            TokenType.FORMAT,
    382        }
    383
    384        LOG_DEFAULTS_TO_LN = True
    385
    386        QUERY_MODIFIER_PARSERS = {
    387            **parser.Parser.QUERY_MODIFIER_PARSERS,
    388            TokenType.SETTINGS: lambda self: (
    389                "settings",
    390                self._advance() or self._parse_csv(self._parse_assignment),
    391            ),
    392            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    393        }
    394
    395        CONSTRAINT_PARSERS = {
    396            **parser.Parser.CONSTRAINT_PARSERS,
    397            "INDEX": lambda self: self._parse_index_constraint(),
    398            "CODEC": lambda self: self._parse_compress(),
    399        }
    400
    401        ALTER_PARSERS = {
    402            **parser.Parser.ALTER_PARSERS,
    403            "REPLACE": lambda self: self._parse_alter_table_replace(),
    404        }
    405
    406        SCHEMA_UNNAMED_CONSTRAINTS = {
    407            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    408            "INDEX",
    409        }
    410
    411        def _parse_extract(self) -> exp.Extract | exp.Anonymous:
    412            index = self._index
    413            this = self._parse_bitwise()
    414            if self._match(TokenType.FROM):
    415                self._retreat(index)
    416                return super()._parse_extract()
    417
    418            # We return Anonymous here because extract and regexpExtract have different semantics,
    419            # so parsing extract(foo, bar) into RegexpExtract can potentially break queries. E.g.,
    420            # `extract('foobar', 'b')` works, but CH crashes for `regexpExtract('foobar', 'b')`.
    421            #
    422            # TODO: can we somehow convert the former into an equivalent `regexpExtract` call?
    423            self._match(TokenType.COMMA)
    424            return self.expression(
    425                exp.Anonymous, this="extract", expressions=[this, self._parse_bitwise()]
    426            )
    427
    428        def _parse_assignment(self) -> t.Optional[exp.Expression]:
    429            this = super()._parse_assignment()
    430
    431            if self._match(TokenType.PLACEHOLDER):
    432                return self.expression(
    433                    exp.If,
    434                    this=this,
    435                    true=self._parse_assignment(),
    436                    false=self._match(TokenType.COLON) and self._parse_assignment(),
    437                )
    438
    439            return this
    440
    441        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    442            """
    443            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    444            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    445            """
    446            if not self._match(TokenType.L_BRACE):
    447                return None
    448
    449            this = self._parse_id_var()
    450            self._match(TokenType.COLON)
    451            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    452                self._match_text_seq("IDENTIFIER") and "Identifier"
    453            )
    454
    455            if not kind:
    456                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    457            elif not self._match(TokenType.R_BRACE):
    458                self.raise_error("Expecting }")
    459
    460            return self.expression(exp.Placeholder, this=this, kind=kind)
    461
    462        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    463            this = super()._parse_in(this)
    464            this.set("is_global", is_global)
    465            return this
    466
    467        def _parse_table(
    468            self,
    469            schema: bool = False,
    470            joins: bool = False,
    471            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    472            parse_bracket: bool = False,
    473            is_db_reference: bool = False,
    474            parse_partition: bool = False,
    475        ) -> t.Optional[exp.Expression]:
    476            this = super()._parse_table(
    477                schema=schema,
    478                joins=joins,
    479                alias_tokens=alias_tokens,
    480                parse_bracket=parse_bracket,
    481                is_db_reference=is_db_reference,
    482            )
    483
    484            if self._match(TokenType.FINAL):
    485                this = self.expression(exp.Final, this=this)
    486
    487            return this
    488
    489        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    490            return super()._parse_position(haystack_first=True)
    491
    492        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    493        def _parse_cte(self) -> exp.CTE:
    494            # WITH <identifier> AS <subquery expression>
    495            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    496
    497            if not cte:
    498                # WITH <expression> AS <identifier>
    499                cte = self.expression(
    500                    exp.CTE,
    501                    this=self._parse_assignment(),
    502                    alias=self._parse_table_alias(),
    503                    scalar=True,
    504                )
    505
    506            return cte
    507
    508        def _parse_join_parts(
    509            self,
    510        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    511            is_global = self._match(TokenType.GLOBAL) and self._prev
    512            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    513
    514            if kind_pre:
    515                kind = self._match_set(self.JOIN_KINDS) and self._prev
    516                side = self._match_set(self.JOIN_SIDES) and self._prev
    517                return is_global, side, kind
    518
    519            return (
    520                is_global,
    521                self._match_set(self.JOIN_SIDES) and self._prev,
    522                self._match_set(self.JOIN_KINDS) and self._prev,
    523            )
    524
    525        def _parse_join(
    526            self, skip_join_token: bool = False, parse_bracket: bool = False
    527        ) -> t.Optional[exp.Join]:
    528            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    529            if join:
    530                join.set("global", join.args.pop("method", None))
    531
    532            return join
    533
    534        def _parse_function(
    535            self,
    536            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    537            anonymous: bool = False,
    538            optional_parens: bool = True,
    539            any_token: bool = False,
    540        ) -> t.Optional[exp.Expression]:
    541            expr = super()._parse_function(
    542                functions=functions,
    543                anonymous=anonymous,
    544                optional_parens=optional_parens,
    545                any_token=any_token,
    546            )
    547
    548            func = expr.this if isinstance(expr, exp.Window) else expr
    549
    550            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    551            parts = (
    552                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    553            )
    554
    555            if parts:
    556                params = self._parse_func_params(func)
    557
    558                kwargs = {
    559                    "this": func.this,
    560                    "expressions": func.expressions,
    561                }
    562                if parts[1]:
    563                    kwargs["parts"] = parts
    564                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    565                else:
    566                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    567
    568                kwargs["exp_class"] = exp_class
    569                if params:
    570                    kwargs["params"] = params
    571
    572                func = self.expression(**kwargs)
    573
    574                if isinstance(expr, exp.Window):
    575                    # The window's func was parsed as Anonymous in base parser, fix its
    576                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    577                    expr.set("this", func)
    578                elif params:
    579                    # Params have blocked super()._parse_function() from parsing the following window
    580                    # (if that exists) as they're standing between the function call and the window spec
    581                    expr = self._parse_window(func)
    582                else:
    583                    expr = func
    584
    585            return expr
    586
    587        def _parse_func_params(
    588            self, this: t.Optional[exp.Func] = None
    589        ) -> t.Optional[t.List[exp.Expression]]:
    590            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    591                return self._parse_csv(self._parse_lambda)
    592
    593            if self._match(TokenType.L_PAREN):
    594                params = self._parse_csv(self._parse_lambda)
    595                self._match_r_paren(this)
    596                return params
    597
    598            return None
    599
    600        def _parse_quantile(self) -> exp.Quantile:
    601            this = self._parse_lambda()
    602            params = self._parse_func_params()
    603            if params:
    604                return self.expression(exp.Quantile, this=params[0], quantile=this)
    605            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    606
    607        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    608            return super()._parse_wrapped_id_vars(optional=True)
    609
    610        def _parse_primary_key(
    611            self, wrapped_optional: bool = False, in_props: bool = False
    612        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    613            return super()._parse_primary_key(
    614                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    615            )
    616
    617        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    618            index = self._index
    619            if self._match_text_seq("CLUSTER"):
    620                this = self._parse_id_var()
    621                if this:
    622                    return self.expression(exp.OnCluster, this=this)
    623                else:
    624                    self._retreat(index)
    625            return None
    626
    627        def _parse_index_constraint(
    628            self, kind: t.Optional[str] = None
    629        ) -> exp.IndexColumnConstraint:
    630            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    631            this = self._parse_id_var()
    632            expression = self._parse_assignment()
    633
    634            index_type = self._match_text_seq("TYPE") and (
    635                self._parse_function() or self._parse_var()
    636            )
    637
    638            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    639
    640            return self.expression(
    641                exp.IndexColumnConstraint,
    642                this=this,
    643                expression=expression,
    644                index_type=index_type,
    645                granularity=granularity,
    646            )
    647
    648        def _parse_partition(self) -> t.Optional[exp.Partition]:
    649            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    650            if not self._match(TokenType.PARTITION):
    651                return None
    652
    653            if self._match_text_seq("ID"):
    654                # Corresponds to the PARTITION ID <string_value> syntax
    655                expressions: t.List[exp.Expression] = [
    656                    self.expression(exp.PartitionId, this=self._parse_string())
    657                ]
    658            else:
    659                expressions = self._parse_expressions()
    660
    661            return self.expression(exp.Partition, expressions=expressions)
    662
    663        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    664            partition = self._parse_partition()
    665
    666            if not partition or not self._match(TokenType.FROM):
    667                return None
    668
    669            return self.expression(
    670                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    671            )
    672
    673        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    674            if not self._match_text_seq("PROJECTION"):
    675                return None
    676
    677            return self.expression(
    678                exp.ProjectionDef,
    679                this=self._parse_id_var(),
    680                expression=self._parse_wrapped(self._parse_statement),
    681            )
    682
    683        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    684            return super()._parse_constraint() or self._parse_projection_def()
    685
    686    class Generator(generator.Generator):
    687        QUERY_HINTS = False
    688        STRUCT_DELIMITER = ("(", ")")
    689        NVL2_SUPPORTED = False
    690        TABLESAMPLE_REQUIRES_PARENS = False
    691        TABLESAMPLE_SIZE_IS_ROWS = False
    692        TABLESAMPLE_KEYWORDS = "SAMPLE"
    693        LAST_DAY_SUPPORTS_DATE_PART = False
    694        CAN_IMPLEMENT_ARRAY_ANY = True
    695        SUPPORTS_TO_NUMBER = False
    696        JOIN_HINTS = False
    697        TABLE_HINTS = False
    698        EXPLICIT_SET_OP = True
    699        GROUPINGS_SEP = ""
    700        SET_OP_MODIFIERS = False
    701        SUPPORTS_TABLE_ALIAS_COLUMNS = False
    702
    703        STRING_TYPE_MAPPING = {
    704            exp.DataType.Type.CHAR: "String",
    705            exp.DataType.Type.LONGBLOB: "String",
    706            exp.DataType.Type.LONGTEXT: "String",
    707            exp.DataType.Type.MEDIUMBLOB: "String",
    708            exp.DataType.Type.MEDIUMTEXT: "String",
    709            exp.DataType.Type.TINYBLOB: "String",
    710            exp.DataType.Type.TINYTEXT: "String",
    711            exp.DataType.Type.TEXT: "String",
    712            exp.DataType.Type.VARBINARY: "String",
    713            exp.DataType.Type.VARCHAR: "String",
    714        }
    715
    716        SUPPORTED_JSON_PATH_PARTS = {
    717            exp.JSONPathKey,
    718            exp.JSONPathRoot,
    719            exp.JSONPathSubscript,
    720        }
    721
    722        TYPE_MAPPING = {
    723            **generator.Generator.TYPE_MAPPING,
    724            **STRING_TYPE_MAPPING,
    725            exp.DataType.Type.ARRAY: "Array",
    726            exp.DataType.Type.BIGINT: "Int64",
    727            exp.DataType.Type.DATE32: "Date32",
    728            exp.DataType.Type.DATETIME64: "DateTime64",
    729            exp.DataType.Type.DOUBLE: "Float64",
    730            exp.DataType.Type.ENUM: "Enum",
    731            exp.DataType.Type.ENUM8: "Enum8",
    732            exp.DataType.Type.ENUM16: "Enum16",
    733            exp.DataType.Type.FIXEDSTRING: "FixedString",
    734            exp.DataType.Type.FLOAT: "Float32",
    735            exp.DataType.Type.INT: "Int32",
    736            exp.DataType.Type.MEDIUMINT: "Int32",
    737            exp.DataType.Type.INT128: "Int128",
    738            exp.DataType.Type.INT256: "Int256",
    739            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    740            exp.DataType.Type.MAP: "Map",
    741            exp.DataType.Type.NESTED: "Nested",
    742            exp.DataType.Type.NULLABLE: "Nullable",
    743            exp.DataType.Type.SMALLINT: "Int16",
    744            exp.DataType.Type.STRUCT: "Tuple",
    745            exp.DataType.Type.TINYINT: "Int8",
    746            exp.DataType.Type.UBIGINT: "UInt64",
    747            exp.DataType.Type.UINT: "UInt32",
    748            exp.DataType.Type.UINT128: "UInt128",
    749            exp.DataType.Type.UINT256: "UInt256",
    750            exp.DataType.Type.USMALLINT: "UInt16",
    751            exp.DataType.Type.UTINYINT: "UInt8",
    752            exp.DataType.Type.IPV4: "IPv4",
    753            exp.DataType.Type.IPV6: "IPv6",
    754            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    755            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    756        }
    757
    758        TRANSFORMS = {
    759            **generator.Generator.TRANSFORMS,
    760            exp.AnyValue: rename_func("any"),
    761            exp.ApproxDistinct: rename_func("uniq"),
    762            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    763            exp.ArraySize: rename_func("LENGTH"),
    764            exp.ArraySum: rename_func("arraySum"),
    765            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    766            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    767            exp.Array: inline_array_sql,
    768            exp.CastToStrType: rename_func("CAST"),
    769            exp.CountIf: rename_func("countIf"),
    770            exp.CompressColumnConstraint: lambda self,
    771            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    772            exp.ComputedColumnConstraint: lambda self,
    773            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    774            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    775            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
    776            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
    777            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
    778            exp.Explode: rename_func("arrayJoin"),
    779            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    780            exp.IsNan: rename_func("isNaN"),
    781            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    782            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    783            exp.JSONPathKey: json_path_key_only_name,
    784            exp.JSONPathRoot: lambda *_: "",
    785            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    786            exp.Nullif: rename_func("nullIf"),
    787            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    788            exp.Pivot: no_pivot_sql,
    789            exp.Quantile: _quantile_sql,
    790            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    791            exp.Rand: rename_func("randCanonical"),
    792            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    793            exp.StartsWith: rename_func("startsWith"),
    794            exp.StrPosition: lambda self, e: self.func(
    795                "position", e.this, e.args.get("substr"), e.args.get("position")
    796            ),
    797            exp.TimeToStr: lambda self, e: self.func(
    798                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    799            ),
    800            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
    801            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
    802            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    803            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    804            exp.MD5Digest: rename_func("MD5"),
    805            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
    806            exp.SHA: rename_func("SHA1"),
    807            exp.SHA2: sha256_sql,
    808            exp.UnixToTime: _unix_to_time_sql,
    809            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
    810            exp.Variance: rename_func("varSamp"),
    811            exp.Stddev: rename_func("stddevSamp"),
    812        }
    813
    814        PROPERTIES_LOCATION = {
    815            **generator.Generator.PROPERTIES_LOCATION,
    816            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    817            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    818            exp.OnCluster: exp.Properties.Location.POST_NAME,
    819        }
    820
    821        # there's no list in docs, but it can be found in Clickhouse code
    822        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    823        ON_CLUSTER_TARGETS = {
    824            "DATABASE",
    825            "TABLE",
    826            "VIEW",
    827            "DICTIONARY",
    828            "INDEX",
    829            "FUNCTION",
    830            "NAMED COLLECTION",
    831        }
    832
    833        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    834            this = self.json_path_part(expression.this)
    835            return str(int(this) + 1) if is_int(this) else this
    836
    837        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    838            return f"AS {self.sql(expression, 'this')}"
    839
    840        def _any_to_has(
    841            self,
    842            expression: exp.EQ | exp.NEQ,
    843            default: t.Callable[[t.Any], str],
    844            prefix: str = "",
    845        ) -> str:
    846            if isinstance(expression.left, exp.Any):
    847                arr = expression.left
    848                this = expression.right
    849            elif isinstance(expression.right, exp.Any):
    850                arr = expression.right
    851                this = expression.left
    852            else:
    853                return default(expression)
    854
    855            return prefix + self.func("has", arr.this.unnest(), this)
    856
    857        def eq_sql(self, expression: exp.EQ) -> str:
    858            return self._any_to_has(expression, super().eq_sql)
    859
    860        def neq_sql(self, expression: exp.NEQ) -> str:
    861            return self._any_to_has(expression, super().neq_sql, "NOT ")
    862
    863        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    864            # Manually add a flag to make the search case-insensitive
    865            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    866            return self.func("match", expression.this, regex)
    867
    868        def datatype_sql(self, expression: exp.DataType) -> str:
    869            # String is the standard ClickHouse type, every other variant is just an alias.
    870            # Additionally, any supplied length parameter will be ignored.
    871            #
    872            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    873            if expression.this in self.STRING_TYPE_MAPPING:
    874                return "String"
    875
    876            return super().datatype_sql(expression)
    877
    878        def cte_sql(self, expression: exp.CTE) -> str:
    879            if expression.args.get("scalar"):
    880                this = self.sql(expression, "this")
    881                alias = self.sql(expression, "alias")
    882                return f"{this} AS {alias}"
    883
    884            return super().cte_sql(expression)
    885
    886        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    887            return super().after_limit_modifiers(expression) + [
    888                (
    889                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    890                    if expression.args.get("settings")
    891                    else ""
    892                ),
    893                (
    894                    self.seg("FORMAT ") + self.sql(expression, "format")
    895                    if expression.args.get("format")
    896                    else ""
    897                ),
    898            ]
    899
    900        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    901            params = self.expressions(expression, key="params", flat=True)
    902            return self.func(expression.name, *expression.expressions) + f"({params})"
    903
    904        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    905            return self.func(expression.name, *expression.expressions)
    906
    907        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    908            return self.anonymousaggfunc_sql(expression)
    909
    910        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    911            return self.parameterizedagg_sql(expression)
    912
    913        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    914            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    915
    916        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    917            return f"ON CLUSTER {self.sql(expression, 'this')}"
    918
    919        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    920            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    921                exp.Properties.Location.POST_NAME
    922            ):
    923                this_name = self.sql(expression.this, "this")
    924                this_properties = " ".join(
    925                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    926                )
    927                this_schema = self.schema_columns_sql(expression.this)
    928                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    929
    930            return super().createable_sql(expression, locations)
    931
    932        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    933            this = self.indent(self.sql(expression, "this"))
    934            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    935
    936        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    937            this = self.sql(expression, "this")
    938            this = f" {this}" if this else ""
    939            expr = self.sql(expression, "expression")
    940            expr = f" {expr}" if expr else ""
    941            index_type = self.sql(expression, "index_type")
    942            index_type = f" TYPE {index_type}" if index_type else ""
    943            granularity = self.sql(expression, "granularity")
    944            granularity = f" GRANULARITY {granularity}" if granularity else ""
    945
    946            return f"INDEX{this}{expr}{index_type}{granularity}"
    947
    948        def partition_sql(self, expression: exp.Partition) -> str:
    949            return f"PARTITION {self.expressions(expression, flat=True)}"
    950
    951        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    952            return f"ID {self.sql(expression.this)}"
    953
    954        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    955            return (
    956                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    957            )
    958
    959        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    960            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        AGG_FUNC_MAPPING = (
    337            lambda functions, suffixes: {
    338                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    339            }
    340        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    341
    342        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    343
    344        FUNCTION_PARSERS = {
    345            **parser.Parser.FUNCTION_PARSERS,
    346            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    347            "QUANTILE": lambda self: self._parse_quantile(),
    348        }
    349
    350        FUNCTION_PARSERS.pop("MATCH")
    351
    352        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    353        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    354
    355        RANGE_PARSERS = {
    356            **parser.Parser.RANGE_PARSERS,
    357            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    358            and self._parse_in(this, is_global=True),
    359        }
    360
    361        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    362        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    363        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    364        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    365
    366        JOIN_KINDS = {
    367            *parser.Parser.JOIN_KINDS,
    368            TokenType.ANY,
    369            TokenType.ASOF,
    370            TokenType.ARRAY,
    371        }
    372
    373        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    374            TokenType.ANY,
    375            TokenType.ARRAY,
    376            TokenType.FINAL,
    377            TokenType.FORMAT,
    378            TokenType.SETTINGS,
    379        }
    380
    381        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    382            TokenType.FORMAT,
    383        }
    384
    385        LOG_DEFAULTS_TO_LN = True
    386
    387        QUERY_MODIFIER_PARSERS = {
    388            **parser.Parser.QUERY_MODIFIER_PARSERS,
    389            TokenType.SETTINGS: lambda self: (
    390                "settings",
    391                self._advance() or self._parse_csv(self._parse_assignment),
    392            ),
    393            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    394        }
    395
    396        CONSTRAINT_PARSERS = {
    397            **parser.Parser.CONSTRAINT_PARSERS,
    398            "INDEX": lambda self: self._parse_index_constraint(),
    399            "CODEC": lambda self: self._parse_compress(),
    400        }
    401
    402        ALTER_PARSERS = {
    403            **parser.Parser.ALTER_PARSERS,
    404            "REPLACE": lambda self: self._parse_alter_table_replace(),
    405        }
    406
    407        SCHEMA_UNNAMED_CONSTRAINTS = {
    408            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    409            "INDEX",
    410        }
    411
    412        def _parse_extract(self) -> exp.Extract | exp.Anonymous:
    413            index = self._index
    414            this = self._parse_bitwise()
    415            if self._match(TokenType.FROM):
    416                self._retreat(index)
    417                return super()._parse_extract()
    418
    419            # We return Anonymous here because extract and regexpExtract have different semantics,
    420            # so parsing extract(foo, bar) into RegexpExtract can potentially break queries. E.g.,
    421            # `extract('foobar', 'b')` works, but CH crashes for `regexpExtract('foobar', 'b')`.
    422            #
    423            # TODO: can we somehow convert the former into an equivalent `regexpExtract` call?
    424            self._match(TokenType.COMMA)
    425            return self.expression(
    426                exp.Anonymous, this="extract", expressions=[this, self._parse_bitwise()]
    427            )
    428
    429        def _parse_assignment(self) -> t.Optional[exp.Expression]:
    430            this = super()._parse_assignment()
    431
    432            if self._match(TokenType.PLACEHOLDER):
    433                return self.expression(
    434                    exp.If,
    435                    this=this,
    436                    true=self._parse_assignment(),
    437                    false=self._match(TokenType.COLON) and self._parse_assignment(),
    438                )
    439
    440            return this
    441
    442        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    443            """
    444            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    445            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    446            """
    447            if not self._match(TokenType.L_BRACE):
    448                return None
    449
    450            this = self._parse_id_var()
    451            self._match(TokenType.COLON)
    452            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    453                self._match_text_seq("IDENTIFIER") and "Identifier"
    454            )
    455
    456            if not kind:
    457                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    458            elif not self._match(TokenType.R_BRACE):
    459                self.raise_error("Expecting }")
    460
    461            return self.expression(exp.Placeholder, this=this, kind=kind)
    462
    463        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    464            this = super()._parse_in(this)
    465            this.set("is_global", is_global)
    466            return this
    467
    468        def _parse_table(
    469            self,
    470            schema: bool = False,
    471            joins: bool = False,
    472            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    473            parse_bracket: bool = False,
    474            is_db_reference: bool = False,
    475            parse_partition: bool = False,
    476        ) -> t.Optional[exp.Expression]:
    477            this = super()._parse_table(
    478                schema=schema,
    479                joins=joins,
    480                alias_tokens=alias_tokens,
    481                parse_bracket=parse_bracket,
    482                is_db_reference=is_db_reference,
    483            )
    484
    485            if self._match(TokenType.FINAL):
    486                this = self.expression(exp.Final, this=this)
    487
    488            return this
    489
    490        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    491            return super()._parse_position(haystack_first=True)
    492
    493        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    494        def _parse_cte(self) -> exp.CTE:
    495            # WITH <identifier> AS <subquery expression>
    496            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    497
    498            if not cte:
    499                # WITH <expression> AS <identifier>
    500                cte = self.expression(
    501                    exp.CTE,
    502                    this=self._parse_assignment(),
    503                    alias=self._parse_table_alias(),
    504                    scalar=True,
    505                )
    506
    507            return cte
    508
    509        def _parse_join_parts(
    510            self,
    511        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    512            is_global = self._match(TokenType.GLOBAL) and self._prev
    513            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    514
    515            if kind_pre:
    516                kind = self._match_set(self.JOIN_KINDS) and self._prev
    517                side = self._match_set(self.JOIN_SIDES) and self._prev
    518                return is_global, side, kind
    519
    520            return (
    521                is_global,
    522                self._match_set(self.JOIN_SIDES) and self._prev,
    523                self._match_set(self.JOIN_KINDS) and self._prev,
    524            )
    525
    526        def _parse_join(
    527            self, skip_join_token: bool = False, parse_bracket: bool = False
    528        ) -> t.Optional[exp.Join]:
    529            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    530            if join:
    531                join.set("global", join.args.pop("method", None))
    532
    533            return join
    534
    535        def _parse_function(
    536            self,
    537            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    538            anonymous: bool = False,
    539            optional_parens: bool = True,
    540            any_token: bool = False,
    541        ) -> t.Optional[exp.Expression]:
    542            expr = super()._parse_function(
    543                functions=functions,
    544                anonymous=anonymous,
    545                optional_parens=optional_parens,
    546                any_token=any_token,
    547            )
    548
    549            func = expr.this if isinstance(expr, exp.Window) else expr
    550
    551            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    552            parts = (
    553                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    554            )
    555
    556            if parts:
    557                params = self._parse_func_params(func)
    558
    559                kwargs = {
    560                    "this": func.this,
    561                    "expressions": func.expressions,
    562                }
    563                if parts[1]:
    564                    kwargs["parts"] = parts
    565                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    566                else:
    567                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    568
    569                kwargs["exp_class"] = exp_class
    570                if params:
    571                    kwargs["params"] = params
    572
    573                func = self.expression(**kwargs)
    574
    575                if isinstance(expr, exp.Window):
    576                    # The window's func was parsed as Anonymous in base parser, fix its
    577                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    578                    expr.set("this", func)
    579                elif params:
    580                    # Params have blocked super()._parse_function() from parsing the following window
    581                    # (if that exists) as they're standing between the function call and the window spec
    582                    expr = self._parse_window(func)
    583                else:
    584                    expr = func
    585
    586            return expr
    587
    588        def _parse_func_params(
    589            self, this: t.Optional[exp.Func] = None
    590        ) -> t.Optional[t.List[exp.Expression]]:
    591            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    592                return self._parse_csv(self._parse_lambda)
    593
    594            if self._match(TokenType.L_PAREN):
    595                params = self._parse_csv(self._parse_lambda)
    596                self._match_r_paren(this)
    597                return params
    598
    599            return None
    600
    601        def _parse_quantile(self) -> exp.Quantile:
    602            this = self._parse_lambda()
    603            params = self._parse_func_params()
    604            if params:
    605                return self.expression(exp.Quantile, this=params[0], quantile=this)
    606            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    607
    608        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    609            return super()._parse_wrapped_id_vars(optional=True)
    610
    611        def _parse_primary_key(
    612            self, wrapped_optional: bool = False, in_props: bool = False
    613        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    614            return super()._parse_primary_key(
    615                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    616            )
    617
    618        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    619            index = self._index
    620            if self._match_text_seq("CLUSTER"):
    621                this = self._parse_id_var()
    622                if this:
    623                    return self.expression(exp.OnCluster, this=this)
    624                else:
    625                    self._retreat(index)
    626            return None
    627
    628        def _parse_index_constraint(
    629            self, kind: t.Optional[str] = None
    630        ) -> exp.IndexColumnConstraint:
    631            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    632            this = self._parse_id_var()
    633            expression = self._parse_assignment()
    634
    635            index_type = self._match_text_seq("TYPE") and (
    636                self._parse_function() or self._parse_var()
    637            )
    638
    639            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    640
    641            return self.expression(
    642                exp.IndexColumnConstraint,
    643                this=this,
    644                expression=expression,
    645                index_type=index_type,
    646                granularity=granularity,
    647            )
    648
    649        def _parse_partition(self) -> t.Optional[exp.Partition]:
    650            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    651            if not self._match(TokenType.PARTITION):
    652                return None
    653
    654            if self._match_text_seq("ID"):
    655                # Corresponds to the PARTITION ID <string_value> syntax
    656                expressions: t.List[exp.Expression] = [
    657                    self.expression(exp.PartitionId, this=self._parse_string())
    658                ]
    659            else:
    660                expressions = self._parse_expressions()
    661
    662            return self.expression(exp.Partition, expressions=expressions)
    663
    664        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    665            partition = self._parse_partition()
    666
    667            if not partition or not self._match(TokenType.FROM):
    668                return None
    669
    670            return self.expression(
    671                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    672            )
    673
    674        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    675            if not self._match_text_seq("PROJECTION"):
    676                return None
    677
    678            return self.expression(
    679                exp.ProjectionDef,
    680                this=self._parse_id_var(),
    681                expression=self._parse_wrapped(self._parse_statement),
    682            )
    683
    684        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    685            return super()._parse_constraint() or self._parse_projection_def()
    686
    687    class Generator(generator.Generator):
    688        QUERY_HINTS = False
    689        STRUCT_DELIMITER = ("(", ")")
    690        NVL2_SUPPORTED = False
    691        TABLESAMPLE_REQUIRES_PARENS = False
    692        TABLESAMPLE_SIZE_IS_ROWS = False
    693        TABLESAMPLE_KEYWORDS = "SAMPLE"
    694        LAST_DAY_SUPPORTS_DATE_PART = False
    695        CAN_IMPLEMENT_ARRAY_ANY = True
    696        SUPPORTS_TO_NUMBER = False
    697        JOIN_HINTS = False
    698        TABLE_HINTS = False
    699        EXPLICIT_SET_OP = True
    700        GROUPINGS_SEP = ""
    701        SET_OP_MODIFIERS = False
    702        SUPPORTS_TABLE_ALIAS_COLUMNS = False
    703
    704        STRING_TYPE_MAPPING = {
    705            exp.DataType.Type.CHAR: "String",
    706            exp.DataType.Type.LONGBLOB: "String",
    707            exp.DataType.Type.LONGTEXT: "String",
    708            exp.DataType.Type.MEDIUMBLOB: "String",
    709            exp.DataType.Type.MEDIUMTEXT: "String",
    710            exp.DataType.Type.TINYBLOB: "String",
    711            exp.DataType.Type.TINYTEXT: "String",
    712            exp.DataType.Type.TEXT: "String",
    713            exp.DataType.Type.VARBINARY: "String",
    714            exp.DataType.Type.VARCHAR: "String",
    715        }
    716
    717        SUPPORTED_JSON_PATH_PARTS = {
    718            exp.JSONPathKey,
    719            exp.JSONPathRoot,
    720            exp.JSONPathSubscript,
    721        }
    722
    723        TYPE_MAPPING = {
    724            **generator.Generator.TYPE_MAPPING,
    725            **STRING_TYPE_MAPPING,
    726            exp.DataType.Type.ARRAY: "Array",
    727            exp.DataType.Type.BIGINT: "Int64",
    728            exp.DataType.Type.DATE32: "Date32",
    729            exp.DataType.Type.DATETIME64: "DateTime64",
    730            exp.DataType.Type.DOUBLE: "Float64",
    731            exp.DataType.Type.ENUM: "Enum",
    732            exp.DataType.Type.ENUM8: "Enum8",
    733            exp.DataType.Type.ENUM16: "Enum16",
    734            exp.DataType.Type.FIXEDSTRING: "FixedString",
    735            exp.DataType.Type.FLOAT: "Float32",
    736            exp.DataType.Type.INT: "Int32",
    737            exp.DataType.Type.MEDIUMINT: "Int32",
    738            exp.DataType.Type.INT128: "Int128",
    739            exp.DataType.Type.INT256: "Int256",
    740            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    741            exp.DataType.Type.MAP: "Map",
    742            exp.DataType.Type.NESTED: "Nested",
    743            exp.DataType.Type.NULLABLE: "Nullable",
    744            exp.DataType.Type.SMALLINT: "Int16",
    745            exp.DataType.Type.STRUCT: "Tuple",
    746            exp.DataType.Type.TINYINT: "Int8",
    747            exp.DataType.Type.UBIGINT: "UInt64",
    748            exp.DataType.Type.UINT: "UInt32",
    749            exp.DataType.Type.UINT128: "UInt128",
    750            exp.DataType.Type.UINT256: "UInt256",
    751            exp.DataType.Type.USMALLINT: "UInt16",
    752            exp.DataType.Type.UTINYINT: "UInt8",
    753            exp.DataType.Type.IPV4: "IPv4",
    754            exp.DataType.Type.IPV6: "IPv6",
    755            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    756            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    757        }
    758
    759        TRANSFORMS = {
    760            **generator.Generator.TRANSFORMS,
    761            exp.AnyValue: rename_func("any"),
    762            exp.ApproxDistinct: rename_func("uniq"),
    763            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    764            exp.ArraySize: rename_func("LENGTH"),
    765            exp.ArraySum: rename_func("arraySum"),
    766            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    767            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    768            exp.Array: inline_array_sql,
    769            exp.CastToStrType: rename_func("CAST"),
    770            exp.CountIf: rename_func("countIf"),
    771            exp.CompressColumnConstraint: lambda self,
    772            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    773            exp.ComputedColumnConstraint: lambda self,
    774            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    775            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    776            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
    777            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
    778            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
    779            exp.Explode: rename_func("arrayJoin"),
    780            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    781            exp.IsNan: rename_func("isNaN"),
    782            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    783            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    784            exp.JSONPathKey: json_path_key_only_name,
    785            exp.JSONPathRoot: lambda *_: "",
    786            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    787            exp.Nullif: rename_func("nullIf"),
    788            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    789            exp.Pivot: no_pivot_sql,
    790            exp.Quantile: _quantile_sql,
    791            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    792            exp.Rand: rename_func("randCanonical"),
    793            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    794            exp.StartsWith: rename_func("startsWith"),
    795            exp.StrPosition: lambda self, e: self.func(
    796                "position", e.this, e.args.get("substr"), e.args.get("position")
    797            ),
    798            exp.TimeToStr: lambda self, e: self.func(
    799                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    800            ),
    801            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
    802            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
    803            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    804            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    805            exp.MD5Digest: rename_func("MD5"),
    806            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
    807            exp.SHA: rename_func("SHA1"),
    808            exp.SHA2: sha256_sql,
    809            exp.UnixToTime: _unix_to_time_sql,
    810            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
    811            exp.Variance: rename_func("varSamp"),
    812            exp.Stddev: rename_func("stddevSamp"),
    813        }
    814
    815        PROPERTIES_LOCATION = {
    816            **generator.Generator.PROPERTIES_LOCATION,
    817            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    818            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    819            exp.OnCluster: exp.Properties.Location.POST_NAME,
    820        }
    821
    822        # there's no list in docs, but it can be found in Clickhouse code
    823        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    824        ON_CLUSTER_TARGETS = {
    825            "DATABASE",
    826            "TABLE",
    827            "VIEW",
    828            "DICTIONARY",
    829            "INDEX",
    830            "FUNCTION",
    831            "NAMED COLLECTION",
    832        }
    833
    834        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    835            this = self.json_path_part(expression.this)
    836            return str(int(this) + 1) if is_int(this) else this
    837
    838        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    839            return f"AS {self.sql(expression, 'this')}"
    840
    841        def _any_to_has(
    842            self,
    843            expression: exp.EQ | exp.NEQ,
    844            default: t.Callable[[t.Any], str],
    845            prefix: str = "",
    846        ) -> str:
    847            if isinstance(expression.left, exp.Any):
    848                arr = expression.left
    849                this = expression.right
    850            elif isinstance(expression.right, exp.Any):
    851                arr = expression.right
    852                this = expression.left
    853            else:
    854                return default(expression)
    855
    856            return prefix + self.func("has", arr.this.unnest(), this)
    857
    858        def eq_sql(self, expression: exp.EQ) -> str:
    859            return self._any_to_has(expression, super().eq_sql)
    860
    861        def neq_sql(self, expression: exp.NEQ) -> str:
    862            return self._any_to_has(expression, super().neq_sql, "NOT ")
    863
    864        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    865            # Manually add a flag to make the search case-insensitive
    866            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    867            return self.func("match", expression.this, regex)
    868
    869        def datatype_sql(self, expression: exp.DataType) -> str:
    870            # String is the standard ClickHouse type, every other variant is just an alias.
    871            # Additionally, any supplied length parameter will be ignored.
    872            #
    873            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    874            if expression.this in self.STRING_TYPE_MAPPING:
    875                return "String"
    876
    877            return super().datatype_sql(expression)
    878
    879        def cte_sql(self, expression: exp.CTE) -> str:
    880            if expression.args.get("scalar"):
    881                this = self.sql(expression, "this")
    882                alias = self.sql(expression, "alias")
    883                return f"{this} AS {alias}"
    884
    885            return super().cte_sql(expression)
    886
    887        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    888            return super().after_limit_modifiers(expression) + [
    889                (
    890                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    891                    if expression.args.get("settings")
    892                    else ""
    893                ),
    894                (
    895                    self.seg("FORMAT ") + self.sql(expression, "format")
    896                    if expression.args.get("format")
    897                    else ""
    898                ),
    899            ]
    900
    901        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    902            params = self.expressions(expression, key="params", flat=True)
    903            return self.func(expression.name, *expression.expressions) + f"({params})"
    904
    905        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    906            return self.func(expression.name, *expression.expressions)
    907
    908        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    909            return self.anonymousaggfunc_sql(expression)
    910
    911        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    912            return self.parameterizedagg_sql(expression)
    913
    914        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    915            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    916
    917        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    918            return f"ON CLUSTER {self.sql(expression, 'this')}"
    919
    920        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    921            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    922                exp.Properties.Location.POST_NAME
    923            ):
    924                this_name = self.sql(expression.this, "this")
    925                this_properties = " ".join(
    926                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    927                )
    928                this_schema = self.schema_columns_sql(expression.this)
    929                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    930
    931            return super().createable_sql(expression, locations)
    932
    933        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    934            this = self.indent(self.sql(expression, "this"))
    935            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    936
    937        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    938            this = self.sql(expression, "this")
    939            this = f" {this}" if this else ""
    940            expr = self.sql(expression, "expression")
    941            expr = f" {expr}" if expr else ""
    942            index_type = self.sql(expression, "index_type")
    943            index_type = f" TYPE {index_type}" if index_type else ""
    944            granularity = self.sql(expression, "granularity")
    945            granularity = f" GRANULARITY {granularity}" if granularity else ""
    946
    947            return f"INDEX{this}{expr}{index_type}{granularity}"
    948
    949        def partition_sql(self, expression: exp.Partition) -> str:
    950            return f"PARTITION {self.expressions(expression, flat=True)}"
    951
    952        def partitionid_sql(self, expression: exp.PartitionId) -> str:
    953            return f"ID {self.sql(expression.this)}"
    954
    955        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    956            return (
    957                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    958            )
    959
    960        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    961            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
  DATE_PART_MAPPING
  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        AGG_FUNC_MAPPING = (
    337            lambda functions, suffixes: {
    338                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    339            }
    340        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    341
    342        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    343
    344        FUNCTION_PARSERS = {
    345            **parser.Parser.FUNCTION_PARSERS,
    346            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    347            "QUANTILE": lambda self: self._parse_quantile(),
    348        }
    349
    350        FUNCTION_PARSERS.pop("MATCH")
    351
    352        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    353        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    354
    355        RANGE_PARSERS = {
    356            **parser.Parser.RANGE_PARSERS,
    357            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    358            and self._parse_in(this, is_global=True),
    359        }
    360
    361        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    362        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    363        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    364        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    365
    366        JOIN_KINDS = {
    367            *parser.Parser.JOIN_KINDS,
    368            TokenType.ANY,
    369            TokenType.ASOF,
    370            TokenType.ARRAY,
    371        }
    372
    373        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    374            TokenType.ANY,
    375            TokenType.ARRAY,
    376            TokenType.FINAL,
    377            TokenType.FORMAT,
    378            TokenType.SETTINGS,
    379        }
    380
    381        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
    382            TokenType.FORMAT,
    383        }
    384
    385        LOG_DEFAULTS_TO_LN = True
    386
    387        QUERY_MODIFIER_PARSERS = {
    388            **parser.Parser.QUERY_MODIFIER_PARSERS,
    389            TokenType.SETTINGS: lambda self: (
    390                "settings",
    391                self._advance() or self._parse_csv(self._parse_assignment),
    392            ),
    393            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    394        }
    395
    396        CONSTRAINT_PARSERS = {
    397            **parser.Parser.CONSTRAINT_PARSERS,
    398            "INDEX": lambda self: self._parse_index_constraint(),
    399            "CODEC": lambda self: self._parse_compress(),
    400        }
    401
    402        ALTER_PARSERS = {
    403            **parser.Parser.ALTER_PARSERS,
    404            "REPLACE": lambda self: self._parse_alter_table_replace(),
    405        }
    406
    407        SCHEMA_UNNAMED_CONSTRAINTS = {
    408            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
    409            "INDEX",
    410        }
    411
    412        def _parse_extract(self) -> exp.Extract | exp.Anonymous:
    413            index = self._index
    414            this = self._parse_bitwise()
    415            if self._match(TokenType.FROM):
    416                self._retreat(index)
    417                return super()._parse_extract()
    418
    419            # We return Anonymous here because extract and regexpExtract have different semantics,
    420            # so parsing extract(foo, bar) into RegexpExtract can potentially break queries. E.g.,
    421            # `extract('foobar', 'b')` works, but CH crashes for `regexpExtract('foobar', 'b')`.
    422            #
    423            # TODO: can we somehow convert the former into an equivalent `regexpExtract` call?
    424            self._match(TokenType.COMMA)
    425            return self.expression(
    426                exp.Anonymous, this="extract", expressions=[this, self._parse_bitwise()]
    427            )
    428
    429        def _parse_assignment(self) -> t.Optional[exp.Expression]:
    430            this = super()._parse_assignment()
    431
    432            if self._match(TokenType.PLACEHOLDER):
    433                return self.expression(
    434                    exp.If,
    435                    this=this,
    436                    true=self._parse_assignment(),
    437                    false=self._match(TokenType.COLON) and self._parse_assignment(),
    438                )
    439
    440            return this
    441
    442        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    443            """
    444            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    445            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    446            """
    447            if not self._match(TokenType.L_BRACE):
    448                return None
    449
    450            this = self._parse_id_var()
    451            self._match(TokenType.COLON)
    452            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    453                self._match_text_seq("IDENTIFIER") and "Identifier"
    454            )
    455
    456            if not kind:
    457                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    458            elif not self._match(TokenType.R_BRACE):
    459                self.raise_error("Expecting }")
    460
    461            return self.expression(exp.Placeholder, this=this, kind=kind)
    462
    463        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    464            this = super()._parse_in(this)
    465            this.set("is_global", is_global)
    466            return this
    467
    468        def _parse_table(
    469            self,
    470            schema: bool = False,
    471            joins: bool = False,
    472            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    473            parse_bracket: bool = False,
    474            is_db_reference: bool = False,
    475            parse_partition: bool = False,
    476        ) -> t.Optional[exp.Expression]:
    477            this = super()._parse_table(
    478                schema=schema,
    479                joins=joins,
    480                alias_tokens=alias_tokens,
    481                parse_bracket=parse_bracket,
    482                is_db_reference=is_db_reference,
    483            )
    484
    485            if self._match(TokenType.FINAL):
    486                this = self.expression(exp.Final, this=this)
    487
    488            return this
    489
    490        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    491            return super()._parse_position(haystack_first=True)
    492
    493        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    494        def _parse_cte(self) -> exp.CTE:
    495            # WITH <identifier> AS <subquery expression>
    496            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
    497
    498            if not cte:
    499                # WITH <expression> AS <identifier>
    500                cte = self.expression(
    501                    exp.CTE,
    502                    this=self._parse_assignment(),
    503                    alias=self._parse_table_alias(),
    504                    scalar=True,
    505                )
    506
    507            return cte
    508
    509        def _parse_join_parts(
    510            self,
    511        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    512            is_global = self._match(TokenType.GLOBAL) and self._prev
    513            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    514
    515            if kind_pre:
    516                kind = self._match_set(self.JOIN_KINDS) and self._prev
    517                side = self._match_set(self.JOIN_SIDES) and self._prev
    518                return is_global, side, kind
    519
    520            return (
    521                is_global,
    522                self._match_set(self.JOIN_SIDES) and self._prev,
    523                self._match_set(self.JOIN_KINDS) and self._prev,
    524            )
    525
    526        def _parse_join(
    527            self, skip_join_token: bool = False, parse_bracket: bool = False
    528        ) -> t.Optional[exp.Join]:
    529            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    530            if join:
    531                join.set("global", join.args.pop("method", None))
    532
    533            return join
    534
    535        def _parse_function(
    536            self,
    537            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    538            anonymous: bool = False,
    539            optional_parens: bool = True,
    540            any_token: bool = False,
    541        ) -> t.Optional[exp.Expression]:
    542            expr = super()._parse_function(
    543                functions=functions,
    544                anonymous=anonymous,
    545                optional_parens=optional_parens,
    546                any_token=any_token,
    547            )
    548
    549            func = expr.this if isinstance(expr, exp.Window) else expr
    550
    551            # Aggregate functions can be split in 2 parts: <func_name><suffix>
    552            parts = (
    553                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
    554            )
    555
    556            if parts:
    557                params = self._parse_func_params(func)
    558
    559                kwargs = {
    560                    "this": func.this,
    561                    "expressions": func.expressions,
    562                }
    563                if parts[1]:
    564                    kwargs["parts"] = parts
    565                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
    566                else:
    567                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
    568
    569                kwargs["exp_class"] = exp_class
    570                if params:
    571                    kwargs["params"] = params
    572
    573                func = self.expression(**kwargs)
    574
    575                if isinstance(expr, exp.Window):
    576                    # The window's func was parsed as Anonymous in base parser, fix its
    577                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
    578                    expr.set("this", func)
    579                elif params:
    580                    # Params have blocked super()._parse_function() from parsing the following window
    581                    # (if that exists) as they're standing between the function call and the window spec
    582                    expr = self._parse_window(func)
    583                else:
    584                    expr = func
    585
    586            return expr
    587
    588        def _parse_func_params(
    589            self, this: t.Optional[exp.Func] = None
    590        ) -> t.Optional[t.List[exp.Expression]]:
    591            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    592                return self._parse_csv(self._parse_lambda)
    593
    594            if self._match(TokenType.L_PAREN):
    595                params = self._parse_csv(self._parse_lambda)
    596                self._match_r_paren(this)
    597                return params
    598
    599            return None
    600
    601        def _parse_quantile(self) -> exp.Quantile:
    602            this = self._parse_lambda()
    603            params = self._parse_func_params()
    604            if params:
    605                return self.expression(exp.Quantile, this=params[0], quantile=this)
    606            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    607
    608        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    609            return super()._parse_wrapped_id_vars(optional=True)
    610
    611        def _parse_primary_key(
    612            self, wrapped_optional: bool = False, in_props: bool = False
    613        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    614            return super()._parse_primary_key(
    615                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    616            )
    617
    618        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    619            index = self._index
    620            if self._match_text_seq("CLUSTER"):
    621                this = self._parse_id_var()
    622                if this:
    623                    return self.expression(exp.OnCluster, this=this)
    624                else:
    625                    self._retreat(index)
    626            return None
    627
    628        def _parse_index_constraint(
    629            self, kind: t.Optional[str] = None
    630        ) -> exp.IndexColumnConstraint:
    631            # INDEX name1 expr TYPE type1(args) GRANULARITY value
    632            this = self._parse_id_var()
    633            expression = self._parse_assignment()
    634
    635            index_type = self._match_text_seq("TYPE") and (
    636                self._parse_function() or self._parse_var()
    637            )
    638
    639            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
    640
    641            return self.expression(
    642                exp.IndexColumnConstraint,
    643                this=this,
    644                expression=expression,
    645                index_type=index_type,
    646                granularity=granularity,
    647            )
    648
    649        def _parse_partition(self) -> t.Optional[exp.Partition]:
    650            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    651            if not self._match(TokenType.PARTITION):
    652                return None
    653
    654            if self._match_text_seq("ID"):
    655                # Corresponds to the PARTITION ID <string_value> syntax
    656                expressions: t.List[exp.Expression] = [
    657                    self.expression(exp.PartitionId, this=self._parse_string())
    658                ]
    659            else:
    660                expressions = self._parse_expressions()
    661
    662            return self.expression(exp.Partition, expressions=expressions)
    663
    664        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
    665            partition = self._parse_partition()
    666
    667            if not partition or not self._match(TokenType.FROM):
    668                return None
    669
    670            return self.expression(
    671                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
    672            )
    673
    674        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
    675            if not self._match_text_seq("PROJECTION"):
    676                return None
    677
    678            return self.expression(
    679                exp.ProjectionDef,
    680                this=self._parse_id_var(),
    681                expression=self._parse_wrapped(self._parse_statement),
    682            )
    683
    684        def _parse_constraint(self) -> t.Optional[exp.Expression]:
    685            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'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quarter'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_I_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpILike'>>, 'REGEXP_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'REGEXP_REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpReplace'>>, 'REGEXP_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpSplit'>>, 'REPEAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Repeat'>>, 'RIGHT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Right'>>, 'ROUND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Round'>>, 'ROW_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RowNumber'>>, 'SHA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA2'>>, 'SAFE_DIVIDE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SafeDivide'>>, 'SIGN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SIGNUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SORT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SortArray'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Split'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sqrt'>>, 'STANDARD_HASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StandardHash'>>, 'STAR_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StarMap'>>, 'STARTS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STARTSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STDDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToDate'>>, 'STR_TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToMap'>>, 'STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToTime'>>, 'STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToUnix'>>, '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>>, 'MOD': <function build_mod>, '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 = {'cramersV', 'uniq', 'boundingRatio', 'quantilesTimingWeighted', 'max', 'kolmogorovSmirnovTest', 'sumMap', 'quantilesTiming', 'uniqCombined64', 'skewSamp', 'categoricalInformationValue', 'uniqCombined', 'quantilesExact', 'exponentialMovingAverage', 'skewPop', 'groupArraySample', 'sumCount', 'first_value', 'sumWithOverflow', 'groupBitAnd', 'quantilesExactWeighted', 'studentTTest', 'topKWeighted', 'quantilesBFloat16Weighted', 'quantileGK', 'quantilesExactLow', 'quantileDeterministic', 'stddevPop', 'quantile', 'quantileTiming', 'meanZTest', 'quantileExactHigh', 'topK', 'largestTriangleThreeBuckets', 'quantilesTDigestWeighted', 'windowFunnel', 'groupArrayInsertAt', 'quantileTDigest', 'kurtPop', 'maxIntersections', 'maxMap', 'groupBitXor', 'quantileExactWeighted', 'entropy', 'sum', 'avgWeighted', 'quantilesDeterministic', 'uniqTheta', 'sequenceCount', 'simpleLinearRegression', 'quantileTimingWeighted', 'welchTTest', 'argMax', 'covarSamp', 'quantileInterpolatedWeighted', 'argMin', 'kurtSamp', 'uniqExact', 'sequenceNextNode', 'quantilesTDigest', 'histogram', 'varSamp', 'quantilesExactHigh', 'uniqUpTo', 'quantileBFloat16', 'groupArrayLast', 'groupBitOr', 'groupBitmapAnd', 'quantileExact', 'maxIntersectionsPosition', 'exponentialTimeDecayedAvg', 'mannWhitneyUTest', 'last_value', 'quantilesBFloat16', 'quantilesInterpolatedWeighted', 'varPop', 'stochasticLogisticRegression', 'corr', 'groupBitmapOr', 'deltaSum', 'rankCorr', 'anyLast', 'covarPop', 'any', 'groupBitmapXor', 'retention', 'quantileTDigestWeighted', 'contingency', 'quantileBFloat16Weighted', 'sequenceMatch', 'quantiles', 'theilsU', 'stddevSamp', 'groupArrayMovingSum', 'cramersVBiasCorrected', 'anyHeavy', 'groupArrayMovingAvg', 'intervalLengthSum', 'avg', 'groupArray', 'sumKahan', 'minMap', 'quantilesGK', 'stochasticLinearRegression', 'sparkBar', 'uniqHLL12', 'median', 'min', 'count', 'groupBitmap', 'groupUniqArray', 'deltaSumTimestamp', 'quantileExactLow'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
FUNC_TOKENS = {<TokenType.VARBINARY: 'VARBINARY'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SOME: 'SOME'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.XML: 'XML'>, <TokenType.JSONB: 'JSONB'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.YEAR: 'YEAR'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.CHAR: 'CHAR'>, <TokenType.INT128: 'INT128'>, <TokenType.INT: 'INT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.ROW: 'ROW'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.IPV6: 'IPV6'>, <TokenType.INDEX: 'INDEX'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.BIT: 'BIT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.FILTER: 'FILTER'>, <TokenType.DATE32: 'DATE32'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.MAP: 'MAP'>, <TokenType.UUID: 'UUID'>, <TokenType.ANY: 'ANY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.ENUM: 'ENUM'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.SET: 'SET'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UINT256: 'UINT256'>, <TokenType.JSON: 'JSON'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.GLOB: 'GLOB'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.IPV4: 'IPV4'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NULL: 'NULL'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.LIKE: 'LIKE'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.LIST: 'LIST'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.RANGE: 'RANGE'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.UINT128: 'UINT128'>, <TokenType.INSERT: 'INSERT'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.DATE: 'DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.INT256: 'INT256'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.UINT: 'UINT'>, <TokenType.NAME: 'NAME'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.TIME: 'TIME'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.VAR: 'VAR'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TEXT: 'TEXT'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.BINARY: 'BINARY'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.XOR: 'XOR'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.MERGE: 'MERGE'>}
AGG_FUNC_MAPPING = {'cramersVIf': ('cramersV', 'If'), 'uniqIf': ('uniq', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'maxIf': ('max', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'sumMapIf': ('sumMap', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'skewPopIf': ('skewPop', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'sumCountIf': ('sumCount', 'If'), 'first_valueIf': ('first_value', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'quantileIf': ('quantile', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'topKIf': ('topK', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'windowFunnelIf': ('windowFunnel', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'maxMapIf': ('maxMap', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'entropyIf': ('entropy', 'If'), 'sumIf': ('sum', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'sequenceCountIf': ('sequenceCount', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'argMaxIf': ('argMax', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'argMinIf': ('argMin', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'sequenceNextNodeIf': ('sequenceNextNode', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'histogramIf': ('histogram', 'If'), 'varSampIf': ('varSamp', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'uniqUpToIf': ('uniqUpTo', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'exponentialTimeDecayedAvgIf': ('exponentialTimeDecayedAvg', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'last_valueIf': ('last_value', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'varPopIf': ('varPop', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'corrIf': ('corr', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'anyLastIf': ('anyLast', 'If'), 'covarPopIf': ('covarPop', 'If'), 'anyIf': ('any', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'retentionIf': ('retention', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'contingencyIf': ('contingency', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'sequenceMatchIf': ('sequenceMatch', 'If'), 'quantilesIf': ('quantiles', 'If'), 'theilsUIf': ('theilsU', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'avgIf': ('avg', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'minMapIf': ('minMap', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'medianIf': ('median', 'If'), 'minIf': ('min', 'If'), 'countIf': ('count', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'cramersVArray': ('cramersV', 'Array'), 'uniqArray': ('uniq', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'maxArray': ('max', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'quantileArray': ('quantile', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'topKArray': ('topK', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'windowFunnelArray': ('windowFunnel', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'entropyArray': ('entropy', 'Array'), 'sumArray': ('sum', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'sequenceCountArray': ('sequenceCount', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'argMinArray': ('argMin', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'sequenceNextNodeArray': ('sequenceNextNode', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'histogramArray': ('histogram', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'uniqUpToArray': ('uniqUpTo', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'exponentialTimeDecayedAvgArray': ('exponentialTimeDecayedAvg', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'varPopArray': ('varPop', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'corrArray': ('corr', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'anyArray': ('any', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'retentionArray': ('retention', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'sequenceMatchArray': ('sequenceMatch', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'avgArray': ('avg', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'minMapArray': ('minMap', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'medianArray': ('median', 'Array'), 'minArray': ('min', 'Array'), 'countArray': ('count', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'windowFunnelArrayIf': ('windowFunnel', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'sequenceCountArrayIf': ('sequenceCount', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'sequenceNextNodeArrayIf': ('sequenceNextNode', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'histogramArrayIf': ('histogram', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'uniqUpToArrayIf': ('uniqUpTo', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'exponentialTimeDecayedAvgArrayIf': ('exponentialTimeDecayedAvg', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'retentionArrayIf': ('retention', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'sequenceMatchArrayIf': ('sequenceMatch', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'cramersVMap': ('cramersV', 'Map'), 'uniqMap': ('uniq', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'maxMap': ('maxMap', ''), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'quantileMap': ('quantile', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'topKMap': ('topK', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'windowFunnelMap': ('windowFunnel', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'entropyMap': ('entropy', 'Map'), 'sumMap': ('sumMap', ''), 'avgWeightedMap': ('avgWeighted', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'sequenceCountMap': ('sequenceCount', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'argMinMap': ('argMin', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'sequenceNextNodeMap': ('sequenceNextNode', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'histogramMap': ('histogram', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'uniqUpToMap': ('uniqUpTo', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'exponentialTimeDecayedAvgMap': ('exponentialTimeDecayedAvg', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'varPopMap': ('varPop', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'corrMap': ('corr', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'anyMap': ('any', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'retentionMap': ('retention', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'sequenceMatchMap': ('sequenceMatch', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'avgMap': ('avg', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'minMapMap': ('minMap', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'medianMap': ('median', 'Map'), 'minMap': ('minMap', ''), 'countMap': ('count', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'windowFunnelSimpleState': ('windowFunnel', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'sequenceCountSimpleState': ('sequenceCount', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'sequenceNextNodeSimpleState': ('sequenceNextNode', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'histogramSimpleState': ('histogram', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'uniqUpToSimpleState': ('uniqUpTo', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'exponentialTimeDecayedAvgSimpleState': ('exponentialTimeDecayedAvg', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'retentionSimpleState': ('retention', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'sequenceMatchSimpleState': ('sequenceMatch', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'cramersVState': ('cramersV', 'State'), 'uniqState': ('uniq', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'maxState': ('max', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'sumMapState': ('sumMap', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'skewSampState': ('skewSamp', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'skewPopState': ('skewPop', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'sumCountState': ('sumCount', 'State'), 'first_valueState': ('first_value', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'quantileState': ('quantile', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'topKState': ('topK', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'windowFunnelState': ('windowFunnel', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'maxMapState': ('maxMap', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'entropyState': ('entropy', 'State'), 'sumState': ('sum', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'sequenceCountState': ('sequenceCount', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'argMaxState': ('argMax', 'State'), 'covarSampState': ('covarSamp', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'argMinState': ('argMin', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'sequenceNextNodeState': ('sequenceNextNode', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'histogramState': ('histogram', 'State'), 'varSampState': ('varSamp', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'uniqUpToState': ('uniqUpTo', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'exponentialTimeDecayedAvgState': ('exponentialTimeDecayedAvg', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'last_valueState': ('last_value', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'varPopState': ('varPop', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'corrState': ('corr', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'anyLastState': ('anyLast', 'State'), 'covarPopState': ('covarPop', 'State'), 'anyState': ('any', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'retentionState': ('retention', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'contingencyState': ('contingency', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'sequenceMatchState': ('sequenceMatch', 'State'), 'quantilesState': ('quantiles', 'State'), 'theilsUState': ('theilsU', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'avgState': ('avg', 'State'), 'groupArrayState': ('groupArray', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'minMapState': ('minMap', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'medianState': ('median', 'State'), 'minState': ('min', 'State'), 'countState': ('count', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'cramersVMerge': ('cramersV', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'maxMerge': ('max', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'windowFunnelMerge': ('windowFunnel', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'sequenceCountMerge': ('sequenceCount', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'sequenceNextNodeMerge': ('sequenceNextNode', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'histogramMerge': ('histogram', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'uniqUpToMerge': ('uniqUpTo', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'exponentialTimeDecayedAvgMerge': ('exponentialTimeDecayedAvg', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'anyMerge': ('any', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'retentionMerge': ('retention', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'sequenceMatchMerge': ('sequenceMatch', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'medianMerge': ('median', 'Merge'), 'minMerge': ('min', 'Merge'), 'countMerge': ('count', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'windowFunnelMergeState': ('windowFunnel', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'sequenceCountMergeState': ('sequenceCount', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'sequenceNextNodeMergeState': ('sequenceNextNode', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'histogramMergeState': ('histogram', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'uniqUpToMergeState': ('uniqUpTo', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'exponentialTimeDecayedAvgMergeState': ('exponentialTimeDecayedAvg', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'retentionMergeState': ('retention', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'sequenceMatchMergeState': ('sequenceMatch', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'cramersVForEach': ('cramersV', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'windowFunnelForEach': ('windowFunnel', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'sequenceCountForEach': ('sequenceCount', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'sequenceNextNodeForEach': ('sequenceNextNode', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'histogramForEach': ('histogram', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'uniqUpToForEach': ('uniqUpTo', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'exponentialTimeDecayedAvgForEach': ('exponentialTimeDecayedAvg', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'retentionForEach': ('retention', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'sequenceMatchForEach': ('sequenceMatch', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'windowFunnelDistinct': ('windowFunnel', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'sequenceCountDistinct': ('sequenceCount', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'sequenceNextNodeDistinct': ('sequenceNextNode', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'histogramDistinct': ('histogram', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'uniqUpToDistinct': ('uniqUpTo', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'exponentialTimeDecayedAvgDistinct': ('exponentialTimeDecayedAvg', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'retentionDistinct': ('retention', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'sequenceMatchDistinct': ('sequenceMatch', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'windowFunnelOrDefault': ('windowFunnel', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'sequenceCountOrDefault': ('sequenceCount', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'sequenceNextNodeOrDefault': ('sequenceNextNode', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'histogramOrDefault': ('histogram', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'uniqUpToOrDefault': ('uniqUpTo', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'exponentialTimeDecayedAvgOrDefault': ('exponentialTimeDecayedAvg', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'retentionOrDefault': ('retention', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'sequenceMatchOrDefault': ('sequenceMatch', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'windowFunnelOrNull': ('windowFunnel', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'sequenceCountOrNull': ('sequenceCount', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'sequenceNextNodeOrNull': ('sequenceNextNode', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'histogramOrNull': ('histogram', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'uniqUpToOrNull': ('uniqUpTo', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'exponentialTimeDecayedAvgOrNull': ('exponentialTimeDecayedAvg', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'retentionOrNull': ('retention', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'sequenceMatchOrNull': ('sequenceMatch', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'cramersVResample': ('cramersV', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'maxResample': ('max', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'topKResample': ('topK', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'windowFunnelResample': ('windowFunnel', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'sumResample': ('sum', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'sequenceCountResample': ('sequenceCount', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'sequenceNextNodeResample': ('sequenceNextNode', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'histogramResample': ('histogram', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'uniqUpToResample': ('uniqUpTo', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'exponentialTimeDecayedAvgResample': ('exponentialTimeDecayedAvg', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'corrResample': ('corr', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'anyResample': ('any', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'retentionResample': ('retention', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'sequenceMatchResample': ('sequenceMatch', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'avgResample': ('avg', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'medianResample': ('median', 'Resample'), 'minResample': ('min', 'Resample'), 'countResample': ('count', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'windowFunnelArgMin': ('windowFunnel', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'sequenceCountArgMin': ('sequenceCount', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'sequenceNextNodeArgMin': ('sequenceNextNode', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'histogramArgMin': ('histogram', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'uniqUpToArgMin': ('uniqUpTo', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'exponentialTimeDecayedAvgArgMin': ('exponentialTimeDecayedAvg', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'retentionArgMin': ('retention', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'sequenceMatchArgMin': ('sequenceMatch', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'windowFunnelArgMax': ('windowFunnel', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'sequenceCountArgMax': ('sequenceCount', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'sequenceNextNodeArgMax': ('sequenceNextNode', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'histogramArgMax': ('histogram', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'uniqUpToArgMax': ('uniqUpTo', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'exponentialTimeDecayedAvgArgMax': ('exponentialTimeDecayedAvg', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'retentionArgMax': ('retention', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'sequenceMatchArgMax': ('sequenceMatch', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'cramersV': ('cramersV', ''), 'uniq': ('uniq', ''), 'boundingRatio': ('boundingRatio', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'max': ('max', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'quantilesTiming': ('quantilesTiming', ''), 'uniqCombined64': ('uniqCombined64', ''), 'skewSamp': ('skewSamp', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'uniqCombined': ('uniqCombined', ''), 'quantilesExact': ('quantilesExact', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'skewPop': ('skewPop', ''), 'groupArraySample': ('groupArraySample', ''), 'sumCount': ('sumCount', ''), 'first_value': ('first_value', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'groupBitAnd': ('groupBitAnd', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'studentTTest': ('studentTTest', ''), 'topKWeighted': ('topKWeighted', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'quantileGK': ('quantileGK', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'stddevPop': ('stddevPop', ''), 'quantile': ('quantile', ''), 'quantileTiming': ('quantileTiming', ''), 'meanZTest': ('meanZTest', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'topK': ('topK', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'windowFunnel': ('windowFunnel', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'quantileTDigest': ('quantileTDigest', ''), 'kurtPop': ('kurtPop', ''), 'maxIntersections': ('maxIntersections', ''), 'groupBitXor': ('groupBitXor', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'entropy': ('entropy', ''), 'sum': ('sum', ''), 'avgWeighted': ('avgWeighted', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'uniqTheta': ('uniqTheta', ''), 'sequenceCount': ('sequenceCount', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'welchTTest': ('welchTTest', ''), 'argMax': ('argMax', ''), 'covarSamp': ('covarSamp', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'argMin': ('argMin', ''), 'kurtSamp': ('kurtSamp', ''), 'uniqExact': ('uniqExact', ''), 'sequenceNextNode': ('sequenceNextNode', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'histogram': ('histogram', ''), 'varSamp': ('varSamp', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'uniqUpTo': ('uniqUpTo', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'groupArrayLast': ('groupArrayLast', ''), 'groupBitOr': ('groupBitOr', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'quantileExact': ('quantileExact', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'exponentialTimeDecayedAvg': ('exponentialTimeDecayedAvg', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'last_value': ('last_value', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'varPop': ('varPop', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'corr': ('corr', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'deltaSum': ('deltaSum', ''), 'rankCorr': ('rankCorr', ''), 'anyLast': ('anyLast', ''), 'covarPop': ('covarPop', ''), 'any': ('any', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'retention': ('retention', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'contingency': ('contingency', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'sequenceMatch': ('sequenceMatch', ''), 'quantiles': ('quantiles', ''), 'theilsU': ('theilsU', ''), 'stddevSamp': ('stddevSamp', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'anyHeavy': ('anyHeavy', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'avg': ('avg', ''), 'groupArray': ('groupArray', ''), 'sumKahan': ('sumKahan', ''), 'quantilesGK': ('quantilesGK', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'sparkBar': ('sparkBar', ''), 'uniqHLL12': ('uniqHLL12', ''), 'median': ('median', ''), 'min': ('min', ''), 'count': ('count', ''), 'groupBitmap': ('groupBitmap', ''), 'groupUniqArray': ('groupUniqArray', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'quantileExactLow': ('quantileExactLow', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'TUPLE', 'STRUCT'}
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.ASOF: 'ASOF'>, <TokenType.OUTER: 'OUTER'>, <TokenType.ANTI: 'ANTI'>, <TokenType.CROSS: 'CROSS'>, <TokenType.INNER: 'INNER'>, <TokenType.SEMI: 'SEMI'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.ANY: 'ANY'>, <TokenType.ARRAY: 'ARRAY'>}
TABLE_ALIAS_TOKENS = {<TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SOME: 'SOME'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.XML: 'XML'>, <TokenType.JSONB: 'JSONB'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.YEAR: 'YEAR'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.INT128: 'INT128'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.INT: 'INT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.NEXT: 'NEXT'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.ROW: 'ROW'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.IPV6: 'IPV6'>, <TokenType.INDEX: 'INDEX'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.BIT: 'BIT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.FILTER: 'FILTER'>, <TokenType.DATE32: 'DATE32'>, <TokenType.MAP: 'MAP'>, <TokenType.UUID: 'UUID'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.ENUM: 'ENUM'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TOP: 'TOP'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.IS: 'IS'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.COPY: 'COPY'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.SET: 'SET'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.FALSE: 'FALSE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UINT256: 'UINT256'>, <TokenType.JSON: 'JSON'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.SHOW: 'SHOW'>, <TokenType.IPV4: 'IPV4'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NULL: 'NULL'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.LIST: 'LIST'>, <TokenType.TAG: 'TAG'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.END: 'END'>, <TokenType.RANGE: 'RANGE'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TRUE: 'TRUE'>, <TokenType.DELETE: 'DELETE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.DATE: 'DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.LOAD: 'LOAD'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.INT256: 'INT256'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.DIV: 'DIV'>, <TokenType.UINT: 'UINT'>, <TokenType.CASE: 'CASE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.NAME: 'NAME'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.TIME: 'TIME'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.KILL: 'KILL'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.VAR: 'VAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.USE: 'USE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ASC: 'ASC'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TEXT: 'TEXT'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.MODEL: 'MODEL'>, <TokenType.VIEW: 'VIEW'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.BINARY: 'BINARY'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.DESC: 'DESC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BEGIN: 'BEGIN'>}
ALIAS_TOKENS = {<TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SOME: 'SOME'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.XML: 'XML'>, <TokenType.JSONB: 'JSONB'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.YEAR: 'YEAR'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.INT128: 'INT128'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.INT: 'INT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.ANTI: 'ANTI'>, <TokenType.NEXT: 'NEXT'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.SEMI: 'SEMI'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.ROW: 'ROW'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.IPV6: 'IPV6'>, <TokenType.INDEX: 'INDEX'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.APPLY: 'APPLY'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.BIT: 'BIT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.FILTER: 'FILTER'>, <TokenType.DATE32: 'DATE32'>, <TokenType.MAP: 'MAP'>, <TokenType.UUID: 'UUID'>, <TokenType.ANY: 'ANY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.ENUM: 'ENUM'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TOP: 'TOP'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.IS: 'IS'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.COPY: 'COPY'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.SET: 'SET'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.FALSE: 'FALSE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UINT256: 'UINT256'>, <TokenType.JSON: 'JSON'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.ASOF: 'ASOF'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.SHOW: 'SHOW'>, <TokenType.IPV4: 'IPV4'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NULL: 'NULL'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.LIST: 'LIST'>, <TokenType.TAG: 'TAG'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.END: 'END'>, <TokenType.RANGE: 'RANGE'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TRUE: 'TRUE'>, <TokenType.DELETE: 'DELETE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.FINAL: 'FINAL'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.DATE: 'DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.LOAD: 'LOAD'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.FULL: 'FULL'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.INT256: 'INT256'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.DIV: 'DIV'>, <TokenType.UINT: 'UINT'>, <TokenType.CASE: 'CASE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.NAME: 'NAME'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.TIME: 'TIME'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.KILL: 'KILL'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.VAR: 'VAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.USE: 'USE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ASC: 'ASC'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TEXT: 'TEXT'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.MODEL: 'MODEL'>, <TokenType.VIEW: 'VIEW'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.BINARY: 'BINARY'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.DESC: 'DESC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BEGIN: 'BEGIN'>}
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 = {'INDEX', 'LIKE', 'PRIMARY KEY', 'UNIQUE', 'PERIOD', 'FOREIGN KEY', 'CHECK', 'EXCLUDE'}
ID_VAR_TOKENS = {<TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.SOME: 'SOME'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.XML: 'XML'>, <TokenType.JSONB: 'JSONB'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.YEAR: 'YEAR'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.INT128: 'INT128'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.INT: 'INT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.ANTI: 'ANTI'>, <TokenType.NEXT: 'NEXT'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.SEMI: 'SEMI'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.ROW: 'ROW'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.IPV6: 'IPV6'>, <TokenType.INDEX: 'INDEX'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.APPLY: 'APPLY'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.BIT: 'BIT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.FILTER: 'FILTER'>, <TokenType.DATE32: 'DATE32'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.MAP: 'MAP'>, <TokenType.UUID: 'UUID'>, <TokenType.ANY: 'ANY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.ENUM: 'ENUM'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TOP: 'TOP'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.IS: 'IS'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TABLE: 'TABLE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.ALL: 'ALL'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.COPY: 'COPY'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.INET: 'INET'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.SET: 'SET'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.FALSE: 'FALSE'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UINT256: 'UINT256'>, <TokenType.JSON: 'JSON'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.ASOF: 'ASOF'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.SHOW: 'SHOW'>, <TokenType.IPV4: 'IPV4'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.NULL: 'NULL'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.LIST: 'LIST'>, <TokenType.TAG: 'TAG'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.END: 'END'>, <TokenType.RANGE: 'RANGE'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TRUE: 'TRUE'>, <TokenType.DELETE: 'DELETE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.FINAL: 'FINAL'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.DATE: 'DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.LOAD: 'LOAD'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.FULL: 'FULL'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.INT256: 'INT256'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.DIV: 'DIV'>, <TokenType.UINT: 'UINT'>, <TokenType.CASE: 'CASE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.NAME: 'NAME'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.TIME: 'TIME'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.KILL: 'KILL'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.VAR: 'VAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.USE: 'USE'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.ASC: 'ASC'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.CACHE: 'CACHE'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.TEXT: 'TEXT'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.MODEL: 'MODEL'>, <TokenType.VIEW: 'VIEW'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.BINARY: 'BINARY'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SUPER: 'SUPER'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.NESTED: 'NESTED'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.MERGE: 'MERGE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.DESC: 'DESC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BEGIN: 'BEGIN'>}
SHOW_TRIE: Dict = {}
SET_TRIE: Dict = {'GLOBAL': {0: True}, 'LOCAL': {0: True}, 'SESSION': {0: True}, 'TRANSACTION': {0: True}}

##### Inherited Members

sqlglot.parser.Parser
  Parser
  NO_PAREN_FUNCTIONS
  STRUCT_TYPE_TOKENS
  NESTED_TYPE_TOKENS
  ENUM_TYPE_TOKENS
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  RESERVED_TOKENS
  DB_CREATABLES
  CREATABLES
  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
  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

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

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

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

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

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

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

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

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

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

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

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

    879        def cte_sql(self, expression: exp.CTE) -> str:
    880            if expression.args.get("scalar"):
    881                this = self.sql(expression, "this")
    882                alias = self.sql(expression, "alias")
    883                return f"{this} AS {alias}"
    884
    885            return super().cte_sql(expression)

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

    887        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    888            return super().after_limit_modifiers(expression) + [
    889                (
    890                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    891                    if expression.args.get("settings")
    892                    else ""
    893                ),
    894                (
    895                    self.seg("FORMAT ") + self.sql(expression, "format")
    896                    if expression.args.get("format")
    897                    else ""
    898                ),
    899            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    937        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    938            this = self.sql(expression, "this")
    939            this = f" {this}" if this else ""
    940            expr = self.sql(expression, "expression")
    941            expr = f" {expr}" if expr else ""
    942            index_type = self.sql(expression, "index_type")
    943            index_type = f" TYPE {index_type}" if index_type else ""
    944            granularity = self.sql(expression, "granularity")
    945            granularity = f" GRANULARITY {granularity}" if granularity else ""
    946
    947            return f"INDEX{this}{expr}{index_type}{granularity}"

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

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

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

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

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

    955        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    956            return (
    957                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    958            )

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

    960        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
    961            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 = {'qualify': <function Generator.<lambda>>, 'windows': <function Generator.<lambda>>}

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  IGNORE_NULLS_IN_FUNC
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  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
  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