sqlglot.dialects.clickhouse API documentation

Edit on GitHub

# sqlglot.dialects.clickhouse

View Source

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

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

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

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

###### Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

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

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

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

##### Inherited Members

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

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

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

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

##### Inherited Members

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

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

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

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

###### Arguments:

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

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