Edit on GitHub

# sqlglot.dialects.clickhouse

View Source

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

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

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

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

###### Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

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

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

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

##### Inherited Members

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

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

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

COMMENTS = ['--', '#', '#!', ('/*', '*/')]
IDENTIFIERS = ['"', '`']
STRING_ESCAPES = ["'", '\\']
BIT_STRINGS = [('0b', '')]
HEX_STRINGS = [('0x', ''), ('0X', '')]
HEREDOC_STRINGS = ['$']
KEYWORDS = {'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, ':=': <TokenType.COLON_EQ: 'COLON_EQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'COPY': <TokenType.COPY: 'COPY'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'TRUNCATE': <TokenType.TRUNCATE: 'TRUNCATE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'UINT': <TokenType.UINT: 'UINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, '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'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATE32': <TokenType.DATE32: 'DATE32'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>, 'IPV4': <TokenType.IPV4: 'IPV4'>, 'IPV6': <TokenType.IPV6: 'IPV6'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, 'SYSTEM': <TokenType.COMMAND: 'COMMAND'>, 'PREWHERE': <TokenType.PREWHERE: 'PREWHERE'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, '#': <TokenType.HASH: 'HASH'>, "'": <TokenType.UNKNOWN: 'UNKNOWN'>, '`': <TokenType.UNKNOWN: 'UNKNOWN'>, '"': <TokenType.UNKNOWN: 'UNKNOWN'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}

##### Inherited Members

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

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

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

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

###### Arguments:

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

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

##### Inherited Members

sqlglot.parser.Parser
  Parser
  NO_PAREN_FUNCTIONS
  STRUCT_TYPE_TOKENS
  NESTED_TYPE_TOKENS
  ENUM_TYPE_TOKENS
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  RESERVED_TOKENS
  DB_CREATABLES
  CREATABLES
  ID_VAR_TOKENS
  INTERVAL_VARS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  CONJUNCTION
  EQUALITY
  COMPARISON
  BITWISE
  TERM
  FACTOR
  EXPONENT
  TIMES
  TIMESTAMPS
  SET_OPERATIONS
  JOIN_METHODS
  JOIN_SIDES
  JOIN_HINTS
  LAMBDAS
  EXPRESSION_PARSERS
  STATEMENT_PARSERS
  UNARY_PARSERS
  STRING_PARSERS
  NUMERIC_PARSERS
  PRIMARY_PARSERS
  PLACEHOLDER_PARSERS
  PROPERTY_PARSERS
  ALTER_ALTER_PARSERS
  INVALID_FUNC_NAME_TOKENS
  KEY_VALUE_DEFINITIONS
  SET_PARSERS
  SHOW_PARSERS
  TYPE_LITERAL_PARSERS
  TYPE_CONVERTER
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  CONFLICT_ACTIONS
  CREATE_SEQUENCE
  ISOLATED_LOADING_OPTIONS
  USABLES
  CAST_ACTIONS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  HISTORICAL_DATA_KIND
  OPCLASS_FOLLOW_KEYWORDS
  OPTYPE_FOLLOW_TOKENS
  TABLE_INDEX_HINT_TOKENS
  VIEW_ATTRIBUTES
  WINDOW_ALIAS_TOKENS
  WINDOW_BEFORE_PAREN_TOKENS
  WINDOW_SIDES
  JSON_KEY_VALUE_SEPARATOR_TOKENS
  FETCH_TOKENS
  ADD_CONSTRAINT_TOKENS
  DISTINCT_TOKENS
  NULL_TOKENS
  UNNEST_OFFSET_ALIAS_TOKENS
  SELECT_START_TOKENS
  STRICT_CAST
  PREFIXED_PIVOT_COLUMNS
  IDENTIFY_PIVOT_STRINGS
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
  TABLESAMPLE_CSV
  DEFAULT_SAMPLING_METHOD
  SET_REQUIRES_ASSIGNMENT_DELIMITER
  TRIM_PATTERN_FIRST
  STRING_ALIASES
  UNION_MODIFIERS
  NO_PAREN_IF_COMMANDS
  JSON_ARROWS_REQUIRE_JSON_TYPE
  COLON_IS_JSON_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

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

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

###### Arguments:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  IGNORE_NULLS_IN_FUNC
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  COLUMN_JOIN_MARKS_SUPPORTED
  EXTRACT_ALLOWS_QUOTES
  TZ_TO_WITH_TIME_ZONE
  VALUES_AS_TABLE
  ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
  UNNEST_WITH_ORDINALITY
  AGGREGATE_FILTER_SUPPORTED
  SEMI_ANTI_JOIN_WITH_SIDE
  COMPUTED_COLUMN_WITH_TYPE
  SUPPORTS_TABLE_COPY
  TABLESAMPLE_WITH_METHOD
  TABLESAMPLE_SEED_KEYWORD
  COLLATE_IS_FUNC
  DATA_TYPE_SPECIFIERS_ALLOWED
  ENSURE_BOOLS
  CTE_RECURSIVE_KEYWORD_REQUIRED
  SUPPORTS_SINGLE_ARG_CONCAT
  SUPPORTS_TABLE_ALIAS_COLUMNS
  UNPIVOT_ALIASES_ARE_IDENTIFIERS
  JSON_KEY_VALUE_PAIR_SEP
  INSERT_OVERWRITE
  SUPPORTS_SELECT_INTO
  SUPPORTS_UNLOGGED_TABLES
  SUPPORTS_CREATE_TABLE_LIKE
  LIKE_PROPERTY_INSIDE_SCHEMA
  MULTI_ARG_DISTINCT
  JSON_TYPE_REQUIRED_FOR_EXTRACTION
  JSON_PATH_BRACKETED_KEY_SUPPORTED
  JSON_PATH_SINGLE_QUOTE_ESCAPE
  COPY_PARAMS_ARE_WRAPPED
  COPY_PARAMS_EQ_REQUIRED
  COPY_HAS_INTO_KEYWORD
  STAR_EXCEPT
  HEX_FUNC
  WITH_PROPERTIES_PREFIX
  TIME_PART_SINGULARS
  TOKEN_MAPPING
  PARAMETER_TOKEN
  NAMED_PLACEHOLDER_TOKEN
  RESERVED_KEYWORDS
  WITH_SEPARATED_COMMENTS
  EXCLUDE_COMMENTS
  UNWRAPPED_INTERVAL_VALUES
  PARAMETERIZABLE_TEXT_TYPES
  EXPRESSIONS_WITHOUT_NESTED_CTES
  SENTINEL_LINE_BREAK
  pretty
  identify
  normalize
  pad
  unsupported_level
  max_unsupported
  leading_comma
  max_text_width
  comments
  dialect
  normalize_functions
  unsupported_messages
  generate
  preprocess
  unsupported
  sep
  seg
  pad_comment
  maybe_comment
  wrap
  no_identify
  normalize_func
  indent
  sql
  uncache_sql
  cache_sql
  characterset_sql
  column_parts
  column_sql
  columnposition_sql
  columndef_sql
  columnconstraint_sql
  computedcolumnconstraint_sql
  autoincrementcolumnconstraint_sql
  compresscolumnconstraint_sql
  generatedasidentitycolumnconstraint_sql
  generatedasrowcolumnconstraint_sql
  periodforsystemtimeconstraint_sql
  notnullcolumnconstraint_sql
  transformcolumnconstraint_sql
  primarykeycolumnconstraint_sql
  uniquecolumnconstraint_sql
  create_sql
  sequenceproperties_sql
  clone_sql
  describe_sql
  heredoc_sql
  prepend_ctes
  with_sql
  tablealias_sql
  bitstring_sql
  hexstring_sql
  bytestring_sql
  unicodestring_sql
  rawstring_sql
  datatypeparam_sql
  directory_sql
  delete_sql
  drop_sql
  except_sql
  except_op
  fetch_sql
  filter_sql
  hint_sql
  indexparameters_sql
  index_sql
  identifier_sql
  hex_sql
  lowerhex_sql
  inputoutputformat_sql
  national_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_name
  property_sql
  fallbackproperty_sql
  journalproperty_sql
  freespaceproperty_sql
  checksumproperty_sql
  mergeblockratioproperty_sql
  datablocksizeproperty_sql
  blockcompressionproperty_sql
  isolatedloadingproperty_sql
  partitionboundspec_sql
  partitionedofproperty_sql
  lockingproperty_sql
  withdataproperty_sql
  withsystemversioningproperty_sql
  insert_sql
  intersect_sql
  intersect_op
  introducer_sql
  kill_sql
  pseudotype_sql
  objectidentifier_sql
  onconflict_sql
  returning_sql
  rowformatdelimitedproperty_sql
  withtablehint_sql
  indextablehint_sql
  historicaldata_sql
  table_parts
  table_sql
  tablesample_sql
  pivot_sql
  version_sql
  tuple_sql
  update_sql
  values_sql
  var_sql
  into_sql
  from_sql
  group_sql
  having_sql
  connect_sql
  prior_sql
  join_sql
  lambda_sql
  lateral_op
  lateral_sql
  limit_sql
  offset_sql
  setitem_sql
  set_sql
  pragma_sql
  lock_sql
  literal_sql
  escape_str
  loaddata_sql
  null_sql
  boolean_sql
  order_sql
  withfill_sql
  cluster_sql
  distribute_sql
  sort_sql
  ordered_sql
  matchrecognizemeasure_sql
  matchrecognize_sql
  query_modifiers
  queryoption_sql
  offset_limit_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  subquery_sql
  qualify_sql
  set_operations
  union_sql
  union_op
  unnest_sql
  where_sql
  window_sql
  partition_by_sql
  windowspec_sql
  withingroup_sql
  between_sql
  bracket_offset_expressions
  bracket_sql
  all_sql
  any_sql
  exists_sql
  case_sql
  constraint_sql
  nextvaluefor_sql
  extract_sql
  trim_sql
  convert_concat_args
  concat_sql
  concatws_sql
  check_sql
  foreignkey_sql
  primarykey_sql
  if_sql
  matchagainst_sql
  jsonkeyvalue_sql
  jsonpath_sql
  json_path_part
  formatjson_sql
  jsonobject_sql
  jsonobjectagg_sql
  jsonarray_sql
  jsonarrayagg_sql
  jsoncolumndef_sql
  jsonschema_sql
  jsontable_sql
  openjsoncolumndef_sql
  openjson_sql
  in_sql
  in_unnest_op
  interval_sql
  return_sql
  reference_sql
  anonymous_sql
  paren_sql
  neg_sql
  not_sql
  alias_sql
  pivotalias_sql
  aliases_sql
  atindex_sql
  attimezone_sql
  fromtimezone_sql
  add_sql
  and_sql
  or_sql
  xor_sql
  connector_sql
  bitwiseand_sql
  bitwiseleftshift_sql
  bitwisenot_sql
  bitwiseor_sql
  bitwiserightshift_sql
  bitwisexor_sql
  cast_sql
  currentdate_sql
  currenttimestamp_sql
  collate_sql
  command_sql
  comment_sql
  mergetreettlaction_sql
  mergetreettl_sql
  transaction_sql
  commit_sql
  rollback_sql
  altercolumn_sql
  alterdiststyle_sql
  altersortkey_sql
  renametable_sql
  renamecolumn_sql
  alterset_sql
  altertable_sql
  add_column_sql
  droppartition_sql
  addconstraint_sql
  distinct_sql
  ignorenulls_sql
  respectnulls_sql
  havingmax_sql
  intdiv_sql
  dpipe_sql
  div_sql
  overlaps_sql
  distance_sql
  dot_sql
  propertyeq_sql
  escape_sql
  glob_sql
  gt_sql
  gte_sql
  ilike_sql
  ilikeany_sql
  is_sql
  like_sql
  likeany_sql
  similarto_sql
  lt_sql
  lte_sql
  mod_sql
  mul_sql
  nullsafeeq_sql
  nullsafeneq_sql
  slice_sql
  sub_sql
  trycast_sql
  try_sql
  log_sql
  use_sql
  binary
  function_fallback_sql
  func
  format_args
  too_wide
  format_time
  expressions
  op_expressions
  naked_property
  tag_sql
  token_sql
  userdefinedfunction_sql
  joinhint_sql
  kwarg_sql
  when_sql
  merge_sql
  tochar_sql
  tonumber_sql
  dictproperty_sql
  dictrange_sql
  dictsubproperty_sql
  clusteredbyproperty_sql
  anyvalue_sql
  querytransform_sql
  indexconstraintoption_sql
  checkcolumnconstraint_sql
  nvl2_sql
  comprehension_sql
  columnprefix_sql
  opclass_sql
  predict_sql
  forin_sql
  refresh_sql
  operator_sql
  toarray_sql
  tsordstotime_sql
  tsordstotimestamp_sql
  tsordstodate_sql
  unixdate_sql
  lastday_sql
  dateadd_sql
  arrayany_sql
  generateseries_sql
  struct_sql
  partitionrange_sql
  truncatetable_sql
  convert_sql
  copyparameter_sql
  credentials_sql
  copy_sql
  semicolon_sql
  datadeletionproperty_sql
  maskingpolicycolumnconstraint_sql