sqlglot.dialects.clickhouse API documentation

Edit on GitHub

# sqlglot.dialects.clickhouse

View Source

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

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

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

###### Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

FORCE_EARLY_ALIAS_REF_EXPANSION = True

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

###### For example:

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

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

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

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

SUPPORTS_COLUMN_JOIN_MARKS = False

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

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

##### Inherited Members

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

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

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

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

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

Parser consumes a list of tokens produced by the Tokenizer and produces a parsed syntax tree.

###### Arguments:

- error_level: The desired error level. Default: ErrorLevel.IMMEDIATE
- error_message_context: The amount of context to capture from a query string when displaying the error message (in number of characters). Default: 100
- max_errors: Maximum number of error messages to include in a raised ParseError. This is only relevant if error_level is ErrorLevel.RAISE. Default: 3

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

##### Inherited Members

sqlglot.parser.Parser
  Parser
  NO_PAREN_FUNCTIONS
  STRUCT_TYPE_TOKENS
  NESTED_TYPE_TOKENS
  ENUM_TYPE_TOKENS
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  DB_CREATABLES
  CREATABLES
  INTERVAL_VARS
  ARRAY_CONSTRUCTORS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  CONJUNCTION
  ASSIGNMENT
  DISJUNCTION
  EQUALITY
  COMPARISON
  BITWISE
  TERM
  FACTOR
  EXPONENT
  TIMES
  TIMESTAMPS
  SET_OPERATIONS
  JOIN_METHODS
  JOIN_SIDES
  JOIN_HINTS
  LAMBDAS
  EXPRESSION_PARSERS
  STATEMENT_PARSERS
  UNARY_PARSERS
  STRING_PARSERS
  NUMERIC_PARSERS
  PRIMARY_PARSERS
  PLACEHOLDER_PARSERS
  PROPERTY_PARSERS
  ALTER_ALTER_PARSERS
  INVALID_FUNC_NAME_TOKENS
  KEY_VALUE_DEFINITIONS
  SET_PARSERS
  SHOW_PARSERS
  TYPE_LITERAL_PARSERS
  TYPE_CONVERTERS
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  CONFLICT_ACTIONS
  CREATE_SEQUENCE
  ISOLATED_LOADING_OPTIONS
  USABLES
  CAST_ACTIONS
  SCHEMA_BINDING_OPTIONS
  KEY_CONSTRAINT_OPTIONS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  HISTORICAL_DATA_PREFIX
  HISTORICAL_DATA_KIND
  OPCLASS_FOLLOW_KEYWORDS
  OPTYPE_FOLLOW_TOKENS
  TABLE_INDEX_HINT_TOKENS
  VIEW_ATTRIBUTES
  WINDOW_ALIAS_TOKENS
  WINDOW_BEFORE_PAREN_TOKENS
  WINDOW_SIDES
  JSON_KEY_VALUE_SEPARATOR_TOKENS
  FETCH_TOKENS
  ADD_CONSTRAINT_TOKENS
  DISTINCT_TOKENS
  NULL_TOKENS
  UNNEST_OFFSET_ALIAS_TOKENS
  SELECT_START_TOKENS
  COPY_INTO_VARLEN_OPTIONS
  STRICT_CAST
  PREFIXED_PIVOT_COLUMNS
  IDENTIFY_PIVOT_STRINGS
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
  TABLESAMPLE_CSV
  DEFAULT_SAMPLING_METHOD
  SET_REQUIRES_ASSIGNMENT_DELIMITER
  TRIM_PATTERN_FIRST
  STRING_ALIASES
  SET_OP_MODIFIERS
  NO_PAREN_IF_COMMANDS
  JSON_ARROWS_REQUIRE_JSON_TYPE
  COLON_IS_VARIANT_EXTRACT
  VALUES_FOLLOWED_BY_PAREN
  SUPPORTS_IMPLICIT_UNNEST
  SUPPORTS_PARTITION_SELECTION
  error_level
  error_message_context
  max_errors
  dialect
  reset
  parse
  parse_into
  check_errors
  raise_error
  expression
  validate_expression
  errors
  sql

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

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

Generator converts a given syntax tree to the corresponding SQL string.

###### Arguments:

- pretty: Whether to format the produced SQL string. Default: False.
- identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
- normalize: Whether to normalize identifiers to lowercase. Default: False.
- pad: The pad size in a formatted string. For example, this affects the indentation of a projection in a query, relative to its nesting level. Default: 2.
- indent: The indentation size in a formatted string. For example, this affects the indentation of subqueries and filters under a `WHERE` clause. Default: 2.
- normalize_functions: How to normalize function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
- unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
- max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
- leading_comma: Whether the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
- max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
- comments: Whether to preserve comments in the output SQL code. Default: True

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

    849        def strtodate_sql(self, expression: exp.StrToDate) -> str:
    850            strtodate_sql = self.function_fallback_sql(expression)
    851
    852            if not isinstance(expression.parent, exp.Cast):
    853                # StrToDate returns DATEs in other dialects (eg. postgres), so
    854                # this branch aims to improve the transpilation to clickhouse
    855                return f"CAST({strtodate_sql} AS DATE)"
    856
    857            return strtodate_sql

