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    date_delta_sql,
     10    inline_array_sql,
     11    no_pivot_sql,
     12    rename_func,
     13    var_map_sql,
     14)
     15from sqlglot.errors import ParseError
     16from sqlglot.helper import seq_get
     17from sqlglot.parser import parse_var_map
     18from sqlglot.tokens import Token, TokenType
     19
     20
     21def _lower_func(sql: str) -> str:
     22    index = sql.index("(")
     23    return sql[:index].lower() + sql[index:]
     24
     25
     26def _quantile_sql(self: ClickHouse.Generator, e: exp.Quantile) -> str:
     27    quantile = e.args["quantile"]
     28    args = f"({self.sql(e, 'this')})"
     29
     30    if isinstance(quantile, exp.Array):
     31        func = self.func("quantiles", *quantile)
     32    else:
     33        func = self.func("quantile", quantile)
     34
     35    return func + args
     36
     37
     38def _parse_count_if(args: t.List) -> exp.CountIf | exp.CombinedAggFunc:
     39    if len(args) == 1:
     40        return exp.CountIf(this=seq_get(args, 0))
     41
     42    return exp.CombinedAggFunc(this="countIf", expressions=args, parts=("count", "If"))
     43
     44
     45class ClickHouse(Dialect):
     46    NORMALIZE_FUNCTIONS: bool | str = False
     47    NULL_ORDERING = "nulls_are_last"
     48    SUPPORTS_USER_DEFINED_TYPES = False
     49    SAFE_DIVISION = True
     50
     51    ESCAPE_SEQUENCES = {
     52        "\\0": "\0",
     53    }
     54
     55    class Tokenizer(tokens.Tokenizer):
     56        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     57        IDENTIFIERS = ['"', "`"]
     58        STRING_ESCAPES = ["'", "\\"]
     59        BIT_STRINGS = [("0b", "")]
     60        HEX_STRINGS = [("0x", ""), ("0X", "")]
     61        HEREDOC_STRINGS = ["$"]
     62
     63        KEYWORDS = {
     64            **tokens.Tokenizer.KEYWORDS,
     65            "ATTACH": TokenType.COMMAND,
     66            "DATE32": TokenType.DATE32,
     67            "DATETIME64": TokenType.DATETIME64,
     68            "DICTIONARY": TokenType.DICTIONARY,
     69            "ENUM": TokenType.ENUM,
     70            "ENUM8": TokenType.ENUM8,
     71            "ENUM16": TokenType.ENUM16,
     72            "FINAL": TokenType.FINAL,
     73            "FIXEDSTRING": TokenType.FIXEDSTRING,
     74            "FLOAT32": TokenType.FLOAT,
     75            "FLOAT64": TokenType.DOUBLE,
     76            "GLOBAL": TokenType.GLOBAL,
     77            "INT256": TokenType.INT256,
     78            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
     79            "MAP": TokenType.MAP,
     80            "NESTED": TokenType.NESTED,
     81            "SAMPLE": TokenType.TABLE_SAMPLE,
     82            "TUPLE": TokenType.STRUCT,
     83            "UINT128": TokenType.UINT128,
     84            "UINT16": TokenType.USMALLINT,
     85            "UINT256": TokenType.UINT256,
     86            "UINT32": TokenType.UINT,
     87            "UINT64": TokenType.UBIGINT,
     88            "UINT8": TokenType.UTINYINT,
     89            "IPV4": TokenType.IPV4,
     90            "IPV6": TokenType.IPV6,
     91        }
     92
     93        SINGLE_TOKENS = {
     94            **tokens.Tokenizer.SINGLE_TOKENS,
     95            "$": TokenType.HEREDOC_STRING,
     96        }
     97
     98    class Parser(parser.Parser):
     99        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    100        # * select x from t1 union all select x from t2 limit 1;
    101        # * select x from t1 union all (select x from t2 limit 1);
    102        MODIFIERS_ATTACHED_TO_UNION = False
    103
    104        FUNCTIONS = {
    105            **parser.Parser.FUNCTIONS,
    106            "ANY": exp.AnyValue.from_arg_list,
    107            "ARRAYSUM": exp.ArraySum.from_arg_list,
    108            "COUNTIF": _parse_count_if,
    109            "DATE_ADD": lambda args: exp.DateAdd(
    110                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    111            ),
    112            "DATEADD": lambda args: exp.DateAdd(
    113                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    114            ),
    115            "DATE_DIFF": lambda args: exp.DateDiff(
    116                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    117            ),
    118            "DATEDIFF": lambda args: exp.DateDiff(
    119                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    120            ),
    121            "MAP": parse_var_map,
    122            "MATCH": exp.RegexpLike.from_arg_list,
    123            "RANDCANONICAL": exp.Rand.from_arg_list,
    124            "UNIQ": exp.ApproxDistinct.from_arg_list,
    125            "XOR": lambda args: exp.Xor(expressions=args),
    126        }
    127
    128        AGG_FUNCTIONS = {
    129            "count",
    130            "min",
    131            "max",
    132            "sum",
    133            "avg",
    134            "any",
    135            "stddevPop",
    136            "stddevSamp",
    137            "varPop",
    138            "varSamp",
    139            "corr",
    140            "covarPop",
    141            "covarSamp",
    142            "entropy",
    143            "exponentialMovingAverage",
    144            "intervalLengthSum",
    145            "kolmogorovSmirnovTest",
    146            "mannWhitneyUTest",
    147            "median",
    148            "rankCorr",
    149            "sumKahan",
    150            "studentTTest",
    151            "welchTTest",
    152            "anyHeavy",
    153            "anyLast",
    154            "boundingRatio",
    155            "first_value",
    156            "last_value",
    157            "argMin",
    158            "argMax",
    159            "avgWeighted",
    160            "topK",
    161            "topKWeighted",
    162            "deltaSum",
    163            "deltaSumTimestamp",
    164            "groupArray",
    165            "groupArrayLast",
    166            "groupUniqArray",
    167            "groupArrayInsertAt",
    168            "groupArrayMovingAvg",
    169            "groupArrayMovingSum",
    170            "groupArraySample",
    171            "groupBitAnd",
    172            "groupBitOr",
    173            "groupBitXor",
    174            "groupBitmap",
    175            "groupBitmapAnd",
    176            "groupBitmapOr",
    177            "groupBitmapXor",
    178            "sumWithOverflow",
    179            "sumMap",
    180            "minMap",
    181            "maxMap",
    182            "skewSamp",
    183            "skewPop",
    184            "kurtSamp",
    185            "kurtPop",
    186            "uniq",
    187            "uniqExact",
    188            "uniqCombined",
    189            "uniqCombined64",
    190            "uniqHLL12",
    191            "uniqTheta",
    192            "quantile",
    193            "quantiles",
    194            "quantileExact",
    195            "quantilesExact",
    196            "quantileExactLow",
    197            "quantilesExactLow",
    198            "quantileExactHigh",
    199            "quantilesExactHigh",
    200            "quantileExactWeighted",
    201            "quantilesExactWeighted",
    202            "quantileTiming",
    203            "quantilesTiming",
    204            "quantileTimingWeighted",
    205            "quantilesTimingWeighted",
    206            "quantileDeterministic",
    207            "quantilesDeterministic",
    208            "quantileTDigest",
    209            "quantilesTDigest",
    210            "quantileTDigestWeighted",
    211            "quantilesTDigestWeighted",
    212            "quantileBFloat16",
    213            "quantilesBFloat16",
    214            "quantileBFloat16Weighted",
    215            "quantilesBFloat16Weighted",
    216            "simpleLinearRegression",
    217            "stochasticLinearRegression",
    218            "stochasticLogisticRegression",
    219            "categoricalInformationValue",
    220            "contingency",
    221            "cramersV",
    222            "cramersVBiasCorrected",
    223            "theilsU",
    224            "maxIntersections",
    225            "maxIntersectionsPosition",
    226            "meanZTest",
    227            "quantileInterpolatedWeighted",
    228            "quantilesInterpolatedWeighted",
    229            "quantileGK",
    230            "quantilesGK",
    231            "sparkBar",
    232            "sumCount",
    233            "largestTriangleThreeBuckets",
    234        }
    235
    236        AGG_FUNCTIONS_SUFFIXES = [
    237            "If",
    238            "Array",
    239            "ArrayIf",
    240            "Map",
    241            "SimpleState",
    242            "State",
    243            "Merge",
    244            "MergeState",
    245            "ForEach",
    246            "Distinct",
    247            "OrDefault",
    248            "OrNull",
    249            "Resample",
    250            "ArgMin",
    251            "ArgMax",
    252        ]
    253
    254        AGG_FUNC_MAPPING = (
    255            lambda functions, suffixes: {
    256                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    257            }
    258        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    259
    260        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    261
    262        FUNCTION_PARSERS = {
    263            **parser.Parser.FUNCTION_PARSERS,
    264            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    265            "QUANTILE": lambda self: self._parse_quantile(),
    266        }
    267
    268        FUNCTION_PARSERS.pop("MATCH")
    269
    270        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    271        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    272
    273        RANGE_PARSERS = {
    274            **parser.Parser.RANGE_PARSERS,
    275            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    276            and self._parse_in(this, is_global=True),
    277        }
    278
    279        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    280        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    281        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    282        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    283
    284        JOIN_KINDS = {
    285            *parser.Parser.JOIN_KINDS,
    286            TokenType.ANY,
    287            TokenType.ASOF,
    288            TokenType.ARRAY,
    289        }
    290
    291        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    292            TokenType.ANY,
    293            TokenType.ARRAY,
    294            TokenType.FINAL,
    295            TokenType.FORMAT,
    296            TokenType.SETTINGS,
    297        }
    298
    299        LOG_DEFAULTS_TO_LN = True
    300
    301        QUERY_MODIFIER_PARSERS = {
    302            **parser.Parser.QUERY_MODIFIER_PARSERS,
    303            TokenType.SETTINGS: lambda self: (
    304                "settings",
    305                self._advance() or self._parse_csv(self._parse_conjunction),
    306            ),
    307            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    308        }
    309
    310        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    311            this = super()._parse_conjunction()
    312
    313            if self._match(TokenType.PLACEHOLDER):
    314                return self.expression(
    315                    exp.If,
    316                    this=this,
    317                    true=self._parse_conjunction(),
    318                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    319                )
    320
    321            return this
    322
    323        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    324            """
    325            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    326            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    327            """
    328            if not self._match(TokenType.L_BRACE):
    329                return None
    330
    331            this = self._parse_id_var()
    332            self._match(TokenType.COLON)
    333            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    334                self._match_text_seq("IDENTIFIER") and "Identifier"
    335            )
    336
    337            if not kind:
    338                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    339            elif not self._match(TokenType.R_BRACE):
    340                self.raise_error("Expecting }")
    341
    342            return self.expression(exp.Placeholder, this=this, kind=kind)
    343
    344        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    345            this = super()._parse_in(this)
    346            this.set("is_global", is_global)
    347            return this
    348
    349        def _parse_table(
    350            self,
    351            schema: bool = False,
    352            joins: bool = False,
    353            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    354            parse_bracket: bool = False,
    355        ) -> t.Optional[exp.Expression]:
    356            this = super()._parse_table(
    357                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    358            )
    359
    360            if self._match(TokenType.FINAL):
    361                this = self.expression(exp.Final, this=this)
    362
    363            return this
    364
    365        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    366            return super()._parse_position(haystack_first=True)
    367
    368        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    369        def _parse_cte(self) -> exp.CTE:
    370            index = self._index
    371            try:
    372                # WITH <identifier> AS <subquery expression>
    373                return super()._parse_cte()
    374            except ParseError:
    375                # WITH <expression> AS <identifier>
    376                self._retreat(index)
    377
    378                return self.expression(
    379                    exp.CTE,
    380                    this=self._parse_field(),
    381                    alias=self._parse_table_alias(),
    382                    scalar=True,
    383                )
    384
    385        def _parse_join_parts(
    386            self,
    387        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    388            is_global = self._match(TokenType.GLOBAL) and self._prev
    389            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    390
    391            if kind_pre:
    392                kind = self._match_set(self.JOIN_KINDS) and self._prev
    393                side = self._match_set(self.JOIN_SIDES) and self._prev
    394                return is_global, side, kind
    395
    396            return (
    397                is_global,
    398                self._match_set(self.JOIN_SIDES) and self._prev,
    399                self._match_set(self.JOIN_KINDS) and self._prev,
    400            )
    401
    402        def _parse_join(
    403            self, skip_join_token: bool = False, parse_bracket: bool = False
    404        ) -> t.Optional[exp.Join]:
    405            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    406
    407            if join:
    408                join.set("global", join.args.pop("method", None))
    409            return join
    410
    411        def _parse_function(
    412            self,
    413            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    414            anonymous: bool = False,
    415            optional_parens: bool = True,
    416        ) -> t.Optional[exp.Expression]:
    417            func = super()._parse_function(
    418                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    419            )
    420
    421            if isinstance(func, exp.Anonymous):
    422                parts = self.AGG_FUNC_MAPPING.get(func.this)
    423                params = self._parse_func_params(func)
    424
    425                if params:
    426                    if parts and parts[1]:
    427                        return self.expression(
    428                            exp.CombinedParameterizedAgg,
    429                            this=func.this,
    430                            expressions=func.expressions,
    431                            params=params,
    432                            parts=parts,
    433                        )
    434                    return self.expression(
    435                        exp.ParameterizedAgg,
    436                        this=func.this,
    437                        expressions=func.expressions,
    438                        params=params,
    439                    )
    440
    441                if parts:
    442                    if parts[1]:
    443                        return self.expression(
    444                            exp.CombinedAggFunc,
    445                            this=func.this,
    446                            expressions=func.expressions,
    447                            parts=parts,
    448                        )
    449                    return self.expression(
    450                        exp.AnonymousAggFunc,
    451                        this=func.this,
    452                        expressions=func.expressions,
    453                    )
    454
    455            return func
    456
    457        def _parse_func_params(
    458            self, this: t.Optional[exp.Func] = None
    459        ) -> t.Optional[t.List[exp.Expression]]:
    460            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    461                return self._parse_csv(self._parse_lambda)
    462
    463            if self._match(TokenType.L_PAREN):
    464                params = self._parse_csv(self._parse_lambda)
    465                self._match_r_paren(this)
    466                return params
    467
    468            return None
    469
    470        def _parse_quantile(self) -> exp.Quantile:
    471            this = self._parse_lambda()
    472            params = self._parse_func_params()
    473            if params:
    474                return self.expression(exp.Quantile, this=params[0], quantile=this)
    475            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    476
    477        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    478            return super()._parse_wrapped_id_vars(optional=True)
    479
    480        def _parse_primary_key(
    481            self, wrapped_optional: bool = False, in_props: bool = False
    482        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    483            return super()._parse_primary_key(
    484                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    485            )
    486
    487        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    488            index = self._index
    489            if self._match_text_seq("CLUSTER"):
    490                this = self._parse_id_var()
    491                if this:
    492                    return self.expression(exp.OnCluster, this=this)
    493                else:
    494                    self._retreat(index)
    495            return None
    496
    497    class Generator(generator.Generator):
    498        QUERY_HINTS = False
    499        STRUCT_DELIMITER = ("(", ")")
    500        NVL2_SUPPORTED = False
    501        TABLESAMPLE_REQUIRES_PARENS = False
    502        TABLESAMPLE_SIZE_IS_ROWS = False
    503        TABLESAMPLE_KEYWORDS = "SAMPLE"
    504        LAST_DAY_SUPPORTS_DATE_PART = False
    505
    506        STRING_TYPE_MAPPING = {
    507            exp.DataType.Type.CHAR: "String",
    508            exp.DataType.Type.LONGBLOB: "String",
    509            exp.DataType.Type.LONGTEXT: "String",
    510            exp.DataType.Type.MEDIUMBLOB: "String",
    511            exp.DataType.Type.MEDIUMTEXT: "String",
    512            exp.DataType.Type.TINYBLOB: "String",
    513            exp.DataType.Type.TINYTEXT: "String",
    514            exp.DataType.Type.TEXT: "String",
    515            exp.DataType.Type.VARBINARY: "String",
    516            exp.DataType.Type.VARCHAR: "String",
    517        }
    518
    519        TYPE_MAPPING = {
    520            **generator.Generator.TYPE_MAPPING,
    521            **STRING_TYPE_MAPPING,
    522            exp.DataType.Type.ARRAY: "Array",
    523            exp.DataType.Type.BIGINT: "Int64",
    524            exp.DataType.Type.DATE32: "Date32",
    525            exp.DataType.Type.DATETIME64: "DateTime64",
    526            exp.DataType.Type.DOUBLE: "Float64",
    527            exp.DataType.Type.ENUM: "Enum",
    528            exp.DataType.Type.ENUM8: "Enum8",
    529            exp.DataType.Type.ENUM16: "Enum16",
    530            exp.DataType.Type.FIXEDSTRING: "FixedString",
    531            exp.DataType.Type.FLOAT: "Float32",
    532            exp.DataType.Type.INT: "Int32",
    533            exp.DataType.Type.MEDIUMINT: "Int32",
    534            exp.DataType.Type.INT128: "Int128",
    535            exp.DataType.Type.INT256: "Int256",
    536            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    537            exp.DataType.Type.MAP: "Map",
    538            exp.DataType.Type.NESTED: "Nested",
    539            exp.DataType.Type.NULLABLE: "Nullable",
    540            exp.DataType.Type.SMALLINT: "Int16",
    541            exp.DataType.Type.STRUCT: "Tuple",
    542            exp.DataType.Type.TINYINT: "Int8",
    543            exp.DataType.Type.UBIGINT: "UInt64",
    544            exp.DataType.Type.UINT: "UInt32",
    545            exp.DataType.Type.UINT128: "UInt128",
    546            exp.DataType.Type.UINT256: "UInt256",
    547            exp.DataType.Type.USMALLINT: "UInt16",
    548            exp.DataType.Type.UTINYINT: "UInt8",
    549            exp.DataType.Type.IPV4: "IPv4",
    550            exp.DataType.Type.IPV6: "IPv6",
    551        }
    552
    553        TRANSFORMS = {
    554            **generator.Generator.TRANSFORMS,
    555            exp.AnyValue: rename_func("any"),
    556            exp.ApproxDistinct: rename_func("uniq"),
    557            exp.ArraySum: rename_func("arraySum"),
    558            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    559            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    560            exp.Array: inline_array_sql,
    561            exp.CastToStrType: rename_func("CAST"),
    562            exp.CountIf: rename_func("countIf"),
    563            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    564            exp.DateAdd: date_delta_sql("DATE_ADD"),
    565            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    566            exp.Explode: rename_func("arrayJoin"),
    567            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    568            exp.IsNan: rename_func("isNaN"),
    569            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    570            exp.Nullif: rename_func("nullIf"),
    571            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    572            exp.Pivot: no_pivot_sql,
    573            exp.Quantile: _quantile_sql,
    574            exp.RegexpLike: lambda self, e: f"match({self.format_args(e.this, e.expression)})",
    575            exp.Rand: rename_func("randCanonical"),
    576            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    577            exp.StartsWith: rename_func("startsWith"),
    578            exp.StrPosition: lambda self, e: f"position({self.format_args(e.this, e.args.get('substr'), e.args.get('position'))})",
    579            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    580            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    581        }
    582
    583        PROPERTIES_LOCATION = {
    584            **generator.Generator.PROPERTIES_LOCATION,
    585            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    586            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    587            exp.OnCluster: exp.Properties.Location.POST_NAME,
    588        }
    589
    590        JOIN_HINTS = False
    591        TABLE_HINTS = False
    592        EXPLICIT_UNION = True
    593        GROUPINGS_SEP = ""
    594
    595        # there's no list in docs, but it can be found in Clickhouse code
    596        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    597        ON_CLUSTER_TARGETS = {
    598            "DATABASE",
    599            "TABLE",
    600            "VIEW",
    601            "DICTIONARY",
    602            "INDEX",
    603            "FUNCTION",
    604            "NAMED COLLECTION",
    605        }
    606
    607        def _any_to_has(
    608            self,
    609            expression: exp.EQ | exp.NEQ,
    610            default: t.Callable[[t.Any], str],
    611            prefix: str = "",
    612        ) -> str:
    613            if isinstance(expression.left, exp.Any):
    614                arr = expression.left
    615                this = expression.right
    616            elif isinstance(expression.right, exp.Any):
    617                arr = expression.right
    618                this = expression.left
    619            else:
    620                return default(expression)
    621            return prefix + self.func("has", arr.this.unnest(), this)
    622
    623        def eq_sql(self, expression: exp.EQ) -> str:
    624            return self._any_to_has(expression, super().eq_sql)
    625
    626        def neq_sql(self, expression: exp.NEQ) -> str:
    627            return self._any_to_has(expression, super().neq_sql, "NOT ")
    628
    629        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    630            # Manually add a flag to make the search case-insensitive
    631            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    632            return f"match({self.format_args(expression.this, regex)})"
    633
    634        def datatype_sql(self, expression: exp.DataType) -> str:
    635            # String is the standard ClickHouse type, every other variant is just an alias.
    636            # Additionally, any supplied length parameter will be ignored.
    637            #
    638            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    639            if expression.this in self.STRING_TYPE_MAPPING:
    640                return "String"
    641
    642            return super().datatype_sql(expression)
    643
    644        def cte_sql(self, expression: exp.CTE) -> str:
    645            if expression.args.get("scalar"):
    646                this = self.sql(expression, "this")
    647                alias = self.sql(expression, "alias")
    648                return f"{this} AS {alias}"
    649
    650            return super().cte_sql(expression)
    651
    652        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    653            return super().after_limit_modifiers(expression) + [
    654                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    655                if expression.args.get("settings")
    656                else "",
    657                self.seg("FORMAT ") + self.sql(expression, "format")
    658                if expression.args.get("format")
    659                else "",
    660            ]
    661
    662        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    663            params = self.expressions(expression, key="params", flat=True)
    664            return self.func(expression.name, *expression.expressions) + f"({params})"
    665
    666        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    667            return self.func(expression.name, *expression.expressions)
    668
    669        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    670            return self.anonymousaggfunc_sql(expression)
    671
    672        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    673            return self.parameterizedagg_sql(expression)
    674
    675        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    676            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    677
    678        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    679            return f"ON CLUSTER {self.sql(expression, 'this')}"
    680
    681        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    682            kind = self.sql(expression, "kind").upper()
    683            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    684                this_name = self.sql(expression.this, "this")
    685                this_properties = " ".join(
    686                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    687                )
    688                this_schema = self.schema_columns_sql(expression.this)
    689                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    690
    691            return super().createable_sql(expression, locations)

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

     46class ClickHouse(Dialect):
     47    NORMALIZE_FUNCTIONS: bool | str = False
     48    NULL_ORDERING = "nulls_are_last"
     49    SUPPORTS_USER_DEFINED_TYPES = False
     50    SAFE_DIVISION = True
     51
     52    ESCAPE_SEQUENCES = {
     53        "\\0": "\0",
     54    }
     55
     56    class Tokenizer(tokens.Tokenizer):
     57        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     58        IDENTIFIERS = ['"', "`"]
     59        STRING_ESCAPES = ["'", "\\"]
     60        BIT_STRINGS = [("0b", "")]
     61        HEX_STRINGS = [("0x", ""), ("0X", "")]
     62        HEREDOC_STRINGS = ["$"]
     63
     64        KEYWORDS = {
     65            **tokens.Tokenizer.KEYWORDS,
     66            "ATTACH": TokenType.COMMAND,
     67            "DATE32": TokenType.DATE32,
     68            "DATETIME64": TokenType.DATETIME64,
     69            "DICTIONARY": TokenType.DICTIONARY,
     70            "ENUM": TokenType.ENUM,
     71            "ENUM8": TokenType.ENUM8,
     72            "ENUM16": TokenType.ENUM16,
     73            "FINAL": TokenType.FINAL,
     74            "FIXEDSTRING": TokenType.FIXEDSTRING,
     75            "FLOAT32": TokenType.FLOAT,
     76            "FLOAT64": TokenType.DOUBLE,
     77            "GLOBAL": TokenType.GLOBAL,
     78            "INT256": TokenType.INT256,
     79            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
     80            "MAP": TokenType.MAP,
     81            "NESTED": TokenType.NESTED,
     82            "SAMPLE": TokenType.TABLE_SAMPLE,
     83            "TUPLE": TokenType.STRUCT,
     84            "UINT128": TokenType.UINT128,
     85            "UINT16": TokenType.USMALLINT,
     86            "UINT256": TokenType.UINT256,
     87            "UINT32": TokenType.UINT,
     88            "UINT64": TokenType.UBIGINT,
     89            "UINT8": TokenType.UTINYINT,
     90            "IPV4": TokenType.IPV4,
     91            "IPV6": TokenType.IPV6,
     92        }
     93
     94        SINGLE_TOKENS = {
     95            **tokens.Tokenizer.SINGLE_TOKENS,
     96            "$": TokenType.HEREDOC_STRING,
     97        }
     98
     99    class Parser(parser.Parser):
    100        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    101        # * select x from t1 union all select x from t2 limit 1;
    102        # * select x from t1 union all (select x from t2 limit 1);
    103        MODIFIERS_ATTACHED_TO_UNION = False
    104
    105        FUNCTIONS = {
    106            **parser.Parser.FUNCTIONS,
    107            "ANY": exp.AnyValue.from_arg_list,
    108            "ARRAYSUM": exp.ArraySum.from_arg_list,
    109            "COUNTIF": _parse_count_if,
    110            "DATE_ADD": lambda args: exp.DateAdd(
    111                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    112            ),
    113            "DATEADD": lambda args: exp.DateAdd(
    114                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    115            ),
    116            "DATE_DIFF": lambda args: exp.DateDiff(
    117                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    118            ),
    119            "DATEDIFF": lambda args: exp.DateDiff(
    120                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    121            ),
    122            "MAP": parse_var_map,
    123            "MATCH": exp.RegexpLike.from_arg_list,
    124            "RANDCANONICAL": exp.Rand.from_arg_list,
    125            "UNIQ": exp.ApproxDistinct.from_arg_list,
    126            "XOR": lambda args: exp.Xor(expressions=args),
    127        }
    128
    129        AGG_FUNCTIONS = {
    130            "count",
    131            "min",
    132            "max",
    133            "sum",
    134            "avg",
    135            "any",
    136            "stddevPop",
    137            "stddevSamp",
    138            "varPop",
    139            "varSamp",
    140            "corr",
    141            "covarPop",
    142            "covarSamp",
    143            "entropy",
    144            "exponentialMovingAverage",
    145            "intervalLengthSum",
    146            "kolmogorovSmirnovTest",
    147            "mannWhitneyUTest",
    148            "median",
    149            "rankCorr",
    150            "sumKahan",
    151            "studentTTest",
    152            "welchTTest",
    153            "anyHeavy",
    154            "anyLast",
    155            "boundingRatio",
    156            "first_value",
    157            "last_value",
    158            "argMin",
    159            "argMax",
    160            "avgWeighted",
    161            "topK",
    162            "topKWeighted",
    163            "deltaSum",
    164            "deltaSumTimestamp",
    165            "groupArray",
    166            "groupArrayLast",
    167            "groupUniqArray",
    168            "groupArrayInsertAt",
    169            "groupArrayMovingAvg",
    170            "groupArrayMovingSum",
    171            "groupArraySample",
    172            "groupBitAnd",
    173            "groupBitOr",
    174            "groupBitXor",
    175            "groupBitmap",
    176            "groupBitmapAnd",
    177            "groupBitmapOr",
    178            "groupBitmapXor",
    179            "sumWithOverflow",
    180            "sumMap",
    181            "minMap",
    182            "maxMap",
    183            "skewSamp",
    184            "skewPop",
    185            "kurtSamp",
    186            "kurtPop",
    187            "uniq",
    188            "uniqExact",
    189            "uniqCombined",
    190            "uniqCombined64",
    191            "uniqHLL12",
    192            "uniqTheta",
    193            "quantile",
    194            "quantiles",
    195            "quantileExact",
    196            "quantilesExact",
    197            "quantileExactLow",
    198            "quantilesExactLow",
    199            "quantileExactHigh",
    200            "quantilesExactHigh",
    201            "quantileExactWeighted",
    202            "quantilesExactWeighted",
    203            "quantileTiming",
    204            "quantilesTiming",
    205            "quantileTimingWeighted",
    206            "quantilesTimingWeighted",
    207            "quantileDeterministic",
    208            "quantilesDeterministic",
    209            "quantileTDigest",
    210            "quantilesTDigest",
    211            "quantileTDigestWeighted",
    212            "quantilesTDigestWeighted",
    213            "quantileBFloat16",
    214            "quantilesBFloat16",
    215            "quantileBFloat16Weighted",
    216            "quantilesBFloat16Weighted",
    217            "simpleLinearRegression",
    218            "stochasticLinearRegression",
    219            "stochasticLogisticRegression",
    220            "categoricalInformationValue",
    221            "contingency",
    222            "cramersV",
    223            "cramersVBiasCorrected",
    224            "theilsU",
    225            "maxIntersections",
    226            "maxIntersectionsPosition",
    227            "meanZTest",
    228            "quantileInterpolatedWeighted",
    229            "quantilesInterpolatedWeighted",
    230            "quantileGK",
    231            "quantilesGK",
    232            "sparkBar",
    233            "sumCount",
    234            "largestTriangleThreeBuckets",
    235        }
    236
    237        AGG_FUNCTIONS_SUFFIXES = [
    238            "If",
    239            "Array",
    240            "ArrayIf",
    241            "Map",
    242            "SimpleState",
    243            "State",
    244            "Merge",
    245            "MergeState",
    246            "ForEach",
    247            "Distinct",
    248            "OrDefault",
    249            "OrNull",
    250            "Resample",
    251            "ArgMin",
    252            "ArgMax",
    253        ]
    254
    255        AGG_FUNC_MAPPING = (
    256            lambda functions, suffixes: {
    257                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    258            }
    259        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    260
    261        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    262
    263        FUNCTION_PARSERS = {
    264            **parser.Parser.FUNCTION_PARSERS,
    265            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    266            "QUANTILE": lambda self: self._parse_quantile(),
    267        }
    268
    269        FUNCTION_PARSERS.pop("MATCH")
    270
    271        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    272        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    273
    274        RANGE_PARSERS = {
    275            **parser.Parser.RANGE_PARSERS,
    276            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    277            and self._parse_in(this, is_global=True),
    278        }
    279
    280        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    281        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    282        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    283        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    284
    285        JOIN_KINDS = {
    286            *parser.Parser.JOIN_KINDS,
    287            TokenType.ANY,
    288            TokenType.ASOF,
    289            TokenType.ARRAY,
    290        }
    291
    292        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    293            TokenType.ANY,
    294            TokenType.ARRAY,
    295            TokenType.FINAL,
    296            TokenType.FORMAT,
    297            TokenType.SETTINGS,
    298        }
    299
    300        LOG_DEFAULTS_TO_LN = True
    301
    302        QUERY_MODIFIER_PARSERS = {
    303            **parser.Parser.QUERY_MODIFIER_PARSERS,
    304            TokenType.SETTINGS: lambda self: (
    305                "settings",
    306                self._advance() or self._parse_csv(self._parse_conjunction),
    307            ),
    308            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    309        }
    310
    311        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    312            this = super()._parse_conjunction()
    313
    314            if self._match(TokenType.PLACEHOLDER):
    315                return self.expression(
    316                    exp.If,
    317                    this=this,
    318                    true=self._parse_conjunction(),
    319                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    320                )
    321
    322            return this
    323
    324        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    325            """
    326            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    327            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    328            """
    329            if not self._match(TokenType.L_BRACE):
    330                return None
    331
    332            this = self._parse_id_var()
    333            self._match(TokenType.COLON)
    334            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    335                self._match_text_seq("IDENTIFIER") and "Identifier"
    336            )
    337
    338            if not kind:
    339                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    340            elif not self._match(TokenType.R_BRACE):
    341                self.raise_error("Expecting }")
    342
    343            return self.expression(exp.Placeholder, this=this, kind=kind)
    344
    345        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    346            this = super()._parse_in(this)
    347            this.set("is_global", is_global)
    348            return this
    349
    350        def _parse_table(
    351            self,
    352            schema: bool = False,
    353            joins: bool = False,
    354            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    355            parse_bracket: bool = False,
    356        ) -> t.Optional[exp.Expression]:
    357            this = super()._parse_table(
    358                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    359            )
    360
    361            if self._match(TokenType.FINAL):
    362                this = self.expression(exp.Final, this=this)
    363
    364            return this
    365
    366        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    367            return super()._parse_position(haystack_first=True)
    368
    369        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    370        def _parse_cte(self) -> exp.CTE:
    371            index = self._index
    372            try:
    373                # WITH <identifier> AS <subquery expression>
    374                return super()._parse_cte()
    375            except ParseError:
    376                # WITH <expression> AS <identifier>
    377                self._retreat(index)
    378
    379                return self.expression(
    380                    exp.CTE,
    381                    this=self._parse_field(),
    382                    alias=self._parse_table_alias(),
    383                    scalar=True,
    384                )
    385
    386        def _parse_join_parts(
    387            self,
    388        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    389            is_global = self._match(TokenType.GLOBAL) and self._prev
    390            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    391
    392            if kind_pre:
    393                kind = self._match_set(self.JOIN_KINDS) and self._prev
    394                side = self._match_set(self.JOIN_SIDES) and self._prev
    395                return is_global, side, kind
    396
    397            return (
    398                is_global,
    399                self._match_set(self.JOIN_SIDES) and self._prev,
    400                self._match_set(self.JOIN_KINDS) and self._prev,
    401            )
    402
    403        def _parse_join(
    404            self, skip_join_token: bool = False, parse_bracket: bool = False
    405        ) -> t.Optional[exp.Join]:
    406            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    407
    408            if join:
    409                join.set("global", join.args.pop("method", None))
    410            return join
    411
    412        def _parse_function(
    413            self,
    414            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    415            anonymous: bool = False,
    416            optional_parens: bool = True,
    417        ) -> t.Optional[exp.Expression]:
    418            func = super()._parse_function(
    419                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    420            )
    421
    422            if isinstance(func, exp.Anonymous):
    423                parts = self.AGG_FUNC_MAPPING.get(func.this)
    424                params = self._parse_func_params(func)
    425
    426                if params:
    427                    if parts and parts[1]:
    428                        return self.expression(
    429                            exp.CombinedParameterizedAgg,
    430                            this=func.this,
    431                            expressions=func.expressions,
    432                            params=params,
    433                            parts=parts,
    434                        )
    435                    return self.expression(
    436                        exp.ParameterizedAgg,
    437                        this=func.this,
    438                        expressions=func.expressions,
    439                        params=params,
    440                    )
    441
    442                if parts:
    443                    if parts[1]:
    444                        return self.expression(
    445                            exp.CombinedAggFunc,
    446                            this=func.this,
    447                            expressions=func.expressions,
    448                            parts=parts,
    449                        )
    450                    return self.expression(
    451                        exp.AnonymousAggFunc,
    452                        this=func.this,
    453                        expressions=func.expressions,
    454                    )
    455
    456            return func
    457
    458        def _parse_func_params(
    459            self, this: t.Optional[exp.Func] = None
    460        ) -> t.Optional[t.List[exp.Expression]]:
    461            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    462                return self._parse_csv(self._parse_lambda)
    463
    464            if self._match(TokenType.L_PAREN):
    465                params = self._parse_csv(self._parse_lambda)
    466                self._match_r_paren(this)
    467                return params
    468
    469            return None
    470
    471        def _parse_quantile(self) -> exp.Quantile:
    472            this = self._parse_lambda()
    473            params = self._parse_func_params()
    474            if params:
    475                return self.expression(exp.Quantile, this=params[0], quantile=this)
    476            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    477
    478        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    479            return super()._parse_wrapped_id_vars(optional=True)
    480
    481        def _parse_primary_key(
    482            self, wrapped_optional: bool = False, in_props: bool = False
    483        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    484            return super()._parse_primary_key(
    485                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    486            )
    487
    488        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    489            index = self._index
    490            if self._match_text_seq("CLUSTER"):
    491                this = self._parse_id_var()
    492                if this:
    493                    return self.expression(exp.OnCluster, this=this)
    494                else:
    495                    self._retreat(index)
    496            return None
    497
    498    class Generator(generator.Generator):
    499        QUERY_HINTS = False
    500        STRUCT_DELIMITER = ("(", ")")
    501        NVL2_SUPPORTED = False
    502        TABLESAMPLE_REQUIRES_PARENS = False
    503        TABLESAMPLE_SIZE_IS_ROWS = False
    504        TABLESAMPLE_KEYWORDS = "SAMPLE"
    505        LAST_DAY_SUPPORTS_DATE_PART = False
    506
    507        STRING_TYPE_MAPPING = {
    508            exp.DataType.Type.CHAR: "String",
    509            exp.DataType.Type.LONGBLOB: "String",
    510            exp.DataType.Type.LONGTEXT: "String",
    511            exp.DataType.Type.MEDIUMBLOB: "String",
    512            exp.DataType.Type.MEDIUMTEXT: "String",
    513            exp.DataType.Type.TINYBLOB: "String",
    514            exp.DataType.Type.TINYTEXT: "String",
    515            exp.DataType.Type.TEXT: "String",
    516            exp.DataType.Type.VARBINARY: "String",
    517            exp.DataType.Type.VARCHAR: "String",
    518        }
    519
    520        TYPE_MAPPING = {
    521            **generator.Generator.TYPE_MAPPING,
    522            **STRING_TYPE_MAPPING,
    523            exp.DataType.Type.ARRAY: "Array",
    524            exp.DataType.Type.BIGINT: "Int64",
    525            exp.DataType.Type.DATE32: "Date32",
    526            exp.DataType.Type.DATETIME64: "DateTime64",
    527            exp.DataType.Type.DOUBLE: "Float64",
    528            exp.DataType.Type.ENUM: "Enum",
    529            exp.DataType.Type.ENUM8: "Enum8",
    530            exp.DataType.Type.ENUM16: "Enum16",
    531            exp.DataType.Type.FIXEDSTRING: "FixedString",
    532            exp.DataType.Type.FLOAT: "Float32",
    533            exp.DataType.Type.INT: "Int32",
    534            exp.DataType.Type.MEDIUMINT: "Int32",
    535            exp.DataType.Type.INT128: "Int128",
    536            exp.DataType.Type.INT256: "Int256",
    537            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    538            exp.DataType.Type.MAP: "Map",
    539            exp.DataType.Type.NESTED: "Nested",
    540            exp.DataType.Type.NULLABLE: "Nullable",
    541            exp.DataType.Type.SMALLINT: "Int16",
    542            exp.DataType.Type.STRUCT: "Tuple",
    543            exp.DataType.Type.TINYINT: "Int8",
    544            exp.DataType.Type.UBIGINT: "UInt64",
    545            exp.DataType.Type.UINT: "UInt32",
    546            exp.DataType.Type.UINT128: "UInt128",
    547            exp.DataType.Type.UINT256: "UInt256",
    548            exp.DataType.Type.USMALLINT: "UInt16",
    549            exp.DataType.Type.UTINYINT: "UInt8",
    550            exp.DataType.Type.IPV4: "IPv4",
    551            exp.DataType.Type.IPV6: "IPv6",
    552        }
    553
    554        TRANSFORMS = {
    555            **generator.Generator.TRANSFORMS,
    556            exp.AnyValue: rename_func("any"),
    557            exp.ApproxDistinct: rename_func("uniq"),
    558            exp.ArraySum: rename_func("arraySum"),
    559            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    560            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    561            exp.Array: inline_array_sql,
    562            exp.CastToStrType: rename_func("CAST"),
    563            exp.CountIf: rename_func("countIf"),
    564            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    565            exp.DateAdd: date_delta_sql("DATE_ADD"),
    566            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    567            exp.Explode: rename_func("arrayJoin"),
    568            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    569            exp.IsNan: rename_func("isNaN"),
    570            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    571            exp.Nullif: rename_func("nullIf"),
    572            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    573            exp.Pivot: no_pivot_sql,
    574            exp.Quantile: _quantile_sql,
    575            exp.RegexpLike: lambda self, e: f"match({self.format_args(e.this, e.expression)})",
    576            exp.Rand: rename_func("randCanonical"),
    577            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    578            exp.StartsWith: rename_func("startsWith"),
    579            exp.StrPosition: lambda self, e: f"position({self.format_args(e.this, e.args.get('substr'), e.args.get('position'))})",
    580            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    581            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    582        }
    583
    584        PROPERTIES_LOCATION = {
    585            **generator.Generator.PROPERTIES_LOCATION,
    586            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    587            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    588            exp.OnCluster: exp.Properties.Location.POST_NAME,
    589        }
    590
    591        JOIN_HINTS = False
    592        TABLE_HINTS = False
    593        EXPLICIT_UNION = True
    594        GROUPINGS_SEP = ""
    595
    596        # there's no list in docs, but it can be found in Clickhouse code
    597        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    598        ON_CLUSTER_TARGETS = {
    599            "DATABASE",
    600            "TABLE",
    601            "VIEW",
    602            "DICTIONARY",
    603            "INDEX",
    604            "FUNCTION",
    605            "NAMED COLLECTION",
    606        }
    607
    608        def _any_to_has(
    609            self,
    610            expression: exp.EQ | exp.NEQ,
    611            default: t.Callable[[t.Any], str],
    612            prefix: str = "",
    613        ) -> str:
    614            if isinstance(expression.left, exp.Any):
    615                arr = expression.left
    616                this = expression.right
    617            elif isinstance(expression.right, exp.Any):
    618                arr = expression.right
    619                this = expression.left
    620            else:
    621                return default(expression)
    622            return prefix + self.func("has", arr.this.unnest(), this)
    623
    624        def eq_sql(self, expression: exp.EQ) -> str:
    625            return self._any_to_has(expression, super().eq_sql)
    626
    627        def neq_sql(self, expression: exp.NEQ) -> str:
    628            return self._any_to_has(expression, super().neq_sql, "NOT ")
    629
    630        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    631            # Manually add a flag to make the search case-insensitive
    632            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    633            return f"match({self.format_args(expression.this, regex)})"
    634
    635        def datatype_sql(self, expression: exp.DataType) -> str:
    636            # String is the standard ClickHouse type, every other variant is just an alias.
    637            # Additionally, any supplied length parameter will be ignored.
    638            #
    639            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    640            if expression.this in self.STRING_TYPE_MAPPING:
    641                return "String"
    642
    643            return super().datatype_sql(expression)
    644
    645        def cte_sql(self, expression: exp.CTE) -> str:
    646            if expression.args.get("scalar"):
    647                this = self.sql(expression, "this")
    648                alias = self.sql(expression, "alias")
    649                return f"{this} AS {alias}"
    650
    651            return super().cte_sql(expression)
    652
    653        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    654            return super().after_limit_modifiers(expression) + [
    655                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    656                if expression.args.get("settings")
    657                else "",
    658                self.seg("FORMAT ") + self.sql(expression, "format")
    659                if expression.args.get("format")
    660                else "",
    661            ]
    662
    663        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    664            params = self.expressions(expression, key="params", flat=True)
    665            return self.func(expression.name, *expression.expressions) + f"({params})"
    666
    667        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    668            return self.func(expression.name, *expression.expressions)
    669
    670        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    671            return self.anonymousaggfunc_sql(expression)
    672
    673        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    674            return self.parameterizedagg_sql(expression)
    675
    676        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    677            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    678
    679        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    680            return f"ON CLUSTER {self.sql(expression, 'this')}"
    681
    682        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    683            kind = self.sql(expression, "kind").upper()
    684            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    685                this_name = self.sql(expression.this, "this")
    686                this_properties = " ".join(
    687                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    688                )
    689                this_schema = self.schema_columns_sql(expression.this)
    690                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    691
    692            return super().createable_sql(expression, locations)

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

NULL_ORDERING = 'nulls_are_last'

Indicates the 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

Determines whether or not user-defined data types are supported.

SAFE_DIVISION = True

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

ESCAPE_SEQUENCES = {'\\0': '\x00'}

Mapping of an unescaped escape sequence to the corresponding character.

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 = {}
INVERSE_ESCAPE_SEQUENCES: Dict[str, str] = {'\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
  LOG_BASE_FIRST
  TYPED_DIVISION
  CONCAT_COALESCE
  DATE_FORMAT
  DATEINT_FORMAT
  TIME_FORMAT
  TIME_MAPPING
  FORMAT_MAPPING
  PSEUDOCOLUMNS
  PREFER_CTE_ALIAS_COLUMN
  get_or_raise
  format_time
  normalize_identifier
  case_sensitive
  can_identify
  quote_identifier
  parse
  parse_into
  generate
  transpile
  tokenize
  tokenizer
  parser
  generator

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

    56    class Tokenizer(tokens.Tokenizer):
    57        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
    58        IDENTIFIERS = ['"', "`"]
    59        STRING_ESCAPES = ["'", "\\"]
    60        BIT_STRINGS = [("0b", "")]
    61        HEX_STRINGS = [("0x", ""), ("0X", "")]
    62        HEREDOC_STRINGS = ["$"]
    63
    64        KEYWORDS = {
    65            **tokens.Tokenizer.KEYWORDS,
    66            "ATTACH": TokenType.COMMAND,
    67            "DATE32": TokenType.DATE32,
    68            "DATETIME64": TokenType.DATETIME64,
    69            "DICTIONARY": TokenType.DICTIONARY,
    70            "ENUM": TokenType.ENUM,
    71            "ENUM8": TokenType.ENUM8,
    72            "ENUM16": TokenType.ENUM16,
    73            "FINAL": TokenType.FINAL,
    74            "FIXEDSTRING": TokenType.FIXEDSTRING,
    75            "FLOAT32": TokenType.FLOAT,
    76            "FLOAT64": TokenType.DOUBLE,
    77            "GLOBAL": TokenType.GLOBAL,
    78            "INT256": TokenType.INT256,
    79            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    80            "MAP": TokenType.MAP,
    81            "NESTED": TokenType.NESTED,
    82            "SAMPLE": TokenType.TABLE_SAMPLE,
    83            "TUPLE": TokenType.STRUCT,
    84            "UINT128": TokenType.UINT128,
    85            "UINT16": TokenType.USMALLINT,
    86            "UINT256": TokenType.UINT256,
    87            "UINT32": TokenType.UINT,
    88            "UINT64": TokenType.UBIGINT,
    89            "UINT8": TokenType.UTINYINT,
    90            "IPV4": TokenType.IPV4,
    91            "IPV6": TokenType.IPV6,
    92        }
    93
    94        SINGLE_TOKENS = {
    95            **tokens.Tokenizer.SINGLE_TOKENS,
    96            "$": TokenType.HEREDOC_STRING,
    97        }

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'>, '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'>, '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'>, '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'>, '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'>, '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'>, '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'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'TRUNCATE': <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'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, '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'>}
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.QUOTE: 'QUOTE'>, '`': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '"': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '#': <TokenType.HASH: 'HASH'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}

##### Inherited Members

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

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

     99    class Parser(parser.Parser):
    100        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    101        # * select x from t1 union all select x from t2 limit 1;
    102        # * select x from t1 union all (select x from t2 limit 1);
    103        MODIFIERS_ATTACHED_TO_UNION = False
    104
    105        FUNCTIONS = {
    106            **parser.Parser.FUNCTIONS,
    107            "ANY": exp.AnyValue.from_arg_list,
    108            "ARRAYSUM": exp.ArraySum.from_arg_list,
    109            "COUNTIF": _parse_count_if,
    110            "DATE_ADD": lambda args: exp.DateAdd(
    111                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    112            ),
    113            "DATEADD": lambda args: exp.DateAdd(
    114                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    115            ),
    116            "DATE_DIFF": lambda args: exp.DateDiff(
    117                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    118            ),
    119            "DATEDIFF": lambda args: exp.DateDiff(
    120                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    121            ),
    122            "MAP": parse_var_map,
    123            "MATCH": exp.RegexpLike.from_arg_list,
    124            "RANDCANONICAL": exp.Rand.from_arg_list,
    125            "UNIQ": exp.ApproxDistinct.from_arg_list,
    126            "XOR": lambda args: exp.Xor(expressions=args),
    127        }
    128
    129        AGG_FUNCTIONS = {
    130            "count",
    131            "min",
    132            "max",
    133            "sum",
    134            "avg",
    135            "any",
    136            "stddevPop",
    137            "stddevSamp",
    138            "varPop",
    139            "varSamp",
    140            "corr",
    141            "covarPop",
    142            "covarSamp",
    143            "entropy",
    144            "exponentialMovingAverage",
    145            "intervalLengthSum",
    146            "kolmogorovSmirnovTest",
    147            "mannWhitneyUTest",
    148            "median",
    149            "rankCorr",
    150            "sumKahan",
    151            "studentTTest",
    152            "welchTTest",
    153            "anyHeavy",
    154            "anyLast",
    155            "boundingRatio",
    156            "first_value",
    157            "last_value",
    158            "argMin",
    159            "argMax",
    160            "avgWeighted",
    161            "topK",
    162            "topKWeighted",
    163            "deltaSum",
    164            "deltaSumTimestamp",
    165            "groupArray",
    166            "groupArrayLast",
    167            "groupUniqArray",
    168            "groupArrayInsertAt",
    169            "groupArrayMovingAvg",
    170            "groupArrayMovingSum",
    171            "groupArraySample",
    172            "groupBitAnd",
    173            "groupBitOr",
    174            "groupBitXor",
    175            "groupBitmap",
    176            "groupBitmapAnd",
    177            "groupBitmapOr",
    178            "groupBitmapXor",
    179            "sumWithOverflow",
    180            "sumMap",
    181            "minMap",
    182            "maxMap",
    183            "skewSamp",
    184            "skewPop",
    185            "kurtSamp",
    186            "kurtPop",
    187            "uniq",
    188            "uniqExact",
    189            "uniqCombined",
    190            "uniqCombined64",
    191            "uniqHLL12",
    192            "uniqTheta",
    193            "quantile",
    194            "quantiles",
    195            "quantileExact",
    196            "quantilesExact",
    197            "quantileExactLow",
    198            "quantilesExactLow",
    199            "quantileExactHigh",
    200            "quantilesExactHigh",
    201            "quantileExactWeighted",
    202            "quantilesExactWeighted",
    203            "quantileTiming",
    204            "quantilesTiming",
    205            "quantileTimingWeighted",
    206            "quantilesTimingWeighted",
    207            "quantileDeterministic",
    208            "quantilesDeterministic",
    209            "quantileTDigest",
    210            "quantilesTDigest",
    211            "quantileTDigestWeighted",
    212            "quantilesTDigestWeighted",
    213            "quantileBFloat16",
    214            "quantilesBFloat16",
    215            "quantileBFloat16Weighted",
    216            "quantilesBFloat16Weighted",
    217            "simpleLinearRegression",
    218            "stochasticLinearRegression",
    219            "stochasticLogisticRegression",
    220            "categoricalInformationValue",
    221            "contingency",
    222            "cramersV",
    223            "cramersVBiasCorrected",
    224            "theilsU",
    225            "maxIntersections",
    226            "maxIntersectionsPosition",
    227            "meanZTest",
    228            "quantileInterpolatedWeighted",
    229            "quantilesInterpolatedWeighted",
    230            "quantileGK",
    231            "quantilesGK",
    232            "sparkBar",
    233            "sumCount",
    234            "largestTriangleThreeBuckets",
    235        }
    236
    237        AGG_FUNCTIONS_SUFFIXES = [
    238            "If",
    239            "Array",
    240            "ArrayIf",
    241            "Map",
    242            "SimpleState",
    243            "State",
    244            "Merge",
    245            "MergeState",
    246            "ForEach",
    247            "Distinct",
    248            "OrDefault",
    249            "OrNull",
    250            "Resample",
    251            "ArgMin",
    252            "ArgMax",
    253        ]
    254
    255        AGG_FUNC_MAPPING = (
    256            lambda functions, suffixes: {
    257                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    258            }
    259        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    260
    261        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    262
    263        FUNCTION_PARSERS = {
    264            **parser.Parser.FUNCTION_PARSERS,
    265            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    266            "QUANTILE": lambda self: self._parse_quantile(),
    267        }
    268
    269        FUNCTION_PARSERS.pop("MATCH")
    270
    271        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    272        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    273
    274        RANGE_PARSERS = {
    275            **parser.Parser.RANGE_PARSERS,
    276            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    277            and self._parse_in(this, is_global=True),
    278        }
    279
    280        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    281        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    282        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    283        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    284
    285        JOIN_KINDS = {
    286            *parser.Parser.JOIN_KINDS,
    287            TokenType.ANY,
    288            TokenType.ASOF,
    289            TokenType.ARRAY,
    290        }
    291
    292        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    293            TokenType.ANY,
    294            TokenType.ARRAY,
    295            TokenType.FINAL,
    296            TokenType.FORMAT,
    297            TokenType.SETTINGS,
    298        }
    299
    300        LOG_DEFAULTS_TO_LN = True
    301
    302        QUERY_MODIFIER_PARSERS = {
    303            **parser.Parser.QUERY_MODIFIER_PARSERS,
    304            TokenType.SETTINGS: lambda self: (
    305                "settings",
    306                self._advance() or self._parse_csv(self._parse_conjunction),
    307            ),
    308            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    309        }
    310
    311        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    312            this = super()._parse_conjunction()
    313
    314            if self._match(TokenType.PLACEHOLDER):
    315                return self.expression(
    316                    exp.If,
    317                    this=this,
    318                    true=self._parse_conjunction(),
    319                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    320                )
    321
    322            return this
    323
    324        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    325            """
    326            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    327            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    328            """
    329            if not self._match(TokenType.L_BRACE):
    330                return None
    331
    332            this = self._parse_id_var()
    333            self._match(TokenType.COLON)
    334            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    335                self._match_text_seq("IDENTIFIER") and "Identifier"
    336            )
    337
    338            if not kind:
    339                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    340            elif not self._match(TokenType.R_BRACE):
    341                self.raise_error("Expecting }")
    342
    343            return self.expression(exp.Placeholder, this=this, kind=kind)
    344
    345        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    346            this = super()._parse_in(this)
    347            this.set("is_global", is_global)
    348            return this
    349
    350        def _parse_table(
    351            self,
    352            schema: bool = False,
    353            joins: bool = False,
    354            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    355            parse_bracket: bool = False,
    356        ) -> t.Optional[exp.Expression]:
    357            this = super()._parse_table(
    358                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    359            )
    360
    361            if self._match(TokenType.FINAL):
    362                this = self.expression(exp.Final, this=this)
    363
    364            return this
    365
    366        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    367            return super()._parse_position(haystack_first=True)
    368
    369        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    370        def _parse_cte(self) -> exp.CTE:
    371            index = self._index
    372            try:
    373                # WITH <identifier> AS <subquery expression>
    374                return super()._parse_cte()
    375            except ParseError:
    376                # WITH <expression> AS <identifier>
    377                self._retreat(index)
    378
    379                return self.expression(
    380                    exp.CTE,
    381                    this=self._parse_field(),
    382                    alias=self._parse_table_alias(),
    383                    scalar=True,
    384                )
    385
    386        def _parse_join_parts(
    387            self,
    388        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    389            is_global = self._match(TokenType.GLOBAL) and self._prev
    390            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    391
    392            if kind_pre:
    393                kind = self._match_set(self.JOIN_KINDS) and self._prev
    394                side = self._match_set(self.JOIN_SIDES) and self._prev
    395                return is_global, side, kind
    396
    397            return (
    398                is_global,
    399                self._match_set(self.JOIN_SIDES) and self._prev,
    400                self._match_set(self.JOIN_KINDS) and self._prev,
    401            )
    402
    403        def _parse_join(
    404            self, skip_join_token: bool = False, parse_bracket: bool = False
    405        ) -> t.Optional[exp.Join]:
    406            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    407
    408            if join:
    409                join.set("global", join.args.pop("method", None))
    410            return join
    411
    412        def _parse_function(
    413            self,
    414            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    415            anonymous: bool = False,
    416            optional_parens: bool = True,
    417        ) -> t.Optional[exp.Expression]:
    418            func = super()._parse_function(
    419                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    420            )
    421
    422            if isinstance(func, exp.Anonymous):
    423                parts = self.AGG_FUNC_MAPPING.get(func.this)
    424                params = self._parse_func_params(func)
    425
    426                if params:
    427                    if parts and parts[1]:
    428                        return self.expression(
    429                            exp.CombinedParameterizedAgg,
    430                            this=func.this,
    431                            expressions=func.expressions,
    432                            params=params,
    433                            parts=parts,
    434                        )
    435                    return self.expression(
    436                        exp.ParameterizedAgg,
    437                        this=func.this,
    438                        expressions=func.expressions,
    439                        params=params,
    440                    )
    441
    442                if parts:
    443                    if parts[1]:
    444                        return self.expression(
    445                            exp.CombinedAggFunc,
    446                            this=func.this,
    447                            expressions=func.expressions,
    448                            parts=parts,
    449                        )
    450                    return self.expression(
    451                        exp.AnonymousAggFunc,
    452                        this=func.this,
    453                        expressions=func.expressions,
    454                    )
    455
    456            return func
    457
    458        def _parse_func_params(
    459            self, this: t.Optional[exp.Func] = None
    460        ) -> t.Optional[t.List[exp.Expression]]:
    461            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    462                return self._parse_csv(self._parse_lambda)
    463
    464            if self._match(TokenType.L_PAREN):
    465                params = self._parse_csv(self._parse_lambda)
    466                self._match_r_paren(this)
    467                return params
    468
    469            return None
    470
    471        def _parse_quantile(self) -> exp.Quantile:
    472            this = self._parse_lambda()
    473            params = self._parse_func_params()
    474            if params:
    475                return self.expression(exp.Quantile, this=params[0], quantile=this)
    476            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    477
    478        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    479            return super()._parse_wrapped_id_vars(optional=True)
    480
    481        def _parse_primary_key(
    482            self, wrapped_optional: bool = False, in_props: bool = False
    483        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    484            return super()._parse_primary_key(
    485                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    486            )
    487
    488        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    489            index = self._index
    490            if self._match_text_seq("CLUSTER"):
    491                this = self._parse_id_var()
    492                if this:
    493                    return self.expression(exp.OnCluster, this=this)
    494                else:
    495                    self._retreat(index)
    496            return None

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: Determines 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
FUNCTIONS = {'ABS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Abs'>>, '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_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_JOIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayJoin'>>, 'ARRAY_SIZE': <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_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'>>, '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>>, '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 _parse_count_if>, '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'>>, '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_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, 'GET_PATH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GetPath'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONExtract'>>, 'JSON_EXTRACT_SCALAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONExtractScalar'>>, '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'>>, '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'>>, '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 parse_logarithm>, 'LOG10': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Log10'>>, 'LOG2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Log2'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MAP': <function parse_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'>>, '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'>>, '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'>>, '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'>>, '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'>>, '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_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'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'VAR_MAP': <function parse_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>>, 'LIKE': <function parse_like>, '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>>, 'MATCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'RANDCANONICAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'UNIQ': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>}
AGG_FUNCTIONS = {'deltaSumTimestamp', 'quantileDeterministic', 'quantilesDeterministic', 'stochasticLogisticRegression', 'quantileTDigestWeighted', 'quantileGK', 'stochasticLinearRegression', 'maxIntersectionsPosition', 'quantilesGK', 'quantileExact', 'minMap', 'quantilesBFloat16', 'entropy', 'quantileTiming', 'uniqTheta', 'quantilesBFloat16Weighted', 'groupBitOr', 'varSamp', 'min', 'kolmogorovSmirnovTest', 'first_value', 'quantilesInterpolatedWeighted', 'last_value', 'groupBitmap', 'cramersV', 'groupBitAnd', 'welchTTest', 'uniqCombined', 'groupBitXor', 'groupArray', 'meanZTest', 'quantilesTDigestWeighted', 'argMax', 'groupArrayLast', 'quantilesExactLow', 'groupArrayInsertAt', 'groupBitmapAnd', 'quantilesExactHigh', 'uniqHLL12', 'anyHeavy', 'covarSamp', 'avg', 'sparkBar', 'contingency', 'cramersVBiasCorrected', 'max', 'kurtPop', 'sumCount', 'rankCorr', 'groupBitmapOr', 'categoricalInformationValue', 'topKWeighted', 'mannWhitneyUTest', 'kurtSamp', 'avgWeighted', 'sumWithOverflow', 'varPop', 'covarPop', 'quantileExactHigh', 'any', 'stddevSamp', 'quantileTimingWeighted', 'quantileInterpolatedWeighted', 'groupArrayMovingAvg', 'anyLast', 'boundingRatio', 'intervalLengthSum', 'median', 'largestTriangleThreeBuckets', 'quantiles', 'quantileExactLow', 'quantilesExactWeighted', 'uniqExact', 'simpleLinearRegression', 'sumKahan', 'groupArraySample', 'uniqCombined64', 'quantileExactWeighted', 'uniq', 'quantileBFloat16', 'quantileTDigest', 'groupUniqArray', 'count', 'quantilesTDigest', 'exponentialMovingAverage', 'maxMap', 'deltaSum', 'quantilesTiming', 'sum', 'quantilesTimingWeighted', 'quantile', 'sumMap', 'studentTTest', 'skewSamp', 'quantileBFloat16Weighted', 'maxIntersections', 'corr', 'stddevPop', 'argMin', 'skewPop', 'theilsU', 'groupArrayMovingSum', 'groupBitmapXor', 'topK', 'quantilesExact'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
AGG_FUNC_MAPPING = {'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'minMapIf': ('minMap', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'entropyIf': ('entropy', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'varSampIf': ('varSamp', 'If'), 'minIf': ('min', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'first_valueIf': ('first_value', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'last_valueIf': ('last_value', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'cramersVIf': ('cramersV', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'argMaxIf': ('argMax', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'avgIf': ('avg', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'contingencyIf': ('contingency', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'maxIf': ('max', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'sumCountIf': ('sumCount', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'varPopIf': ('varPop', 'If'), 'covarPopIf': ('covarPop', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'anyIf': ('any', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'anyLastIf': ('anyLast', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'medianIf': ('median', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'quantilesIf': ('quantiles', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'uniqIf': ('uniq', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'countIf': ('count', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'maxMapIf': ('maxMap', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'sumIf': ('sum', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'quantileIf': ('quantile', 'If'), 'sumMapIf': ('sumMap', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'corrIf': ('corr', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'argMinIf': ('argMin', 'If'), 'skewPopIf': ('skewPop', 'If'), 'theilsUIf': ('theilsU', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'topKIf': ('topK', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'minMapArray': ('minMap', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'entropyArray': ('entropy', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'minArray': ('min', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'avgArray': ('avg', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'maxArray': ('max', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'varPopArray': ('varPop', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'anyArray': ('any', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'medianArray': ('median', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'uniqArray': ('uniq', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'countArray': ('count', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'sumArray': ('sum', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'quantileArray': ('quantile', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'corrArray': ('corr', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'argMinArray': ('argMin', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'topKArray': ('topK', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'minMapMap': ('minMap', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'entropyMap': ('entropy', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'minMap': ('minMap', ''), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'avgMap': ('avg', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'maxMap': ('maxMap', ''), 'kurtPopMap': ('kurtPop', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'varPopMap': ('varPop', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'anyMap': ('any', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'medianMap': ('median', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'uniqMap': ('uniq', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'countMap': ('count', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'sumMap': ('sumMap', ''), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'quantileMap': ('quantile', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'corrMap': ('corr', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'argMinMap': ('argMin', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'topKMap': ('topK', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'minMapState': ('minMap', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'entropyState': ('entropy', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'varSampState': ('varSamp', 'State'), 'minState': ('min', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'first_valueState': ('first_value', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'last_valueState': ('last_value', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'cramersVState': ('cramersV', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'groupArrayState': ('groupArray', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'argMaxState': ('argMax', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'covarSampState': ('covarSamp', 'State'), 'avgState': ('avg', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'contingencyState': ('contingency', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'maxState': ('max', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'sumCountState': ('sumCount', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'varPopState': ('varPop', 'State'), 'covarPopState': ('covarPop', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'anyState': ('any', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'anyLastState': ('anyLast', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'medianState': ('median', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'quantilesState': ('quantiles', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'uniqState': ('uniq', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'countState': ('count', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'maxMapState': ('maxMap', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'sumState': ('sum', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'quantileState': ('quantile', 'State'), 'sumMapState': ('sumMap', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'skewSampState': ('skewSamp', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'corrState': ('corr', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'argMinState': ('argMin', 'State'), 'skewPopState': ('skewPop', 'State'), 'theilsUState': ('theilsU', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'topKState': ('topK', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'minMerge': ('min', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'maxMerge': ('max', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'anyMerge': ('any', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'medianMerge': ('median', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'countMerge': ('count', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'minResample': ('min', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'avgResample': ('avg', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'maxResample': ('max', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'anyResample': ('any', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'medianResample': ('median', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'countResample': ('count', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'sumResample': ('sum', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'corrResample': ('corr', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'topKResample': ('topK', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'quantileGK': ('quantileGK', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'quantilesGK': ('quantilesGK', ''), 'quantileExact': ('quantileExact', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'entropy': ('entropy', ''), 'quantileTiming': ('quantileTiming', ''), 'uniqTheta': ('uniqTheta', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'groupBitOr': ('groupBitOr', ''), 'varSamp': ('varSamp', ''), 'min': ('min', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'first_value': ('first_value', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'last_value': ('last_value', ''), 'groupBitmap': ('groupBitmap', ''), 'cramersV': ('cramersV', ''), 'groupBitAnd': ('groupBitAnd', ''), 'welchTTest': ('welchTTest', ''), 'uniqCombined': ('uniqCombined', ''), 'groupBitXor': ('groupBitXor', ''), 'groupArray': ('groupArray', ''), 'meanZTest': ('meanZTest', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'argMax': ('argMax', ''), 'groupArrayLast': ('groupArrayLast', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'uniqHLL12': ('uniqHLL12', ''), 'anyHeavy': ('anyHeavy', ''), 'covarSamp': ('covarSamp', ''), 'avg': ('avg', ''), 'sparkBar': ('sparkBar', ''), 'contingency': ('contingency', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'max': ('max', ''), 'kurtPop': ('kurtPop', ''), 'sumCount': ('sumCount', ''), 'rankCorr': ('rankCorr', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'topKWeighted': ('topKWeighted', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'kurtSamp': ('kurtSamp', ''), 'avgWeighted': ('avgWeighted', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'varPop': ('varPop', ''), 'covarPop': ('covarPop', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'any': ('any', ''), 'stddevSamp': ('stddevSamp', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'anyLast': ('anyLast', ''), 'boundingRatio': ('boundingRatio', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'median': ('median', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'quantiles': ('quantiles', ''), 'quantileExactLow': ('quantileExactLow', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'uniqExact': ('uniqExact', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'sumKahan': ('sumKahan', ''), 'groupArraySample': ('groupArraySample', ''), 'uniqCombined64': ('uniqCombined64', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'uniq': ('uniq', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'quantileTDigest': ('quantileTDigest', ''), 'groupUniqArray': ('groupUniqArray', ''), 'count': ('count', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'deltaSum': ('deltaSum', ''), 'quantilesTiming': ('quantilesTiming', ''), 'sum': ('sum', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'quantile': ('quantile', ''), 'studentTTest': ('studentTTest', ''), 'skewSamp': ('skewSamp', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'maxIntersections': ('maxIntersections', ''), 'corr': ('corr', ''), 'stddevPop': ('stddevPop', ''), 'argMin': ('argMin', ''), 'skewPop': ('skewPop', ''), 'theilsU': ('theilsU', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'topK': ('topK', ''), 'quantilesExact': ('quantilesExact', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'STRUCT', 'TUPLE'}
FUNCTION_PARSERS = {'ANY_VALUE': <function Parser.<lambda>>, '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.ANY: 'ANY'>, <TokenType.SEMI: 'SEMI'>, <TokenType.ANTI: 'ANTI'>, <TokenType.CROSS: 'CROSS'>, <TokenType.ASOF: 'ASOF'>, <TokenType.INNER: 'INNER'>, <TokenType.OUTER: 'OUTER'>}
TABLE_ALIAS_TOKENS = {<TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.JSON: 'JSON'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.LOAD: 'LOAD'>, <TokenType.SOME: 'SOME'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.INET: 'INET'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.CACHE: 'CACHE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.UINT128: 'UINT128'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.SUPER: 'SUPER'>, <TokenType.DELETE: 'DELETE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.INT256: 'INT256'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.KILL: 'KILL'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.IPV4: 'IPV4'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.BIT: 'BIT'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.ROWS: 'ROWS'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.ALL: 'ALL'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.IS: 'IS'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.MERGE: 'MERGE'>, <TokenType.ROW: 'ROW'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.END: 'END'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.TEXT: 'TEXT'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.FALSE: 'FALSE'>, <TokenType.BINARY: 'BINARY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.JSONB: 'JSONB'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.NESTED: 'NESTED'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.VIEW: 'VIEW'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.DATE: 'DATE'>, <TokenType.INT: 'INT'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.DATE32: 'DATE32'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.TIME: 'TIME'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.MAP: 'MAP'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.DIV: 'DIV'>, <TokenType.MONEY: 'MONEY'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.DESC: 'DESC'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.CHAR: 'CHAR'>, <TokenType.XML: 'XML'>, <TokenType.INT128: 'INT128'>, <TokenType.NULL: 'NULL'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.KEEP: 'KEEP'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.USE: 'USE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.UINT: 'UINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.UINT256: 'UINT256'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.ENUM: 'ENUM'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.TOP: 'TOP'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UUID: 'UUID'>, <TokenType.IPV6: 'IPV6'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.SHOW: 'SHOW'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.SET: 'SET'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.ASC: 'ASC'>, <TokenType.VAR: 'VAR'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.CASE: 'CASE'>, <TokenType.FIRST: 'FIRST'>}
LOG_DEFAULTS_TO_LN = True
QUERY_MODIFIER_PARSERS = {<TokenType.MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'>: <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>>}
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
  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
  FUNC_TOKENS
  CONJUNCTION
  EQUALITY
  COMPARISON
  BITWISE
  TERM
  FACTOR
  EXPONENT
  TIMES
  TIMESTAMPS
  SET_OPERATIONS
  JOIN_METHODS
  JOIN_SIDES
  JOIN_HINTS
  LAMBDAS
  EXPRESSION_PARSERS
  STATEMENT_PARSERS
  UNARY_PARSERS
  PRIMARY_PARSERS
  PLACEHOLDER_PARSERS
  PROPERTY_PARSERS
  CONSTRAINT_PARSERS
  ALTER_PARSERS
  SCHEMA_UNNAMED_CONSTRAINTS
  INVALID_FUNC_NAME_TOKENS
  SET_PARSERS
  SHOW_PARSERS
  TYPE_LITERAL_PARSERS
  MODIFIABLES
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  HISTORICAL_DATA_KIND
  OPCLASS_FOLLOW_KEYWORDS
  OPTYPE_FOLLOW_TOKENS
  TABLE_INDEX_HINT_TOKENS
  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
  STRICT_CAST
  PREFIXED_PIVOT_COLUMNS
  IDENTIFY_PIVOT_STRINGS
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
  TABLESAMPLE_CSV
  SET_REQUIRES_ASSIGNMENT_DELIMITER
  TRIM_PATTERN_FIRST
  STRING_ALIASES
  UNION_MODIFIERS
  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

    498    class Generator(generator.Generator):
    499        QUERY_HINTS = False
    500        STRUCT_DELIMITER = ("(", ")")
    501        NVL2_SUPPORTED = False
    502        TABLESAMPLE_REQUIRES_PARENS = False
    503        TABLESAMPLE_SIZE_IS_ROWS = False
    504        TABLESAMPLE_KEYWORDS = "SAMPLE"
    505        LAST_DAY_SUPPORTS_DATE_PART = False
    506
    507        STRING_TYPE_MAPPING = {
    508            exp.DataType.Type.CHAR: "String",
    509            exp.DataType.Type.LONGBLOB: "String",
    510            exp.DataType.Type.LONGTEXT: "String",
    511            exp.DataType.Type.MEDIUMBLOB: "String",
    512            exp.DataType.Type.MEDIUMTEXT: "String",
    513            exp.DataType.Type.TINYBLOB: "String",
    514            exp.DataType.Type.TINYTEXT: "String",
    515            exp.DataType.Type.TEXT: "String",
    516            exp.DataType.Type.VARBINARY: "String",
    517            exp.DataType.Type.VARCHAR: "String",
    518        }
    519
    520        TYPE_MAPPING = {
    521            **generator.Generator.TYPE_MAPPING,
    522            **STRING_TYPE_MAPPING,
    523            exp.DataType.Type.ARRAY: "Array",
    524            exp.DataType.Type.BIGINT: "Int64",
    525            exp.DataType.Type.DATE32: "Date32",
    526            exp.DataType.Type.DATETIME64: "DateTime64",
    527            exp.DataType.Type.DOUBLE: "Float64",
    528            exp.DataType.Type.ENUM: "Enum",
    529            exp.DataType.Type.ENUM8: "Enum8",
    530            exp.DataType.Type.ENUM16: "Enum16",
    531            exp.DataType.Type.FIXEDSTRING: "FixedString",
    532            exp.DataType.Type.FLOAT: "Float32",
    533            exp.DataType.Type.INT: "Int32",
    534            exp.DataType.Type.MEDIUMINT: "Int32",
    535            exp.DataType.Type.INT128: "Int128",
    536            exp.DataType.Type.INT256: "Int256",
    537            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    538            exp.DataType.Type.MAP: "Map",
    539            exp.DataType.Type.NESTED: "Nested",
    540            exp.DataType.Type.NULLABLE: "Nullable",
    541            exp.DataType.Type.SMALLINT: "Int16",
    542            exp.DataType.Type.STRUCT: "Tuple",
    543            exp.DataType.Type.TINYINT: "Int8",
    544            exp.DataType.Type.UBIGINT: "UInt64",
    545            exp.DataType.Type.UINT: "UInt32",
    546            exp.DataType.Type.UINT128: "UInt128",
    547            exp.DataType.Type.UINT256: "UInt256",
    548            exp.DataType.Type.USMALLINT: "UInt16",
    549            exp.DataType.Type.UTINYINT: "UInt8",
    550            exp.DataType.Type.IPV4: "IPv4",
    551            exp.DataType.Type.IPV6: "IPv6",
    552        }
    553
    554        TRANSFORMS = {
    555            **generator.Generator.TRANSFORMS,
    556            exp.AnyValue: rename_func("any"),
    557            exp.ApproxDistinct: rename_func("uniq"),
    558            exp.ArraySum: rename_func("arraySum"),
    559            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    560            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    561            exp.Array: inline_array_sql,
    562            exp.CastToStrType: rename_func("CAST"),
    563            exp.CountIf: rename_func("countIf"),
    564            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    565            exp.DateAdd: date_delta_sql("DATE_ADD"),
    566            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    567            exp.Explode: rename_func("arrayJoin"),
    568            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    569            exp.IsNan: rename_func("isNaN"),
    570            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    571            exp.Nullif: rename_func("nullIf"),
    572            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    573            exp.Pivot: no_pivot_sql,
    574            exp.Quantile: _quantile_sql,
    575            exp.RegexpLike: lambda self, e: f"match({self.format_args(e.this, e.expression)})",
    576            exp.Rand: rename_func("randCanonical"),
    577            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    578            exp.StartsWith: rename_func("startsWith"),
    579            exp.StrPosition: lambda self, e: f"position({self.format_args(e.this, e.args.get('substr'), e.args.get('position'))})",
    580            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    581            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    582        }
    583
    584        PROPERTIES_LOCATION = {
    585            **generator.Generator.PROPERTIES_LOCATION,
    586            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    587            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    588            exp.OnCluster: exp.Properties.Location.POST_NAME,
    589        }
    590
    591        JOIN_HINTS = False
    592        TABLE_HINTS = False
    593        EXPLICIT_UNION = True
    594        GROUPINGS_SEP = ""
    595
    596        # there's no list in docs, but it can be found in Clickhouse code
    597        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    598        ON_CLUSTER_TARGETS = {
    599            "DATABASE",
    600            "TABLE",
    601            "VIEW",
    602            "DICTIONARY",
    603            "INDEX",
    604            "FUNCTION",
    605            "NAMED COLLECTION",
    606        }
    607
    608        def _any_to_has(
    609            self,
    610            expression: exp.EQ | exp.NEQ,
    611            default: t.Callable[[t.Any], str],
    612            prefix: str = "",
    613        ) -> str:
    614            if isinstance(expression.left, exp.Any):
    615                arr = expression.left
    616                this = expression.right
    617            elif isinstance(expression.right, exp.Any):
    618                arr = expression.right
    619                this = expression.left
    620            else:
    621                return default(expression)
    622            return prefix + self.func("has", arr.this.unnest(), this)
    623
    624        def eq_sql(self, expression: exp.EQ) -> str:
    625            return self._any_to_has(expression, super().eq_sql)
    626
    627        def neq_sql(self, expression: exp.NEQ) -> str:
    628            return self._any_to_has(expression, super().neq_sql, "NOT ")
    629
    630        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    631            # Manually add a flag to make the search case-insensitive
    632            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    633            return f"match({self.format_args(expression.this, regex)})"
    634
    635        def datatype_sql(self, expression: exp.DataType) -> str:
    636            # String is the standard ClickHouse type, every other variant is just an alias.
    637            # Additionally, any supplied length parameter will be ignored.
    638            #
    639            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    640            if expression.this in self.STRING_TYPE_MAPPING:
    641                return "String"
    642
    643            return super().datatype_sql(expression)
    644
    645        def cte_sql(self, expression: exp.CTE) -> str:
    646            if expression.args.get("scalar"):
    647                this = self.sql(expression, "this")
    648                alias = self.sql(expression, "alias")
    649                return f"{this} AS {alias}"
    650
    651            return super().cte_sql(expression)
    652
    653        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    654            return super().after_limit_modifiers(expression) + [
    655                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    656                if expression.args.get("settings")
    657                else "",
    658                self.seg("FORMAT ") + self.sql(expression, "format")
    659                if expression.args.get("format")
    660                else "",
    661            ]
    662
    663        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    664            params = self.expressions(expression, key="params", flat=True)
    665            return self.func(expression.name, *expression.expressions) + f"({params})"
    666
    667        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    668            return self.func(expression.name, *expression.expressions)
    669
    670        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    671            return self.anonymousaggfunc_sql(expression)
    672
    673        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    674            return self.parameterizedagg_sql(expression)
    675
    676        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    677            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    678
    679        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    680            return f"ON CLUSTER {self.sql(expression, 'this')}"
    681
    682        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    683            kind = self.sql(expression, "kind").upper()
    684            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    685                this_name = self.sql(expression.this, "this")
    686                this_properties = " ".join(
    687                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    688                )
    689                this_schema = self.schema_columns_sql(expression.this)
    690                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    691
    692            return super().createable_sql(expression, locations)

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

###### Arguments:

- pretty: Whether or not 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 or not to normalize identifiers to lowercase. Default: False.
- pad: Determines the pad size in a formatted string. Default: 2.
- indent: Determines the indentation size in a formatted string. Default: 2.
- normalize_functions: Whether or not to normalize all 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: Determines whether or not 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 or not 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
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'}
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.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'}
TRANSFORMS = {<class 'sqlglot.expressions.DateAdd'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CheckColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CommentColumnConstraint'>: <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.ExecuteAsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExternalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.HeapProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InlineLengthColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LanguageProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LocationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.MaterializedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NonClusteredColumnConstraint'>: <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.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SettingsProperty'>: <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.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ToTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransientProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransformModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VarMap'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AnyValue'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ApproxDistinct'>: <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.CurrentDate'>: <function ClickHouse.Generator.<lambda>>, <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.Xor'>: <function ClickHouse.Generator.<lambda>>}
PROPERTIES_LOCATION = {<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.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.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.HeapProperty'>: <Location.POST_WITH: 'POST_WITH'>, <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.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.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.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.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 = ''
ON_CLUSTER_TARGETS = {'NAMED COLLECTION', 'FUNCTION', 'INDEX', 'DATABASE', 'DICTIONARY', 'VIEW', 'TABLE'}
def eq_sql(self, expression: sqlglot.expressions.EQ) -> str: View Source

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

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

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

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

    630        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    631            # Manually add a flag to make the search case-insensitive
    632            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    633            return f"match({self.format_args(expression.this, regex)})"

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

    635        def datatype_sql(self, expression: exp.DataType) -> str:
    636            # String is the standard ClickHouse type, every other variant is just an alias.
    637            # Additionally, any supplied length parameter will be ignored.
    638            #
    639            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    640            if expression.this in self.STRING_TYPE_MAPPING:
    641                return "String"
    642
    643            return super().datatype_sql(expression)

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

    645        def cte_sql(self, expression: exp.CTE) -> str:
    646            if expression.args.get("scalar"):
    647                this = self.sql(expression, "this")
    648                alias = self.sql(expression, "alias")
    649                return f"{this} AS {alias}"
    650
    651            return super().cte_sql(expression)

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

    653        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    654            return super().after_limit_modifiers(expression) + [
    655                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    656                if expression.args.get("settings")
    657                else "",
    658                self.seg("FORMAT ") + self.sql(expression, "format")
    659                if expression.args.get("format")
    660                else "",
    661            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

    682        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    683            kind = self.sql(expression, "kind").upper()
    684            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    685                this_name = self.sql(expression.this, "this")
    686                this_properties = " ".join(
    687                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    688                )
    689                this_schema = self.schema_columns_sql(expression.this)
    690                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    691
    692            return super().createable_sql(expression, locations)

SELECT_KINDS: Tuple[str, ...] = ()

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  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
  STAR_MAPPING
  TIME_PART_SINGULARS
  TOKEN_MAPPING
  PARAMETER_TOKEN
  RESERVED_KEYWORDS
  WITH_SEPARATED_COMMENTS
  EXCLUDE_COMMENTS
  UNWRAPPED_INTERVAL_VALUES
  EXPRESSIONS_WITHOUT_NESTED_CTES
  KEY_VALUE_DEFINITIONS
  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_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
  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
  index_sql
  identifier_sql
  inputoutputformat_sql
  national_sql
  partition_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_name
  property_sql
  likeproperty_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_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
  matchrecognize_sql
  query_modifiers
  offset_limit_modifiers
  after_having_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  subquery_sql
  qualify_sql
  union_sql
  union_op
  unnest_sql
  where_sql
  window_sql
  partition_by_sql
  windowspec_sql
  withingroup_sql
  between_sql
  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
  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
  add_sql
  and_sql
  xor_sql
  connector_sql
  bitwiseand_sql
  bitwiseleftshift_sql
  bitwisenot_sql
  bitwiseor_sql
  bitwiserightshift_sql
  bitwisexor_sql
  cast_sql
  currentdate_sql
  collate_sql
  command_sql
  comment_sql
  mergetreettlaction_sql
  mergetreettl_sql
  transaction_sql
  commit_sql
  rollback_sql
  altercolumn_sql
  renametable_sql
  altertable_sql
  add_column_sql
  droppartition_sql
  addconstraint_sql
  distinct_sql
  ignorenulls_sql
  respectnulls_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
  or_sql
  slice_sql
  sub_sql
  trycast_sql
  log_sql
  use_sql
  binary
  function_fallback_sql
  func
  format_args
  text_width
  format_time
  expressions
  op_expressions
  naked_property
  set_operation
  tag_sql
  token_sql
  userdefinedfunction_sql
  joinhint_sql
  kwarg_sql
  when_sql
  merge_sql
  tochar_sql
  dictproperty_sql
  dictrange_sql
  dictsubproperty_sql
  clusteredbyproperty_sql
  anyvalue_sql
  querytransform_sql
  indexconstraintoption_sql
  indexcolumnconstraint_sql
  nvl2_sql
  comprehension_sql
  columnprefix_sql
  opclass_sql
  predict_sql
  forin_sql
  refresh_sql
  operator_sql
  toarray_sql
  tsordstotime_sql
  tsordstodate_sql
  unixdate_sql
  lastday_sql