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        ) -> t.Optional[exp.Expression]:
    358            this = super()._parse_table(
    359                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    360            )
    361
    362            if self._match(TokenType.FINAL):
    363                this = self.expression(exp.Final, this=this)
    364
    365            return this
    366
    367        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    368            return super()._parse_position(haystack_first=True)
    369
    370        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    371        def _parse_cte(self) -> exp.CTE:
    372            index = self._index
    373            try:
    374                # WITH <identifier> AS <subquery expression>
    375                return super()._parse_cte()
    376            except ParseError:
    377                # WITH <expression> AS <identifier>
    378                self._retreat(index)
    379
    380                return self.expression(
    381                    exp.CTE,
    382                    this=self._parse_field(),
    383                    alias=self._parse_table_alias(),
    384                    scalar=True,
    385                )
    386
    387        def _parse_join_parts(
    388            self,
    389        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    390            is_global = self._match(TokenType.GLOBAL) and self._prev
    391            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    392
    393            if kind_pre:
    394                kind = self._match_set(self.JOIN_KINDS) and self._prev
    395                side = self._match_set(self.JOIN_SIDES) and self._prev
    396                return is_global, side, kind
    397
    398            return (
    399                is_global,
    400                self._match_set(self.JOIN_SIDES) and self._prev,
    401                self._match_set(self.JOIN_KINDS) and self._prev,
    402            )
    403
    404        def _parse_join(
    405            self, skip_join_token: bool = False, parse_bracket: bool = False
    406        ) -> t.Optional[exp.Join]:
    407            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    408
    409            if join:
    410                join.set("global", join.args.pop("method", None))
    411            return join
    412
    413        def _parse_function(
    414            self,
    415            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    416            anonymous: bool = False,
    417            optional_parens: bool = True,
    418        ) -> t.Optional[exp.Expression]:
    419            func = super()._parse_function(
    420                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    421            )
    422
    423            if isinstance(func, exp.Anonymous):
    424                parts = self.AGG_FUNC_MAPPING.get(func.this)
    425                params = self._parse_func_params(func)
    426
    427                if params:
    428                    if parts and parts[1]:
    429                        return self.expression(
    430                            exp.CombinedParameterizedAgg,
    431                            this=func.this,
    432                            expressions=func.expressions,
    433                            params=params,
    434                            parts=parts,
    435                        )
    436                    return self.expression(
    437                        exp.ParameterizedAgg,
    438                        this=func.this,
    439                        expressions=func.expressions,
    440                        params=params,
    441                    )
    442
    443                if parts:
    444                    if parts[1]:
    445                        return self.expression(
    446                            exp.CombinedAggFunc,
    447                            this=func.this,
    448                            expressions=func.expressions,
    449                            parts=parts,
    450                        )
    451                    return self.expression(
    452                        exp.AnonymousAggFunc,
    453                        this=func.this,
    454                        expressions=func.expressions,
    455                    )
    456
    457            return func
    458
    459        def _parse_func_params(
    460            self, this: t.Optional[exp.Func] = None
    461        ) -> t.Optional[t.List[exp.Expression]]:
    462            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    463                return self._parse_csv(self._parse_lambda)
    464
    465            if self._match(TokenType.L_PAREN):
    466                params = self._parse_csv(self._parse_lambda)
    467                self._match_r_paren(this)
    468                return params
    469
    470            return None
    471
    472        def _parse_quantile(self) -> exp.Quantile:
    473            this = self._parse_lambda()
    474            params = self._parse_func_params()
    475            if params:
    476                return self.expression(exp.Quantile, this=params[0], quantile=this)
    477            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    478
    479        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    480            return super()._parse_wrapped_id_vars(optional=True)
    481
    482        def _parse_primary_key(
    483            self, wrapped_optional: bool = False, in_props: bool = False
    484        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    485            return super()._parse_primary_key(
    486                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    487            )
    488
    489        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    490            index = self._index
    491            if self._match_text_seq("CLUSTER"):
    492                this = self._parse_id_var()
    493                if this:
    494                    return self.expression(exp.OnCluster, this=this)
    495                else:
    496                    self._retreat(index)
    497            return None
    498
    499    class Generator(generator.Generator):
    500        QUERY_HINTS = False
    501        STRUCT_DELIMITER = ("(", ")")
    502        NVL2_SUPPORTED = False
    503        TABLESAMPLE_REQUIRES_PARENS = False
    504        TABLESAMPLE_SIZE_IS_ROWS = False
    505        TABLESAMPLE_KEYWORDS = "SAMPLE"
    506        LAST_DAY_SUPPORTS_DATE_PART = False
    507
    508        STRING_TYPE_MAPPING = {
    509            exp.DataType.Type.CHAR: "String",
    510            exp.DataType.Type.LONGBLOB: "String",
    511            exp.DataType.Type.LONGTEXT: "String",
    512            exp.DataType.Type.MEDIUMBLOB: "String",
    513            exp.DataType.Type.MEDIUMTEXT: "String",
    514            exp.DataType.Type.TINYBLOB: "String",
    515            exp.DataType.Type.TINYTEXT: "String",
    516            exp.DataType.Type.TEXT: "String",
    517            exp.DataType.Type.VARBINARY: "String",
    518            exp.DataType.Type.VARCHAR: "String",
    519        }
    520
    521        TYPE_MAPPING = {
    522            **generator.Generator.TYPE_MAPPING,
    523            **STRING_TYPE_MAPPING,
    524            exp.DataType.Type.ARRAY: "Array",
    525            exp.DataType.Type.BIGINT: "Int64",
    526            exp.DataType.Type.DATE32: "Date32",
    527            exp.DataType.Type.DATETIME64: "DateTime64",
    528            exp.DataType.Type.DOUBLE: "Float64",
    529            exp.DataType.Type.ENUM: "Enum",
    530            exp.DataType.Type.ENUM8: "Enum8",
    531            exp.DataType.Type.ENUM16: "Enum16",
    532            exp.DataType.Type.FIXEDSTRING: "FixedString",
    533            exp.DataType.Type.FLOAT: "Float32",
    534            exp.DataType.Type.INT: "Int32",
    535            exp.DataType.Type.MEDIUMINT: "Int32",
    536            exp.DataType.Type.INT128: "Int128",
    537            exp.DataType.Type.INT256: "Int256",
    538            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    539            exp.DataType.Type.MAP: "Map",
    540            exp.DataType.Type.NESTED: "Nested",
    541            exp.DataType.Type.NULLABLE: "Nullable",
    542            exp.DataType.Type.SMALLINT: "Int16",
    543            exp.DataType.Type.STRUCT: "Tuple",
    544            exp.DataType.Type.TINYINT: "Int8",
    545            exp.DataType.Type.UBIGINT: "UInt64",
    546            exp.DataType.Type.UINT: "UInt32",
    547            exp.DataType.Type.UINT128: "UInt128",
    548            exp.DataType.Type.UINT256: "UInt256",
    549            exp.DataType.Type.USMALLINT: "UInt16",
    550            exp.DataType.Type.UTINYINT: "UInt8",
    551            exp.DataType.Type.IPV4: "IPv4",
    552            exp.DataType.Type.IPV6: "IPv6",
    553            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    554            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    555        }
    556
    557        TRANSFORMS = {
    558            **generator.Generator.TRANSFORMS,
    559            exp.AnyValue: rename_func("any"),
    560            exp.ApproxDistinct: rename_func("uniq"),
    561            exp.ArraySum: rename_func("arraySum"),
    562            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    563            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    564            exp.Array: inline_array_sql,
    565            exp.CastToStrType: rename_func("CAST"),
    566            exp.CountIf: rename_func("countIf"),
    567            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    568            exp.DateAdd: date_delta_sql("DATE_ADD"),
    569            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    570            exp.Explode: rename_func("arrayJoin"),
    571            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    572            exp.IsNan: rename_func("isNaN"),
    573            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    574            exp.Nullif: rename_func("nullIf"),
    575            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    576            exp.Pivot: no_pivot_sql,
    577            exp.Quantile: _quantile_sql,
    578            exp.RegexpLike: lambda self, e: f"match({self.format_args(e.this, e.expression)})",
    579            exp.Rand: rename_func("randCanonical"),
    580            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    581            exp.StartsWith: rename_func("startsWith"),
    582            exp.StrPosition: lambda self, e: f"position({self.format_args(e.this, e.args.get('substr'), e.args.get('position'))})",
    583            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    584            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    585        }
    586
    587        PROPERTIES_LOCATION = {
    588            **generator.Generator.PROPERTIES_LOCATION,
    589            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    590            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    591            exp.OnCluster: exp.Properties.Location.POST_NAME,
    592        }
    593
    594        JOIN_HINTS = False
    595        TABLE_HINTS = False
    596        EXPLICIT_UNION = True
    597        GROUPINGS_SEP = ""
    598
    599        # there's no list in docs, but it can be found in Clickhouse code
    600        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    601        ON_CLUSTER_TARGETS = {
    602            "DATABASE",
    603            "TABLE",
    604            "VIEW",
    605            "DICTIONARY",
    606            "INDEX",
    607            "FUNCTION",
    608            "NAMED COLLECTION",
    609        }
    610
    611        def _any_to_has(
    612            self,
    613            expression: exp.EQ | exp.NEQ,
    614            default: t.Callable[[t.Any], str],
    615            prefix: str = "",
    616        ) -> str:
    617            if isinstance(expression.left, exp.Any):
    618                arr = expression.left
    619                this = expression.right
    620            elif isinstance(expression.right, exp.Any):
    621                arr = expression.right
    622                this = expression.left
    623            else:
    624                return default(expression)
    625            return prefix + self.func("has", arr.this.unnest(), this)
    626
    627        def eq_sql(self, expression: exp.EQ) -> str:
    628            return self._any_to_has(expression, super().eq_sql)
    629
    630        def neq_sql(self, expression: exp.NEQ) -> str:
    631            return self._any_to_has(expression, super().neq_sql, "NOT ")
    632
    633        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    634            # Manually add a flag to make the search case-insensitive
    635            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    636            return f"match({self.format_args(expression.this, regex)})"
    637
    638        def datatype_sql(self, expression: exp.DataType) -> str:
    639            # String is the standard ClickHouse type, every other variant is just an alias.
    640            # Additionally, any supplied length parameter will be ignored.
    641            #
    642            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    643            if expression.this in self.STRING_TYPE_MAPPING:
    644                return "String"
    645
    646            return super().datatype_sql(expression)
    647
    648        def cte_sql(self, expression: exp.CTE) -> str:
    649            if expression.args.get("scalar"):
    650                this = self.sql(expression, "this")
    651                alias = self.sql(expression, "alias")
    652                return f"{this} AS {alias}"
    653
    654            return super().cte_sql(expression)
    655
    656        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    657            return super().after_limit_modifiers(expression) + [
    658                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    659                if expression.args.get("settings")
    660                else "",
    661                self.seg("FORMAT ") + self.sql(expression, "format")
    662                if expression.args.get("format")
    663                else "",
    664            ]
    665
    666        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    667            params = self.expressions(expression, key="params", flat=True)
    668            return self.func(expression.name, *expression.expressions) + f"({params})"
    669
    670        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    671            return self.func(expression.name, *expression.expressions)
    672
    673        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    674            return self.anonymousaggfunc_sql(expression)
    675
    676        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    677            return self.parameterizedagg_sql(expression)
    678
    679        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    680            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    681
    682        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    683            return f"ON CLUSTER {self.sql(expression, 'this')}"
    684
    685        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    686            kind = self.sql(expression, "kind").upper()
    687            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    688                this_name = self.sql(expression.this, "this")
    689                this_properties = " ".join(
    690                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    691                )
    692                this_schema = self.schema_columns_sql(expression.this)
    693                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    694
    695            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        ) -> t.Optional[exp.Expression]:
    359            this = super()._parse_table(
    360                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    361            )
    362
    363            if self._match(TokenType.FINAL):
    364                this = self.expression(exp.Final, this=this)
    365
    366            return this
    367
    368        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    369            return super()._parse_position(haystack_first=True)
    370
    371        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    372        def _parse_cte(self) -> exp.CTE:
    373            index = self._index
    374            try:
    375                # WITH <identifier> AS <subquery expression>
    376                return super()._parse_cte()
    377            except ParseError:
    378                # WITH <expression> AS <identifier>
    379                self._retreat(index)
    380
    381                return self.expression(
    382                    exp.CTE,
    383                    this=self._parse_field(),
    384                    alias=self._parse_table_alias(),
    385                    scalar=True,
    386                )
    387
    388        def _parse_join_parts(
    389            self,
    390        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    391            is_global = self._match(TokenType.GLOBAL) and self._prev
    392            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    393
    394            if kind_pre:
    395                kind = self._match_set(self.JOIN_KINDS) and self._prev
    396                side = self._match_set(self.JOIN_SIDES) and self._prev
    397                return is_global, side, kind
    398
    399            return (
    400                is_global,
    401                self._match_set(self.JOIN_SIDES) and self._prev,
    402                self._match_set(self.JOIN_KINDS) and self._prev,
    403            )
    404
    405        def _parse_join(
    406            self, skip_join_token: bool = False, parse_bracket: bool = False
    407        ) -> t.Optional[exp.Join]:
    408            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    409
    410            if join:
    411                join.set("global", join.args.pop("method", None))
    412            return join
    413
    414        def _parse_function(
    415            self,
    416            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    417            anonymous: bool = False,
    418            optional_parens: bool = True,
    419        ) -> t.Optional[exp.Expression]:
    420            func = super()._parse_function(
    421                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    422            )
    423
    424            if isinstance(func, exp.Anonymous):
    425                parts = self.AGG_FUNC_MAPPING.get(func.this)
    426                params = self._parse_func_params(func)
    427
    428                if params:
    429                    if parts and parts[1]:
    430                        return self.expression(
    431                            exp.CombinedParameterizedAgg,
    432                            this=func.this,
    433                            expressions=func.expressions,
    434                            params=params,
    435                            parts=parts,
    436                        )
    437                    return self.expression(
    438                        exp.ParameterizedAgg,
    439                        this=func.this,
    440                        expressions=func.expressions,
    441                        params=params,
    442                    )
    443
    444                if parts:
    445                    if parts[1]:
    446                        return self.expression(
    447                            exp.CombinedAggFunc,
    448                            this=func.this,
    449                            expressions=func.expressions,
    450                            parts=parts,
    451                        )
    452                    return self.expression(
    453                        exp.AnonymousAggFunc,
    454                        this=func.this,
    455                        expressions=func.expressions,
    456                    )
    457
    458            return func
    459
    460        def _parse_func_params(
    461            self, this: t.Optional[exp.Func] = None
    462        ) -> t.Optional[t.List[exp.Expression]]:
    463            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    464                return self._parse_csv(self._parse_lambda)
    465
    466            if self._match(TokenType.L_PAREN):
    467                params = self._parse_csv(self._parse_lambda)
    468                self._match_r_paren(this)
    469                return params
    470
    471            return None
    472
    473        def _parse_quantile(self) -> exp.Quantile:
    474            this = self._parse_lambda()
    475            params = self._parse_func_params()
    476            if params:
    477                return self.expression(exp.Quantile, this=params[0], quantile=this)
    478            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    479
    480        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    481            return super()._parse_wrapped_id_vars(optional=True)
    482
    483        def _parse_primary_key(
    484            self, wrapped_optional: bool = False, in_props: bool = False
    485        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    486            return super()._parse_primary_key(
    487                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    488            )
    489
    490        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    491            index = self._index
    492            if self._match_text_seq("CLUSTER"):
    493                this = self._parse_id_var()
    494                if this:
    495                    return self.expression(exp.OnCluster, this=this)
    496                else:
    497                    self._retreat(index)
    498            return None
    499
    500    class Generator(generator.Generator):
    501        QUERY_HINTS = False
    502        STRUCT_DELIMITER = ("(", ")")
    503        NVL2_SUPPORTED = False
    504        TABLESAMPLE_REQUIRES_PARENS = False
    505        TABLESAMPLE_SIZE_IS_ROWS = False
    506        TABLESAMPLE_KEYWORDS = "SAMPLE"
    507        LAST_DAY_SUPPORTS_DATE_PART = False
    508
    509        STRING_TYPE_MAPPING = {
    510            exp.DataType.Type.CHAR: "String",
    511            exp.DataType.Type.LONGBLOB: "String",
    512            exp.DataType.Type.LONGTEXT: "String",
    513            exp.DataType.Type.MEDIUMBLOB: "String",
    514            exp.DataType.Type.MEDIUMTEXT: "String",
    515            exp.DataType.Type.TINYBLOB: "String",
    516            exp.DataType.Type.TINYTEXT: "String",
    517            exp.DataType.Type.TEXT: "String",
    518            exp.DataType.Type.VARBINARY: "String",
    519            exp.DataType.Type.VARCHAR: "String",
    520        }
    521
    522        TYPE_MAPPING = {
    523            **generator.Generator.TYPE_MAPPING,
    524            **STRING_TYPE_MAPPING,
    525            exp.DataType.Type.ARRAY: "Array",
    526            exp.DataType.Type.BIGINT: "Int64",
    527            exp.DataType.Type.DATE32: "Date32",
    528            exp.DataType.Type.DATETIME64: "DateTime64",
    529            exp.DataType.Type.DOUBLE: "Float64",
    530            exp.DataType.Type.ENUM: "Enum",
    531            exp.DataType.Type.ENUM8: "Enum8",
    532            exp.DataType.Type.ENUM16: "Enum16",
    533            exp.DataType.Type.FIXEDSTRING: "FixedString",
    534            exp.DataType.Type.FLOAT: "Float32",
    535            exp.DataType.Type.INT: "Int32",
    536            exp.DataType.Type.MEDIUMINT: "Int32",
    537            exp.DataType.Type.INT128: "Int128",
    538            exp.DataType.Type.INT256: "Int256",
    539            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    540            exp.DataType.Type.MAP: "Map",
    541            exp.DataType.Type.NESTED: "Nested",
    542            exp.DataType.Type.NULLABLE: "Nullable",
    543            exp.DataType.Type.SMALLINT: "Int16",
    544            exp.DataType.Type.STRUCT: "Tuple",
    545            exp.DataType.Type.TINYINT: "Int8",
    546            exp.DataType.Type.UBIGINT: "UInt64",
    547            exp.DataType.Type.UINT: "UInt32",
    548            exp.DataType.Type.UINT128: "UInt128",
    549            exp.DataType.Type.UINT256: "UInt256",
    550            exp.DataType.Type.USMALLINT: "UInt16",
    551            exp.DataType.Type.UTINYINT: "UInt8",
    552            exp.DataType.Type.IPV4: "IPv4",
    553            exp.DataType.Type.IPV6: "IPv6",
    554            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    555            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    556        }
    557
    558        TRANSFORMS = {
    559            **generator.Generator.TRANSFORMS,
    560            exp.AnyValue: rename_func("any"),
    561            exp.ApproxDistinct: rename_func("uniq"),
    562            exp.ArraySum: rename_func("arraySum"),
    563            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    564            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    565            exp.Array: inline_array_sql,
    566            exp.CastToStrType: rename_func("CAST"),
    567            exp.CountIf: rename_func("countIf"),
    568            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    569            exp.DateAdd: date_delta_sql("DATE_ADD"),
    570            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    571            exp.Explode: rename_func("arrayJoin"),
    572            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    573            exp.IsNan: rename_func("isNaN"),
    574            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    575            exp.Nullif: rename_func("nullIf"),
    576            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    577            exp.Pivot: no_pivot_sql,
    578            exp.Quantile: _quantile_sql,
    579            exp.RegexpLike: lambda self, e: f"match({self.format_args(e.this, e.expression)})",
    580            exp.Rand: rename_func("randCanonical"),
    581            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    582            exp.StartsWith: rename_func("startsWith"),
    583            exp.StrPosition: lambda self, e: f"position({self.format_args(e.this, e.args.get('substr'), e.args.get('position'))})",
    584            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    585            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    586        }
    587
    588        PROPERTIES_LOCATION = {
    589            **generator.Generator.PROPERTIES_LOCATION,
    590            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    591            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    592            exp.OnCluster: exp.Properties.Location.POST_NAME,
    593        }
    594
    595        JOIN_HINTS = False
    596        TABLE_HINTS = False
    597        EXPLICIT_UNION = True
    598        GROUPINGS_SEP = ""
    599
    600        # there's no list in docs, but it can be found in Clickhouse code
    601        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    602        ON_CLUSTER_TARGETS = {
    603            "DATABASE",
    604            "TABLE",
    605            "VIEW",
    606            "DICTIONARY",
    607            "INDEX",
    608            "FUNCTION",
    609            "NAMED COLLECTION",
    610        }
    611
    612        def _any_to_has(
    613            self,
    614            expression: exp.EQ | exp.NEQ,
    615            default: t.Callable[[t.Any], str],
    616            prefix: str = "",
    617        ) -> str:
    618            if isinstance(expression.left, exp.Any):
    619                arr = expression.left
    620                this = expression.right
    621            elif isinstance(expression.right, exp.Any):
    622                arr = expression.right
    623                this = expression.left
    624            else:
    625                return default(expression)
    626            return prefix + self.func("has", arr.this.unnest(), this)
    627
    628        def eq_sql(self, expression: exp.EQ) -> str:
    629            return self._any_to_has(expression, super().eq_sql)
    630
    631        def neq_sql(self, expression: exp.NEQ) -> str:
    632            return self._any_to_has(expression, super().neq_sql, "NOT ")
    633
    634        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    635            # Manually add a flag to make the search case-insensitive
    636            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    637            return f"match({self.format_args(expression.this, regex)})"
    638
    639        def datatype_sql(self, expression: exp.DataType) -> str:
    640            # String is the standard ClickHouse type, every other variant is just an alias.
    641            # Additionally, any supplied length parameter will be ignored.
    642            #
    643            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    644            if expression.this in self.STRING_TYPE_MAPPING:
    645                return "String"
    646
    647            return super().datatype_sql(expression)
    648
    649        def cte_sql(self, expression: exp.CTE) -> str:
    650            if expression.args.get("scalar"):
    651                this = self.sql(expression, "this")
    652                alias = self.sql(expression, "alias")
    653                return f"{this} AS {alias}"
    654
    655            return super().cte_sql(expression)
    656
    657        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    658            return super().after_limit_modifiers(expression) + [
    659                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    660                if expression.args.get("settings")
    661                else "",
    662                self.seg("FORMAT ") + self.sql(expression, "format")
    663                if expression.args.get("format")
    664                else "",
    665            ]
    666
    667        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    668            params = self.expressions(expression, key="params", flat=True)
    669            return self.func(expression.name, *expression.expressions) + f"({params})"
    670
    671        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    672            return self.func(expression.name, *expression.expressions)
    673
    674        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    675            return self.anonymousaggfunc_sql(expression)
    676
    677        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    678            return self.parameterizedagg_sql(expression)
    679
    680        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    681            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    682
    683        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    684            return f"ON CLUSTER {self.sql(expression, 'this')}"
    685
    686        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    687            kind = self.sql(expression, "kind").upper()
    688            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
    689                this_name = self.sql(expression.this, "this")
    690                this_properties = " ".join(
    691                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    692                )
    693                this_schema = self.schema_columns_sql(expression.this)
    694                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    695
    696            return super().createable_sql(expression, locations)

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

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

SAFE_DIVISION = True

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

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

Mapping of an unescaped escape sequence to the corresponding character.

tokenizer_class = <class 'ClickHouse.Tokenizer'>
parser_class = <class 'ClickHouse.Parser'>
generator_class = <class 'ClickHouse.Generator'>
TIME_TRIE: Dict = {}
FORMAT_TRIE: Dict = {}
INVERSE_TIME_MAPPING: Dict[str, str] = {}
INVERSE_TIME_TRIE: Dict = {}
INVERSE_ESCAPE_SEQUENCES: Dict[str, str] = {'\x00': '\\0'}
QUOTE_START = "'"
QUOTE_END = "'"
IDENTIFIER_START = '"'
IDENTIFIER_END = '"'
BIT_START: Optional[str] = '0b'
BIT_END: Optional[str] = ''
HEX_START: Optional[str] = '0x'
HEX_END: Optional[str] = ''
BYTE_START: Optional[str] = None
BYTE_END: Optional[str] = None
UNICODE_START: Optional[str] = None
UNICODE_END: Optional[str] = None

##### Inherited Members

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

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

    56    class Tokenizer(tokens.Tokenizer):
    57        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
    58        IDENTIFIERS = ['"', "`"]
    59        STRING_ESCAPES = ["'", "\\"]
    60        BIT_STRINGS = [("0b", "")]
    61        HEX_STRINGS = [("0x", ""), ("0X", "")]
    62        HEREDOC_STRINGS = ["$"]
    63
    64        KEYWORDS = {
    65            **tokens.Tokenizer.KEYWORDS,
    66            "ATTACH": TokenType.COMMAND,
    67            "DATE32": TokenType.DATE32,
    68            "DATETIME64": TokenType.DATETIME64,
    69            "DICTIONARY": TokenType.DICTIONARY,
    70            "ENUM": TokenType.ENUM,
    71            "ENUM8": TokenType.ENUM8,
    72            "ENUM16": TokenType.ENUM16,
    73            "FINAL": TokenType.FINAL,
    74            "FIXEDSTRING": TokenType.FIXEDSTRING,
    75            "FLOAT32": TokenType.FLOAT,
    76            "FLOAT64": TokenType.DOUBLE,
    77            "GLOBAL": TokenType.GLOBAL,
    78            "INT256": TokenType.INT256,
    79            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
    80            "MAP": TokenType.MAP,
    81            "NESTED": TokenType.NESTED,
    82            "SAMPLE": TokenType.TABLE_SAMPLE,
    83            "TUPLE": TokenType.STRUCT,
    84            "UINT128": TokenType.UINT128,
    85            "UINT16": TokenType.USMALLINT,
    86            "UINT256": TokenType.UINT256,
    87            "UINT32": TokenType.UINT,
    88            "UINT64": TokenType.UBIGINT,
    89            "UINT8": TokenType.UTINYINT,
    90            "IPV4": TokenType.IPV4,
    91            "IPV6": TokenType.IPV6,
    92            "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'>, '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        ) -> t.Optional[exp.Expression]:
    359            this = super()._parse_table(
    360                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
    361            )
    362
    363            if self._match(TokenType.FINAL):
    364                this = self.expression(exp.Final, this=this)
    365
    366            return this
    367
    368        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
    369            return super()._parse_position(haystack_first=True)
    370
    371        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
    372        def _parse_cte(self) -> exp.CTE:
    373            index = self._index
    374            try:
    375                # WITH <identifier> AS <subquery expression>
    376                return super()._parse_cte()
    377            except ParseError:
    378                # WITH <expression> AS <identifier>
    379                self._retreat(index)
    380
    381                return self.expression(
    382                    exp.CTE,
    383                    this=self._parse_field(),
    384                    alias=self._parse_table_alias(),
    385                    scalar=True,
    386                )
    387
    388        def _parse_join_parts(
    389            self,
    390        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
    391            is_global = self._match(TokenType.GLOBAL) and self._prev
    392            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
    393
    394            if kind_pre:
    395                kind = self._match_set(self.JOIN_KINDS) and self._prev
    396                side = self._match_set(self.JOIN_SIDES) and self._prev
    397                return is_global, side, kind
    398
    399            return (
    400                is_global,
    401                self._match_set(self.JOIN_SIDES) and self._prev,
    402                self._match_set(self.JOIN_KINDS) and self._prev,
    403            )
    404
    405        def _parse_join(
    406            self, skip_join_token: bool = False, parse_bracket: bool = False
    407        ) -> t.Optional[exp.Join]:
    408            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
    409
    410            if join:
    411                join.set("global", join.args.pop("method", None))
    412            return join
    413
    414        def _parse_function(
    415            self,
    416            functions: t.Optional[t.Dict[str, t.Callable]] = None,
    417            anonymous: bool = False,
    418            optional_parens: bool = True,
    419        ) -> t.Optional[exp.Expression]:
    420            func = super()._parse_function(
    421                functions=functions, anonymous=anonymous, optional_parens=optional_parens
    422            )
    423
    424            if isinstance(func, exp.Anonymous):
    425                parts = self.AGG_FUNC_MAPPING.get(func.this)
    426                params = self._parse_func_params(func)
    427
    428                if params:
    429                    if parts and parts[1]:
    430                        return self.expression(
    431                            exp.CombinedParameterizedAgg,
    432                            this=func.this,
    433                            expressions=func.expressions,
    434                            params=params,
    435                            parts=parts,
    436                        )
    437                    return self.expression(
    438                        exp.ParameterizedAgg,
    439                        this=func.this,
    440                        expressions=func.expressions,
    441                        params=params,
    442                    )
    443
    444                if parts:
    445                    if parts[1]:
    446                        return self.expression(
    447                            exp.CombinedAggFunc,
    448                            this=func.this,
    449                            expressions=func.expressions,
    450                            parts=parts,
    451                        )
    452                    return self.expression(
    453                        exp.AnonymousAggFunc,
    454                        this=func.this,
    455                        expressions=func.expressions,
    456                    )
    457
    458            return func
    459
    460        def _parse_func_params(
    461            self, this: t.Optional[exp.Func] = None
    462        ) -> t.Optional[t.List[exp.Expression]]:
    463            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
    464                return self._parse_csv(self._parse_lambda)
    465
    466            if self._match(TokenType.L_PAREN):
    467                params = self._parse_csv(self._parse_lambda)
    468                self._match_r_paren(this)
    469                return params
    470
    471            return None
    472
    473        def _parse_quantile(self) -> exp.Quantile:
    474            this = self._parse_lambda()
    475            params = self._parse_func_params()
    476            if params:
    477                return self.expression(exp.Quantile, this=params[0], quantile=this)
    478            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
    479
    480        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
    481            return super()._parse_wrapped_id_vars(optional=True)
    482
    483        def _parse_primary_key(
    484            self, wrapped_optional: bool = False, in_props: bool = False
    485        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
    486            return super()._parse_primary_key(
    487                wrapped_optional=wrapped_optional or in_props, in_props=in_props
    488            )
    489
    490        def _parse_on_property(self) -> t.Optional[exp.Expression]:
    491            index = self._index
    492            if self._match_text_seq("CLUSTER"):
    493                this = self._parse_id_var()
    494                if this:
    495                    return self.expression(exp.OnCluster, this=this)
    496                else:
    497                    self._retreat(index)
    498            return None

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

###### Arguments:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

##### Inherited Members

sqlglot.generator.Generator
  Generator
  NULL_ORDERING_SUPPORTED
  LOCKING_READS_SUPPORTED
  WRAP_DERIVED_VALUES
  CREATE_FUNCTION_RETURN_AS
  MATCHED_BY_SOURCE
  SINGLE_STRING_INTERVAL
  INTERVAL_ALLOWS_PLURAL_FORM
  LIMIT_FETCH
  LIMIT_ONLY_LITERALS
  RENAME_TABLE_WITH_DB
  INDEX_ON
  QUERY_HINT_SEP
  IS_BOOL_ALLOWED
  DUPLICATE_KEY_UPDATE_WITH_SET
  LIMIT_IS_TOP
  RETURNING_END
  COLUMN_JOIN_MARKS_SUPPORTED
  EXTRACT_ALLOWS_QUOTES
  TZ_TO_WITH_TIME_ZONE
  VALUES_AS_TABLE
  ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
  UNNEST_WITH_ORDINALITY
  AGGREGATE_FILTER_SUPPORTED
  SEMI_ANTI_JOIN_WITH_SIDE
  COMPUTED_COLUMN_WITH_TYPE
  SUPPORTS_TABLE_COPY
  TABLESAMPLE_WITH_METHOD
  TABLESAMPLE_SEED_KEYWORD
  COLLATE_IS_FUNC
  DATA_TYPE_SPECIFIERS_ALLOWED
  ENSURE_BOOLS
  CTE_RECURSIVE_KEYWORD_REQUIRED
  SUPPORTS_SINGLE_ARG_CONCAT
  SUPPORTS_TABLE_ALIAS_COLUMNS
  UNPIVOT_ALIASES_ARE_IDENTIFIERS
  JSON_KEY_VALUE_PAIR_SEP
  INSERT_OVERWRITE
  SUPPORTS_SELECT_INTO
  SUPPORTS_UNLOGGED_TABLES
  STAR_MAPPING
  TIME_PART_SINGULARS
  TOKEN_MAPPING
  PARAMETER_TOKEN
  RESERVED_KEYWORDS
  WITH_SEPARATED_COMMENTS
  EXCLUDE_COMMENTS
  UNWRAPPED_INTERVAL_VALUES
  EXPRESSIONS_WITHOUT_NESTED_CTES
  KEY_VALUE_DEFINITIONS
  SENTINEL_LINE_BREAK
  pretty
  identify
  normalize
  pad
  unsupported_level
  max_unsupported
  leading_comma
  max_text_width
  comments
  dialect
  normalize_functions
  unsupported_messages
  generate
  preprocess
  unsupported
  sep
  seg
  pad_comment
  maybe_comment
  wrap
  no_identify
  normalize_func
  indent
  sql
  uncache_sql
  cache_sql
  characterset_sql
  column_sql
  columnposition_sql
  columndef_sql
  columnconstraint_sql
  computedcolumnconstraint_sql
  autoincrementcolumnconstraint_sql
  compresscolumnconstraint_sql
  generatedasidentitycolumnconstraint_sql
  generatedasrowcolumnconstraint_sql
  periodforsystemtimeconstraint_sql
  notnullcolumnconstraint_sql
  transformcolumnconstraint_sql
  primarykeycolumnconstraint_sql
  uniquecolumnconstraint_sql
  create_sql
  clone_sql
  describe_sql
  heredoc_sql
  prepend_ctes
  with_sql
  tablealias_sql
  bitstring_sql
  hexstring_sql
  bytestring_sql
  unicodestring_sql
  rawstring_sql
  datatypeparam_sql
  directory_sql
  delete_sql
  drop_sql
  except_sql
  except_op
  fetch_sql
  filter_sql
  hint_sql
  index_sql
  identifier_sql
  inputoutputformat_sql
  national_sql
  partition_sql
  properties_sql
  root_properties
  properties
  with_properties
  locate_properties
  property_name
  property_sql
  likeproperty_sql
  fallbackproperty_sql
  journalproperty_sql
  freespaceproperty_sql
  checksumproperty_sql
  mergeblockratioproperty_sql
  datablocksizeproperty_sql
  blockcompressionproperty_sql
  isolatedloadingproperty_sql
  partitionboundspec_sql
  partitionedofproperty_sql
  lockingproperty_sql
  withdataproperty_sql
  withsystemversioningproperty_sql
  insert_sql
  intersect_sql
  intersect_op
  introducer_sql
  kill_sql
  pseudotype_sql
  objectidentifier_sql
  onconflict_sql
  returning_sql
  rowformatdelimitedproperty_sql
  withtablehint_sql
  indextablehint_sql
  historicaldata_sql
  table_sql
  tablesample_sql
  pivot_sql
  version_sql
  tuple_sql
  update_sql
  values_sql
  var_sql
  into_sql
  from_sql
  group_sql
  having_sql
  connect_sql
  prior_sql
  join_sql
  lambda_sql
  lateral_op
  lateral_sql
  limit_sql
  offset_sql
  setitem_sql
  set_sql
  pragma_sql
  lock_sql
  literal_sql
  escape_str
  loaddata_sql
  null_sql
  boolean_sql
  order_sql
  withfill_sql
  cluster_sql
  distribute_sql
  sort_sql
  ordered_sql
  matchrecognize_sql
  query_modifiers
  offset_limit_modifiers
  after_having_modifiers
  select_sql
  schema_sql
  schema_columns_sql
  star_sql
  parameter_sql
  sessionparameter_sql
  subquery_sql
  qualify_sql
  union_sql
  union_op
  unnest_sql
  where_sql
  window_sql
  partition_by_sql
  windowspec_sql
  withingroup_sql
  between_sql
  bracket_sql
  all_sql
  any_sql
  exists_sql
  case_sql
  constraint_sql
  nextvaluefor_sql
  extract_sql
  trim_sql
  convert_concat_args
  concat_sql
  concatws_sql
  check_sql
  foreignkey_sql
  primarykey_sql
  if_sql
  matchagainst_sql
  jsonkeyvalue_sql
  formatjson_sql
  jsonobject_sql
  jsonobjectagg_sql
  jsonarray_sql
  jsonarrayagg_sql
  jsoncolumndef_sql
  jsonschema_sql
  jsontable_sql
  openjsoncolumndef_sql
  openjson_sql
  in_sql
  in_unnest_op
  interval_sql
  return_sql
  reference_sql
  anonymous_sql
  paren_sql
  neg_sql
  not_sql
  alias_sql
  pivotalias_sql
  aliases_sql
  atindex_sql
  attimezone_sql
  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
  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