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

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'>, 'BPCHAR': <TokenType.BPCHAR: 'BPCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, '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'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>}
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

    101    class Parser(parser.Parser):
    102        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
    103        # * select x from t1 union all select x from t2 limit 1;
    104        # * select x from t1 union all (select x from t2 limit 1);
    105        MODIFIERS_ATTACHED_TO_UNION = False
    106
    107        FUNCTIONS = {
    108            **parser.Parser.FUNCTIONS,
    109            "ANY": exp.AnyValue.from_arg_list,
    110            "ARRAYSUM": exp.ArraySum.from_arg_list,
    111            "COUNTIF": _parse_count_if,
    112            "DATE_ADD": lambda args: exp.DateAdd(
    113                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    114            ),
    115            "DATEADD": lambda args: exp.DateAdd(
    116                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    117            ),
    118            "DATE_DIFF": lambda args: exp.DateDiff(
    119                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    120            ),
    121            "DATEDIFF": lambda args: exp.DateDiff(
    122                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
    123            ),
    124            "MAP": parse_var_map,
    125            "MATCH": exp.RegexpLike.from_arg_list,
    126            "RANDCANONICAL": exp.Rand.from_arg_list,
    127            "UNIQ": exp.ApproxDistinct.from_arg_list,
    128            "XOR": lambda args: exp.Xor(expressions=args),
    129        }
    130
    131        AGG_FUNCTIONS = {
    132            "count",
    133            "min",
    134            "max",
    135            "sum",
    136            "avg",
    137            "any",
    138            "stddevPop",
    139            "stddevSamp",
    140            "varPop",
    141            "varSamp",
    142            "corr",
    143            "covarPop",
    144            "covarSamp",
    145            "entropy",
    146            "exponentialMovingAverage",
    147            "intervalLengthSum",
    148            "kolmogorovSmirnovTest",
    149            "mannWhitneyUTest",
    150            "median",
    151            "rankCorr",
    152            "sumKahan",
    153            "studentTTest",
    154            "welchTTest",
    155            "anyHeavy",
    156            "anyLast",
    157            "boundingRatio",
    158            "first_value",
    159            "last_value",
    160            "argMin",
    161            "argMax",
    162            "avgWeighted",
    163            "topK",
    164            "topKWeighted",
    165            "deltaSum",
    166            "deltaSumTimestamp",
    167            "groupArray",
    168            "groupArrayLast",
    169            "groupUniqArray",
    170            "groupArrayInsertAt",
    171            "groupArrayMovingAvg",
    172            "groupArrayMovingSum",
    173            "groupArraySample",
    174            "groupBitAnd",
    175            "groupBitOr",
    176            "groupBitXor",
    177            "groupBitmap",
    178            "groupBitmapAnd",
    179            "groupBitmapOr",
    180            "groupBitmapXor",
    181            "sumWithOverflow",
    182            "sumMap",
    183            "minMap",
    184            "maxMap",
    185            "skewSamp",
    186            "skewPop",
    187            "kurtSamp",
    188            "kurtPop",
    189            "uniq",
    190            "uniqExact",
    191            "uniqCombined",
    192            "uniqCombined64",
    193            "uniqHLL12",
    194            "uniqTheta",
    195            "quantile",
    196            "quantiles",
    197            "quantileExact",
    198            "quantilesExact",
    199            "quantileExactLow",
    200            "quantilesExactLow",
    201            "quantileExactHigh",
    202            "quantilesExactHigh",
    203            "quantileExactWeighted",
    204            "quantilesExactWeighted",
    205            "quantileTiming",
    206            "quantilesTiming",
    207            "quantileTimingWeighted",
    208            "quantilesTimingWeighted",
    209            "quantileDeterministic",
    210            "quantilesDeterministic",
    211            "quantileTDigest",
    212            "quantilesTDigest",
    213            "quantileTDigestWeighted",
    214            "quantilesTDigestWeighted",
    215            "quantileBFloat16",
    216            "quantilesBFloat16",
    217            "quantileBFloat16Weighted",
    218            "quantilesBFloat16Weighted",
    219            "simpleLinearRegression",
    220            "stochasticLinearRegression",
    221            "stochasticLogisticRegression",
    222            "categoricalInformationValue",
    223            "contingency",
    224            "cramersV",
    225            "cramersVBiasCorrected",
    226            "theilsU",
    227            "maxIntersections",
    228            "maxIntersectionsPosition",
    229            "meanZTest",
    230            "quantileInterpolatedWeighted",
    231            "quantilesInterpolatedWeighted",
    232            "quantileGK",
    233            "quantilesGK",
    234            "sparkBar",
    235            "sumCount",
    236            "largestTriangleThreeBuckets",
    237        }
    238
    239        AGG_FUNCTIONS_SUFFIXES = [
    240            "If",
    241            "Array",
    242            "ArrayIf",
    243            "Map",
    244            "SimpleState",
    245            "State",
    246            "Merge",
    247            "MergeState",
    248            "ForEach",
    249            "Distinct",
    250            "OrDefault",
    251            "OrNull",
    252            "Resample",
    253            "ArgMin",
    254            "ArgMax",
    255        ]
    256
    257        AGG_FUNC_MAPPING = (
    258            lambda functions, suffixes: {
    259                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
    260            }
    261        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
    262
    263        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
    264
    265        FUNCTION_PARSERS = {
    266            **parser.Parser.FUNCTION_PARSERS,
    267            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
    268            "QUANTILE": lambda self: self._parse_quantile(),
    269        }
    270
    271        FUNCTION_PARSERS.pop("MATCH")
    272
    273        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
    274        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
    275
    276        RANGE_PARSERS = {
    277            **parser.Parser.RANGE_PARSERS,
    278            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
    279            and self._parse_in(this, is_global=True),
    280        }
    281
    282        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
    283        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
    284        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
    285        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
    286
    287        JOIN_KINDS = {
    288            *parser.Parser.JOIN_KINDS,
    289            TokenType.ANY,
    290            TokenType.ASOF,
    291            TokenType.ARRAY,
    292        }
    293
    294        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
    295            TokenType.ANY,
    296            TokenType.ARRAY,
    297            TokenType.FINAL,
    298            TokenType.FORMAT,
    299            TokenType.SETTINGS,
    300        }
    301
    302        LOG_DEFAULTS_TO_LN = True
    303
    304        QUERY_MODIFIER_PARSERS = {
    305            **parser.Parser.QUERY_MODIFIER_PARSERS,
    306            TokenType.SETTINGS: lambda self: (
    307                "settings",
    308                self._advance() or self._parse_csv(self._parse_conjunction),
    309            ),
    310            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
    311        }
    312
    313        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
    314            this = super()._parse_conjunction()
    315
    316            if self._match(TokenType.PLACEHOLDER):
    317                return self.expression(
    318                    exp.If,
    319                    this=this,
    320                    true=self._parse_conjunction(),
    321                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
    322                )
    323
    324            return this
    325
    326        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
    327            """
    328            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
    329            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
    330            """
    331            if not self._match(TokenType.L_BRACE):
    332                return None
    333
    334            this = self._parse_id_var()
    335            self._match(TokenType.COLON)
    336            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
    337                self._match_text_seq("IDENTIFIER") and "Identifier"
    338            )
    339
    340            if not kind:
    341                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
    342            elif not self._match(TokenType.R_BRACE):
    343                self.raise_error("Expecting }")
    344
    345            return self.expression(exp.Placeholder, this=this, kind=kind)
    346
    347        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
    348            this = super()._parse_in(this)
    349            this.set("is_global", is_global)
    350            return this
    351
    352        def _parse_table(
    353            self,
    354            schema: bool = False,
    355            joins: bool = False,
    356            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
    357            parse_bracket: bool = False,
    358            is_db_reference: bool = False,
    359        ) -> t.Optional[exp.Expression]:
    360            this = super()._parse_table(
    361                schema=schema,
    362                joins=joins,
    363                alias_tokens=alias_tokens,
    364                parse_bracket=parse_bracket,
    365                is_db_reference=is_db_reference,
    366            )
    367
    368            if self._match(TokenType.FINAL):
    369                this = self.expression(exp.Final, this=this)
    370
    371            return this
    372
    373        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    374            return super()._parse_position(haystack_first=True)
    375
    376        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    377        def _parse_cte(self) -> exp.CTE:
    378            index = self._index
    379            try:
    380                # WITH <identifier> AS <subquery expression>
    381                return super()._parse_cte()
    382            except ParseError:
    383                # WITH <expression> AS <identifier>
    384                self._retreat(index)
    385
    386                return self.expression(
    387                    exp.CTE,
    388                    this=self._parse_field(),
    389                    alias=self._parse_table_alias(),
    390                    scalar=True,
    391                )
    392
    393        def _parse_join_parts(
    394            self,
    395        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    396            is_global = self._match(TokenType.GLOBAL) and self._prev
    397            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    398
    399            if kind_pre:
    400                kind = self._match_set(self.JOIN_KINDS) and self._prev
    401                side = self._match_set(self.JOIN_SIDES) and self._prev
    402                return is_global, side, kind
    403
    404            return (
    405                is_global,
    406                self._match_set(self.JOIN_SIDES) and self._prev,
    407                self._match_set(self.JOIN_KINDS) and self._prev,
    408            )
    409
    410        def _parse_join(
    411            self, skip_join_token: bool = False, parse_bracket: bool = False
    412        ) -> t.Optional[exp.Join]:
    413            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    414
    415            if join:
    416                join.set("global", join.args.pop("method", None))
    417            return join
    418
    419        def _parse_function(
    420            self,
    421            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    422            anonymous: bool = False,
    423            optional_parens: bool = True,
    424        ) -> t.Optional[exp.Expression]:
    425            func = super()._parse_function(
    426                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    427            )
    428
    429            if isinstance(func, exp.Anonymous):
    430                parts = self.AGG_FUNC_MAPPING.get(func.this)
    431                params = self._parse_func_params(func)
    432
    433                if params:
    434                    if parts and parts[1]:
    435                        return self.expression(
    436                            exp.CombinedParameterizedAgg,
    437                            this=func.this,
    438                            expressions=func.expressions,
    439                            params=params,
    440                            parts=parts,
    441                        )
    442                    return self.expression(
    443                        exp.ParameterizedAgg,
    444                        this=func.this,
    445                        expressions=func.expressions,
    446                        params=params,
    447                    )
    448
    449                if parts:
    450                    if parts[1]:
    451                        return self.expression(
    452                            exp.CombinedAggFunc,
    453                            this=func.this,
    454                            expressions=func.expressions,
    455                            parts=parts,
    456                        )
    457                    return self.expression(
    458                        exp.AnonymousAggFunc,
    459                        this=func.this,
    460                        expressions=func.expressions,
    461                    )
    462
    463            return func
    464
    465        def _parse_func_params(
    466            self, this: t.Optional[exp.Func] = None
    467        ) -> t.Optional[t.List[exp.Expression]]:
    468            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    469                return self._parse_csv(self._parse_lambda)
    470
    471            if self._match(TokenType.L_PAREN):
    472                params = self._parse_csv(self._parse_lambda)
    473                self._match_r_paren(this)
    474                return params
    475
    476            return None
    477
    478        def _parse_quantile(self) -> exp.Quantile:
    479            this = self._parse_lambda()
    480            params = self._parse_func_params()
    481            if params:
    482                return self.expression(exp.Quantile, this=params[0], quantile=this)
    483            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    484
    485        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    486            return super()._parse_wrapped_id_vars(optional=True)
    487
    488        def _parse_primary_key(
    489            self, wrapped_optional: bool = False, in_props: bool = False
    490        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    491            return super()._parse_primary_key(
    492                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    493            )
    494
    495        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    496            index = self._index
    497            if self._match_text_seq("CLUSTER"):
    498                this = self._parse_id_var()
    499                if this:
    500                    return self.expression(exp.OnCluster, this=this)
    501                else:
    502                    self._retreat(index)
    503            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_OVERLAPS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayOverlaps'>>, 'ARRAY_SIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySize'>>, 'ARRAY_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'>>, 'FIRST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FirstValue'>>, 'FLATTEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Flatten'>>, 'FLOOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Floor'>>, 'FROM_BASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase'>>, 'FROM_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase64'>>, 'GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, 'GREATEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Greatest'>>, 'GROUP_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GroupConcat'>>, 'HEX': <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': <function parse_extract_json_with_path.<locals>._parser>, 'JSON_EXTRACT_SCALAR': <function parse_extract_json_with_path.<locals>._parser>, 'JSON_FORMAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONFormat'>>, 'J_S_O_N_OBJECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObject'>>, 'J_S_O_N_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObjectAgg'>>, 'J_S_O_N_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONTable'>>, 'LAG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lag'>>, 'LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Last'>>, 'LAST_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastValue'>>, 'LEAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lead'>>, 'LEAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Least'>>, 'LEFT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Left'>>, 'LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEVENSHTEIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Levenshtein'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ln'>>, 'LOG': <function 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'>>, 'NTH_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NthValue'>>, 'NULLIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nullif'>>, 'NUMBER_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NumberToStr'>>, 'NVL2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nvl2'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, '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'>>, 'TIMESTAMPDIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, 'TIMESTAMP_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, 'TIMESTAMP_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMPFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMP_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampSub'>>, 'TIMESTAMP_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampTrunc'>>, 'TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToArray'>>, 'TO_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToBase64'>>, 'TO_CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToChar'>>, 'TO_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToDays'>>, '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>>, 'JSON_EXTRACT_PATH_TEXT': <function parse_extract_json_with_path.<locals>._parser>, '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 = {'sumKahan', 'uniq', 'sumWithOverflow', 'maxMap', 'varPop', 'last_value', 'quantilesInterpolatedWeighted', 'quantilesExact', 'quantileBFloat16', 'stochasticLogisticRegression', 'rankCorr', 'quantileTimingWeighted', 'simpleLinearRegression', 'quantilesGK', 'kolmogorovSmirnovTest', 'stddevPop', 'uniqExact', 'sparkBar', 'quantilesTDigestWeighted', 'kurtSamp', 'sumCount', 'cramersVBiasCorrected', 'quantileExactWeighted', 'quantileInterpolatedWeighted', 'kurtPop', 'quantileBFloat16Weighted', 'groupBitOr', 'boundingRatio', 'skewPop', 'maxIntersectionsPosition', 'quantilesExactHigh', 'topK', 'maxIntersections', 'quantileExactLow', 'groupArrayMovingAvg', 'corr', 'quantileDeterministic', 'exponentialMovingAverage', 'quantileExact', 'quantilesBFloat16', 'quantileGK', 'quantilesTimingWeighted', 'minMap', 'quantile', 'welchTTest', 'groupArraySample', 'groupBitXor', 'cramersV', 'topKWeighted', 'count', 'quantileExactHigh', 'argMin', 'stochasticLinearRegression', 'uniqTheta', 'intervalLengthSum', 'groupArrayMovingSum', 'mannWhitneyUTest', 'uniqCombined64', 'stddevSamp', 'skewSamp', 'quantilesTDigest', 'groupArray', 'groupBitmapAnd', 'min', 'quantiles', 'theilsU', 'anyLast', 'quantileTDigest', 'meanZTest', 'anyHeavy', 'sum', 'quantileTDigestWeighted', 'quantileTiming', 'covarPop', 'groupUniqArray', 'first_value', 'uniqHLL12', 'sumMap', 'quantilesTiming', 'any', 'contingency', 'largestTriangleThreeBuckets', 'groupBitmapXor', 'argMax', 'groupArrayLast', 'quantilesExactWeighted', 'quantilesExactLow', 'median', 'groupArrayInsertAt', 'varSamp', 'categoricalInformationValue', 'groupBitAnd', 'deltaSumTimestamp', 'covarSamp', 'quantilesBFloat16Weighted', 'studentTTest', 'avg', 'max', 'avgWeighted', 'groupBitmap', 'groupBitmapOr', 'entropy', 'uniqCombined', 'deltaSum', 'quantilesDeterministic'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
AGG_FUNC_MAPPING = {'sumKahanIf': ('sumKahan', 'If'), 'uniqIf': ('uniq', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'maxMapIf': ('maxMap', 'If'), 'varPopIf': ('varPop', 'If'), 'last_valueIf': ('last_value', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'sumCountIf': ('sumCount', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'skewPopIf': ('skewPop', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'topKIf': ('topK', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'corrIf': ('corr', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'minMapIf': ('minMap', 'If'), 'quantileIf': ('quantile', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'cramersVIf': ('cramersV', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'countIf': ('count', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'argMinIf': ('argMin', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'minIf': ('min', 'If'), 'quantilesIf': ('quantiles', 'If'), 'theilsUIf': ('theilsU', 'If'), 'anyLastIf': ('anyLast', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'sumIf': ('sum', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'covarPopIf': ('covarPop', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'first_valueIf': ('first_value', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'sumMapIf': ('sumMap', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'anyIf': ('any', 'If'), 'contingencyIf': ('contingency', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'argMaxIf': ('argMax', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'medianIf': ('median', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'varSampIf': ('varSamp', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'avgIf': ('avg', 'If'), 'maxIf': ('max', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'entropyIf': ('entropy', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'sumKahanArray': ('sumKahan', 'Array'), 'uniqArray': ('uniq', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'varPopArray': ('varPop', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'topKArray': ('topK', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'corrArray': ('corr', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'minMapArray': ('minMap', 'Array'), 'quantileArray': ('quantile', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'countArray': ('count', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'argMinArray': ('argMin', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'minArray': ('min', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'sumArray': ('sum', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'anyArray': ('any', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'medianArray': ('median', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'avgArray': ('avg', 'Array'), 'maxArray': ('max', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'entropyArray': ('entropy', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'sumKahanMap': ('sumKahan', 'Map'), 'uniqMap': ('uniq', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'varPopMap': ('varPop', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'topKMap': ('topK', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'corrMap': ('corr', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'minMapMap': ('minMap', 'Map'), 'quantileMap': ('quantile', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'countMap': ('count', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'argMinMap': ('argMin', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'minMap': ('minMap', ''), 'quantilesMap': ('quantiles', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'sumMap': ('sumMap', ''), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'anyMap': ('any', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'medianMap': ('median', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'avgMap': ('avg', 'Map'), 'maxMap': ('maxMap', ''), 'avgWeightedMap': ('avgWeighted', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'entropyMap': ('entropy', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'sumKahanState': ('sumKahan', 'State'), 'uniqState': ('uniq', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'maxMapState': ('maxMap', 'State'), 'varPopState': ('varPop', 'State'), 'last_valueState': ('last_value', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'sumCountState': ('sumCount', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'skewPopState': ('skewPop', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'topKState': ('topK', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'corrState': ('corr', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'minMapState': ('minMap', 'State'), 'quantileState': ('quantile', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'cramersVState': ('cramersV', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'countState': ('count', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'argMinState': ('argMin', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'skewSampState': ('skewSamp', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'groupArrayState': ('groupArray', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'minState': ('min', 'State'), 'quantilesState': ('quantiles', 'State'), 'theilsUState': ('theilsU', 'State'), 'anyLastState': ('anyLast', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'sumState': ('sum', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'covarPopState': ('covarPop', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'first_valueState': ('first_value', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'sumMapState': ('sumMap', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'anyState': ('any', 'State'), 'contingencyState': ('contingency', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'argMaxState': ('argMax', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'medianState': ('median', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'varSampState': ('varSamp', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'covarSampState': ('covarSamp', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'avgState': ('avg', 'State'), 'maxState': ('max', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'entropyState': ('entropy', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'countMerge': ('count', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'minMerge': ('min', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'anyMerge': ('any', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'medianMerge': ('median', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'maxMerge': ('max', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'sumKahanResample': ('sumKahan', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'topKResample': ('topK', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'corrResample': ('corr', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'countResample': ('count', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'minResample': ('min', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'sumResample': ('sum', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'anyResample': ('any', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'medianResample': ('median', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'avgResample': ('avg', 'Resample'), 'maxResample': ('max', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'sumKahan': ('sumKahan', ''), 'uniq': ('uniq', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'varPop': ('varPop', ''), 'last_value': ('last_value', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'quantilesExact': ('quantilesExact', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'rankCorr': ('rankCorr', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'quantilesGK': ('quantilesGK', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'stddevPop': ('stddevPop', ''), 'uniqExact': ('uniqExact', ''), 'sparkBar': ('sparkBar', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'kurtSamp': ('kurtSamp', ''), 'sumCount': ('sumCount', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'kurtPop': ('kurtPop', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'groupBitOr': ('groupBitOr', ''), 'boundingRatio': ('boundingRatio', ''), 'skewPop': ('skewPop', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'topK': ('topK', ''), 'maxIntersections': ('maxIntersections', ''), 'quantileExactLow': ('quantileExactLow', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'corr': ('corr', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'quantileExact': ('quantileExact', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'quantileGK': ('quantileGK', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'quantile': ('quantile', ''), 'welchTTest': ('welchTTest', ''), 'groupArraySample': ('groupArraySample', ''), 'groupBitXor': ('groupBitXor', ''), 'cramersV': ('cramersV', ''), 'topKWeighted': ('topKWeighted', ''), 'count': ('count', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'argMin': ('argMin', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'uniqTheta': ('uniqTheta', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'uniqCombined64': ('uniqCombined64', ''), 'stddevSamp': ('stddevSamp', ''), 'skewSamp': ('skewSamp', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'groupArray': ('groupArray', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'min': ('min', ''), 'quantiles': ('quantiles', ''), 'theilsU': ('theilsU', ''), 'anyLast': ('anyLast', ''), 'quantileTDigest': ('quantileTDigest', ''), 'meanZTest': ('meanZTest', ''), 'anyHeavy': ('anyHeavy', ''), 'sum': ('sum', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'quantileTiming': ('quantileTiming', ''), 'covarPop': ('covarPop', ''), 'groupUniqArray': ('groupUniqArray', ''), 'first_value': ('first_value', ''), 'uniqHLL12': ('uniqHLL12', ''), 'quantilesTiming': ('quantilesTiming', ''), 'any': ('any', ''), 'contingency': ('contingency', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'argMax': ('argMax', ''), 'groupArrayLast': ('groupArrayLast', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'median': ('median', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'varSamp': ('varSamp', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'groupBitAnd': ('groupBitAnd', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'covarSamp': ('covarSamp', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'studentTTest': ('studentTTest', ''), 'avg': ('avg', ''), 'max': ('max', ''), 'avgWeighted': ('avgWeighted', ''), 'groupBitmap': ('groupBitmap', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'entropy': ('entropy', ''), 'uniqCombined': ('uniqCombined', ''), 'deltaSum': ('deltaSum', ''), 'quantilesDeterministic': ('quantilesDeterministic', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'TUPLE', 'STRUCT'}
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.INNER: 'INNER'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.CROSS: 'CROSS'>, <TokenType.SEMI: 'SEMI'>, <TokenType.ASOF: 'ASOF'>, <TokenType.OUTER: 'OUTER'>, <TokenType.ANY: 'ANY'>, <TokenType.ANTI: 'ANTI'>}
TABLE_ALIAS_TOKENS = {<TokenType.NULL: 'NULL'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.XML: 'XML'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.END: 'END'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.IPV4: 'IPV4'>, <TokenType.ROWS: 'ROWS'>, <TokenType.INT128: 'INT128'>, <TokenType.SHOW: 'SHOW'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.FALSE: 'FALSE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.MAP: 'MAP'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.TABLE: 'TABLE'>, <TokenType.TEXT: 'TEXT'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.BINARY: 'BINARY'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.SET: 'SET'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.TIME: 'TIME'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.UINT256: 'UINT256'>, <TokenType.DATE32: 'DATE32'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.INET: 'INET'>, <TokenType.DESC: 'DESC'>, <TokenType.NESTED: 'NESTED'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.ALL: 'ALL'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.UUID: 'UUID'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.RANGE: 'RANGE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.IPV6: 'IPV6'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.KEEP: 'KEEP'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.DELETE: 'DELETE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.ROW: 'ROW'>, <TokenType.MONEY: 'MONEY'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.BIT: 'BIT'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.DATE: 'DATE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.VAR: 'VAR'>, <TokenType.SUPER: 'SUPER'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.INT256: 'INT256'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.SOME: 'SOME'>, <TokenType.UINT: 'UINT'>, <TokenType.UINT128: 'UINT128'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.CASE: 'CASE'>, <TokenType.IS: 'IS'>, <TokenType.INT: 'INT'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.MERGE: 'MERGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.JSON: 'JSON'>, <TokenType.JSONB: 'JSONB'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.INDEX: 'INDEX'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.USE: 'USE'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ASC: 'ASC'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.KILL: 'KILL'>, <TokenType.CACHE: 'CACHE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.VIEW: 'VIEW'>, <TokenType.FIRST: 'FIRST'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.DIV: 'DIV'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.ENUM: 'ENUM'>, <TokenType.TOP: 'TOP'>, <TokenType.CHAR: 'CHAR'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.FUNCTION: 'FUNCTION'>}
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
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  RESERVED_TOKENS
  DB_CREATABLES
  CREATABLES
  ID_VAR_TOKENS
  INTERVAL_VARS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  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
  NO_PAREN_IF_COMMANDS
  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

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

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

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

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

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

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

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

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

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

    648        def datatype_sql(self, expression: exp.DataType) -> str:
    649            # String is the standard ClickHouse type, every other variant is just an alias.
    650            # Additionally, any supplied length parameter will be ignored.
    651            #
    652            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    653            if expression.this in self.STRING_TYPE_MAPPING:
    654                return "String"
    655
    656            return super().datatype_sql(expression)

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

    658        def cte_sql(self, expression: exp.CTE) -> str:
    659            if expression.args.get("scalar"):
    660                this = self.sql(expression, "this")
    661                alias = self.sql(expression, "alias")
    662                return f"{this} AS {alias}"
    663
    664            return super().cte_sql(expression)

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

    666        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    667            return super().after_limit_modifiers(expression) + [
    668                (
    669                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    670                    if expression.args.get("settings")
    671                    else ""
    672                ),
    673                (
    674                    self.seg("FORMAT ") + self.sql(expression, "format")
    675                    if expression.args.get("format")
    676                    else ""
    677                ),
    678            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

    699        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    700            kind = self.sql(expression, "kind").upper()
    701            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    702                this_name = self.sql(expression.this, "this")
    703                this_properties = " ".join(
    704                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    705                )
    706                this_schema = self.schema_columns_sql(expression.this)
    707                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    708
    709            return super().createable_sql(expression, locations)

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

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  IGNORE_NULLS_IN_FUNC
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  COLUMN_JOIN_MARKS_SUPPORTED
  EXTRACT_ALLOWS_QUOTES
  TZ_TO_WITH_TIME_ZONE
  VALUES_AS_TABLE
  ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
  UNNEST_WITH_ORDINALITY
  AGGREGATE_FILTER_SUPPORTED
  SEMI_ANTI_JOIN_WITH_SIDE
  COMPUTED_COLUMN_WITH_TYPE
  SUPPORTS_TABLE_COPY
  TABLESAMPLE_WITH_METHOD
  TABLESAMPLE_SEED_KEYWORD
  COLLATE_IS_FUNC
  DATA_TYPE_SPECIFIERS_ALLOWED
  ENSURE_BOOLS
  CTE_RECURSIVE_KEYWORD_REQUIRED
  SUPPORTS_SINGLE_ARG_CONCAT
  SUPPORTS_TABLE_ALIAS_COLUMNS
  UNPIVOT_ALIASES_ARE_IDENTIFIERS
  JSON_KEY_VALUE_PAIR_SEP
  INSERT_OVERWRITE
  SUPPORTS_SELECT_INTO
  SUPPORTS_UNLOGGED_TABLES
  SUPPORTS_CREATE_TABLE_LIKE
  LIKE_PROPERTY_INSIDE_SCHEMA
  JSON_TYPE_REQUIRED_FOR_EXTRACTION
  JSON_PATH_BRACKETED_KEY_SUPPORTED
  JSON_PATH_SINGLE_QUOTE_ESCAPE
  SUPPORTED_JSON_PATH_PARTS
  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
  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
  jsonpath_sql
  json_path_part
  formatjson_sql
  jsonobject_sql
  jsonobjectagg_sql
  jsonarray_sql
  jsonarrayagg_sql
  jsoncolumndef_sql
  jsonschema_sql
  jsontable_sql
  openjsoncolumndef_sql
  openjson_sql
  in_sql
  in_unnest_op
  interval_sql
  return_sql
  reference_sql
  anonymous_sql
  paren_sql
  neg_sql
  not_sql
  alias_sql
  pivotalias_sql
  aliases_sql
  atindex_sql
  attimezone_sql
  fromtimezone_sql
  add_sql
  and_sql
  xor_sql
  connector_sql
  bitwiseand_sql
  bitwiseleftshift_sql
  bitwisenot_sql
  bitwiseor_sql
  bitwiserightshift_sql
  bitwisexor_sql
  cast_sql
  currentdate_sql
  currenttimestamp_sql
  collate_sql
  command_sql
  comment_sql
  mergetreettlaction_sql
  mergetreettl_sql
  transaction_sql
  commit_sql
  rollback_sql
  altercolumn_sql
  renametable_sql
  renamecolumn_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