def cast_sql( self, expression: sqlglot.expressions.Cast, safe_prefix: Optional[str] = None) -> str: View Source

    859        def cast_sql(self, expression: exp.Cast, safe_prefix: t.Optional[str] = None) -> str:
    860            this = expression.this
    861
    862            if isinstance(this, exp.StrToDate) and expression.to == exp.DataType.build("datetime"):
    863                return self.sql(this)
    864
    865            return super().cast_sql(expression, safe_prefix=safe_prefix)

def likeproperty_sql(self, expression: sqlglot.expressions.LikeProperty) -> str: View Source

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

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

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

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

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

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

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

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

    902        def datatype_sql(self, expression: exp.DataType) -> str:
    903            # String is the standard ClickHouse type, every other variant is just an alias.
    904            # Additionally, any supplied length parameter will be ignored.
    905            #
    906            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    907            if expression.this in self.STRING_TYPE_MAPPING:
    908                return "String"
    909
    910            return super().datatype_sql(expression)

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

    912        def cte_sql(self, expression: exp.CTE) -> str:
    913            if expression.args.get("scalar"):
    914                this = self.sql(expression, "this")
    915                alias = self.sql(expression, "alias")
    916                return f"{this} AS {alias}"
    917
    918            return super().cte_sql(expression)

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

    920        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    921            return super().after_limit_modifiers(expression) + [
    922                (
    923                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    924                    if expression.args.get("settings")
    925                    else ""
    926                ),
    927                (
    928                    self.seg("FORMAT ") + self.sql(expression, "format")
    929                    if expression.args.get("format")
    930                    else ""
    931                ),
    932            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

    953        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    954            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    955                exp.Properties.Location.POST_NAME
    956            ):
    957                this_name = self.sql(expression.this, "this")
    958                this_properties = " ".join(
    959                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    960                )
    961                this_schema = self.schema_columns_sql(expression.this)
    962                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    963
    964            return super().createable_sql(expression, locations)

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

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

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

    970        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    971            this = self.sql(expression, "this")
    972            this = f" {this}" if this else ""
    973            expr = self.sql(expression, "expression")
    974            expr = f" {expr}" if expr else ""
    975            index_type = self.sql(expression, "index_type")
    976            index_type = f" TYPE {index_type}" if index_type else ""
    977            granularity = self.sql(expression, "granularity")
    978            granularity = f" GRANULARITY {granularity}" if granularity else ""
    979
    980            return f"INDEX{this}{expr}{index_type}{granularity}"

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

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

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

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

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

    988        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
    989            return (
    990                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
    991            )

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

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

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

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  IGNORE_NULLS_IN_FUNC
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  EXTRACT_ALLOWS_QUOTES
  TZ_TO_WITH_TIME_ZONE
  VALUES_AS_TABLE
  ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
  UNNEST_WITH_ORDINALITY
  AGGREGATE_FILTER_SUPPORTED
  SEMI_ANTI_JOIN_WITH_SIDE
  COMPUTED_COLUMN_WITH_TYPE
  SUPPORTS_TABLE_COPY
  TABLESAMPLE_WITH_METHOD
  TABLESAMPLE_SEED_KEYWORD
  COLLATE_IS_FUNC
  DATA_TYPE_SPECIFIERS_ALLOWED
  ENSURE_BOOLS
  CTE_RECURSIVE_KEYWORD_REQUIRED
  SUPPORTS_SINGLE_ARG_CONCAT
  UNPIVOT_ALIASES_ARE_IDENTIFIERS
  JSON_KEY_VALUE_PAIR_SEP
  INSERT_OVERWRITE
  SUPPORTS_SELECT_INTO
  SUPPORTS_UNLOGGED_TABLES
  SUPPORTS_CREATE_TABLE_LIKE
  LIKE_PROPERTY_INSIDE_SCHEMA
  MULTI_ARG_DISTINCT
  JSON_TYPE_REQUIRED_FOR_EXTRACTION
  JSON_PATH_BRACKETED_KEY_SUPPORTED
  JSON_PATH_SINGLE_QUOTE_ESCAPE
  COPY_PARAMS_ARE_WRAPPED
  COPY_PARAMS_EQ_REQUIRED
  COPY_HAS_INTO_KEYWORD
  STAR_EXCEPT
  HEX_FUNC
  WITH_PROPERTIES_PREFIX
  QUOTE_JSON_PATH
  PAD_FILL_PATTERN_IS_REQUIRED
  PARSE_JSON_NAME
  TIME_PART_SINGULARS
  TOKEN_MAPPING
  PARAMETER_TOKEN
  NAMED_PLACEHOLDER_TOKEN
  RESERVED_KEYWORDS
  WITH_SEPARATED_COMMENTS
  EXCLUDE_COMMENTS
  UNWRAPPED_INTERVAL_VALUES
  PARAMETERIZABLE_TEXT_TYPES
  EXPRESSIONS_WITHOUT_NESTED_CTES
  SENTINEL_LINE_BREAK
  pretty
  identify
  normalize
  pad
  unsupported_level
  max_unsupported
  leading_comma
  max_text_width
  comments
  dialect
  normalize_functions
  unsupported_messages
  generate
  preprocess
  unsupported
  sep
  seg
  pad_comment
  maybe_comment
  wrap
  no_identify
  normalize_func
  indent
  sql
  uncache_sql
  cache_sql
  characterset_sql
  column_parts
  column_sql
  columnposition_sql
  columndef_sql
  columnconstraint_sql
  computedcolumnconstraint_sql
  autoincrementcolumnconstraint_sql
  compresscolumnconstraint_sql
  generatedasidentitycolumnconstraint_sql
  generatedasrowcolumnconstraint_sql
  periodforsystemtimeconstraint_sql
  notnullcolumnconstraint_sql
  transformcolumnconstraint_sql
  primarykeycolumnconstraint_sql
  uniquecolumnconstraint_sql
  create_sql
  sequenceproperties_sql
  clone_sql
  describe_sql
  heredoc_sql
  prepend_ctes
  with_sql
  tablealias_sql
  bitstring_sql
  hexstring_sql
  bytestring_sql
  unicodestring_sql
  rawstring_sql
  datatypeparam_sql
  directory_sql
  delete_sql
  drop_sql
  except_sql
  except_op
  fetch_sql
  filter_sql
  hint_sql
  indexparameters_sql
  index_sql
  identifier_sql
  hex_sql
  lowerhex_sql
  inputoutputformat_sql
  national_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_name
  property_sql
  fallbackproperty_sql
  journalproperty_sql
  freespaceproperty_sql
  checksumproperty_sql
  mergeblockratioproperty_sql
  datablocksizeproperty_sql
  blockcompressionproperty_sql
  isolatedloadingproperty_sql
  partitionboundspec_sql
  partitionedofproperty_sql
  lockingproperty_sql
  withdataproperty_sql
  withsystemversioningproperty_sql
  insert_sql
  intersect_sql
  intersect_op
  introducer_sql
  kill_sql
  pseudotype_sql
  objectidentifier_sql
  onconflict_sql
  returning_sql
  rowformatdelimitedproperty_sql
  withtablehint_sql
  indextablehint_sql
  historicaldata_sql
  table_parts
  table_sql
  tablesample_sql
  pivot_sql
  version_sql
  tuple_sql
  update_sql
  values_sql
  var_sql
  into_sql
  from_sql
  group_sql
  having_sql
  connect_sql
  prior_sql
  join_sql
  lambda_sql
  lateral_op
  lateral_sql
  limit_sql
  offset_sql
  setitem_sql
  set_sql
  pragma_sql
  lock_sql
  literal_sql
  escape_str
  loaddata_sql
  null_sql
  boolean_sql
  order_sql
  withfill_sql
  cluster_sql
  distribute_sql
  sort_sql
  ordered_sql
  matchrecognizemeasure_sql
  matchrecognize_sql
  query_modifiers
  options_modifier
  queryoption_sql
  offset_limit_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  subquery_sql
  qualify_sql
  set_operations
  union_sql
  union_op
  unnest_sql
  where_sql
  window_sql
  partition_by_sql
  windowspec_sql
  withingroup_sql
  between_sql
  bracket_offset_expressions
  bracket_sql
  all_sql
  any_sql
  exists_sql
  case_sql
  constraint_sql
  nextvaluefor_sql
  extract_sql
  trim_sql
  convert_concat_args
  concat_sql
  concatws_sql
  check_sql
  foreignkey_sql
  primarykey_sql
  if_sql
  matchagainst_sql
  jsonkeyvalue_sql
  jsonpath_sql
  json_path_part
  formatjson_sql
  jsonobject_sql
  jsonobjectagg_sql
  jsonarray_sql
  jsonarrayagg_sql
  jsoncolumndef_sql
  jsonschema_sql
  jsontable_sql
  openjsoncolumndef_sql
  openjson_sql
  in_sql
  in_unnest_op
  interval_sql
  return_sql
  reference_sql
  anonymous_sql
  paren_sql
  neg_sql
  not_sql
  alias_sql
  pivotalias_sql
  aliases_sql
  atindex_sql
  attimezone_sql
  fromtimezone_sql
  add_sql
  and_sql
  or_sql
  xor_sql
  connector_sql
  bitwiseand_sql
  bitwiseleftshift_sql
  bitwisenot_sql
  bitwiseor_sql
  bitwiserightshift_sql
  bitwisexor_sql
  currentdate_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
  struct_sql
  partitionrange_sql
  truncatetable_sql
  convert_sql
  copyparameter_sql
  credentials_sql
  copy_sql
  semicolon_sql
  datadeletionproperty_sql
  maskingpolicycolumnconstraint_sql
  gapfill_sql
  scope_resolution
  scoperesolution_sql
  parsejson_sql
  rand_sql
  changes_sql
  pad_sql
  summarize_sql