Edit on GitHub

# sqlglot.dialects.clickhouse

View Source

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

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

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

NORMALIZE_FUNCTIONS: bool | str = False

Determines how function names are going to be normalized.

###### Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

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

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

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

##### Inherited Members

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

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

     69    class Tokenizer(tokens.Tokenizer):
     70        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
     71        IDENTIFIERS = ['"', "`"]
     72        STRING_ESCAPES = ["'", "\\"]
     73        BIT_STRINGS = [("0b", "")]
     74        HEX_STRINGS = [("0x", ""), ("0X", "")]
     75        HEREDOC_STRINGS = ["$"]
     76
     77        KEYWORDS = {
     78            **tokens.Tokenizer.KEYWORDS,
     79            "ATTACH": TokenType.COMMAND,
     80            "DATE32": TokenType.DATE32,
     81            "DATETIME64": TokenType.DATETIME64,
     82            "DICTIONARY": TokenType.DICTIONARY,
     83            "ENUM8": TokenType.ENUM8,
     84            "ENUM16": TokenType.ENUM16,
     85            "FINAL": TokenType.FINAL,
     86            "FIXEDSTRING": TokenType.FIXEDSTRING,
     87            "FLOAT32": TokenType.FLOAT,
     88            "FLOAT64": TokenType.DOUBLE,
     89            "GLOBAL": TokenType.GLOBAL,
     90            "INT256": TokenType.INT256,
     91            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
     92            "MAP": TokenType.MAP,
     93            "NESTED": TokenType.NESTED,
     94            "SAMPLE": TokenType.TABLE_SAMPLE,
     95            "TUPLE": TokenType.STRUCT,
     96            "UINT128": TokenType.UINT128,
     97            "UINT16": TokenType.USMALLINT,
     98            "UINT256": TokenType.UINT256,
     99            "UINT32": TokenType.UINT,
    100            "UINT64": TokenType.UBIGINT,
    101            "UINT8": TokenType.UTINYINT,
    102            "IPV4": TokenType.IPV4,
    103            "IPV6": TokenType.IPV6,
    104            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
    105            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
    106            "SYSTEM": TokenType.COMMAND,
    107            "PREWHERE": TokenType.PREWHERE,
    108        }
    109
    110        SINGLE_TOKENS = {
    111            **tokens.Tokenizer.SINGLE_TOKENS,
    112            "$": TokenType.HEREDOC_STRING,
    113        }

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'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'TRUNCATE': <TokenType.TRUNCATE: 'TRUNCATE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'UINT': <TokenType.UINT: 'UINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'BPCHAR': <TokenType.BPCHAR: 'BPCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATE32': <TokenType.DATE32: 'DATE32'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>, 'IPV4': <TokenType.IPV4: 'IPV4'>, 'IPV6': <TokenType.IPV6: 'IPV6'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, 'SYSTEM': <TokenType.COMMAND: 'COMMAND'>, 'PREWHERE': <TokenType.PREWHERE: 'PREWHERE'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, "'": <TokenType.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
  HEREDOC_TAG_IS_IDENTIFIER
  HEREDOC_STRING_ALTERNATIVE
  WHITE_SPACE
  COMMANDS
  COMMAND_PREFIX_TOKENS
  NUMERIC_LITERALS
  dialect
  reset
  tokenize
  tokenize_rs
  size
  sql
  tokens

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

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

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

###### Arguments:

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

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

##### Inherited Members

sqlglot.parser.Parser
  Parser
  NO_PAREN_FUNCTIONS
  STRUCT_TYPE_TOKENS
  NESTED_TYPE_TOKENS
  ENUM_TYPE_TOKENS
  AGGREGATE_TYPE_TOKENS
  TYPE_TOKENS
  SIGNED_TO_UNSIGNED_TYPE_TOKEN
  SUBQUERY_PREDICATES
  RESERVED_TOKENS
  DB_CREATABLES
  CREATABLES
  ID_VAR_TOKENS
  INTERVAL_VARS
  COMMENT_TABLE_ALIAS_TOKENS
  UPDATE_ALIAS_TOKENS
  TRIM_TYPES
  CONJUNCTION
  EQUALITY
  COMPARISON
  BITWISE
  TERM
  FACTOR
  EXPONENT
  TIMES
  TIMESTAMPS
  SET_OPERATIONS
  JOIN_METHODS
  JOIN_SIDES
  JOIN_HINTS
  LAMBDAS
  EXPRESSION_PARSERS
  STATEMENT_PARSERS
  UNARY_PARSERS
  STRING_PARSERS
  NUMERIC_PARSERS
  PRIMARY_PARSERS
  PLACEHOLDER_PARSERS
  PROPERTY_PARSERS
  ALTER_PARSERS
  INVALID_FUNC_NAME_TOKENS
  KEY_VALUE_DEFINITIONS
  SET_PARSERS
  SHOW_PARSERS
  TYPE_LITERAL_PARSERS
  DDL_SELECT_TOKENS
  PRE_VOLATILE_TOKENS
  TRANSACTION_KIND
  TRANSACTION_CHARACTERISTICS
  CONFLICT_ACTIONS
  CREATE_SEQUENCE
  ISOLATED_LOADING_OPTIONS
  USABLES
  CAST_ACTIONS
  INSERT_ALTERNATIVES
  CLONE_KEYWORDS
  HISTORICAL_DATA_KIND
  OPCLASS_FOLLOW_KEYWORDS
  OPTYPE_FOLLOW_TOKENS
  TABLE_INDEX_HINT_TOKENS
  VIEW_ATTRIBUTES
  WINDOW_ALIAS_TOKENS
  WINDOW_BEFORE_PAREN_TOKENS
  WINDOW_SIDES
  JSON_KEY_VALUE_SEPARATOR_TOKENS
  FETCH_TOKENS
  ADD_CONSTRAINT_TOKENS
  DISTINCT_TOKENS
  NULL_TOKENS
  UNNEST_OFFSET_ALIAS_TOKENS
  SELECT_START_TOKENS
  STRICT_CAST
  PREFIXED_PIVOT_COLUMNS
  IDENTIFY_PIVOT_STRINGS
  ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
  TABLESAMPLE_CSV
  SET_REQUIRES_ASSIGNMENT_DELIMITER
  TRIM_PATTERN_FIRST
  STRING_ALIASES
  UNION_MODIFIERS
  NO_PAREN_IF_COMMANDS
  JSON_ARROWS_REQUIRE_JSON_TYPE
  VALUES_FOLLOWED_BY_PAREN
  SUPPORTS_IMPLICIT_UNNEST
  SUPPORTS_PARTITION_SELECTION
  error_level
  error_message_context
  max_errors
  dialect
  reset
  parse
  parse_into
  check_errors
  raise_error
  expression
  validate_expression
  errors
  sql

class ClickHouse.Generator(sqlglot.generator.Generator): View Source

    571    class Generator(generator.Generator):
    572        QUERY_HINTS = False
    573        STRUCT_DELIMITER = ("(", ")")
    574        NVL2_SUPPORTED = False
    575        TABLESAMPLE_REQUIRES_PARENS = False
    576        TABLESAMPLE_SIZE_IS_ROWS = False
    577        TABLESAMPLE_KEYWORDS = "SAMPLE"
    578        LAST_DAY_SUPPORTS_DATE_PART = False
    579        CAN_IMPLEMENT_ARRAY_ANY = True
    580        SUPPORTS_TO_NUMBER = False
    581
    582        STRING_TYPE_MAPPING = {
    583            exp.DataType.Type.CHAR: "String",
    584            exp.DataType.Type.LONGBLOB: "String",
    585            exp.DataType.Type.LONGTEXT: "String",
    586            exp.DataType.Type.MEDIUMBLOB: "String",
    587            exp.DataType.Type.MEDIUMTEXT: "String",
    588            exp.DataType.Type.TINYBLOB: "String",
    589            exp.DataType.Type.TINYTEXT: "String",
    590            exp.DataType.Type.TEXT: "String",
    591            exp.DataType.Type.VARBINARY: "String",
    592            exp.DataType.Type.VARCHAR: "String",
    593        }
    594
    595        SUPPORTED_JSON_PATH_PARTS = {
    596            exp.JSONPathKey,
    597            exp.JSONPathRoot,
    598            exp.JSONPathSubscript,
    599        }
    600
    601        TYPE_MAPPING = {
    602            **generator.Generator.TYPE_MAPPING,
    603            **STRING_TYPE_MAPPING,
    604            exp.DataType.Type.ARRAY: "Array",
    605            exp.DataType.Type.BIGINT: "Int64",
    606            exp.DataType.Type.DATE32: "Date32",
    607            exp.DataType.Type.DATETIME64: "DateTime64",
    608            exp.DataType.Type.DOUBLE: "Float64",
    609            exp.DataType.Type.ENUM: "Enum",
    610            exp.DataType.Type.ENUM8: "Enum8",
    611            exp.DataType.Type.ENUM16: "Enum16",
    612            exp.DataType.Type.FIXEDSTRING: "FixedString",
    613            exp.DataType.Type.FLOAT: "Float32",
    614            exp.DataType.Type.INT: "Int32",
    615            exp.DataType.Type.MEDIUMINT: "Int32",
    616            exp.DataType.Type.INT128: "Int128",
    617            exp.DataType.Type.INT256: "Int256",
    618            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
    619            exp.DataType.Type.MAP: "Map",
    620            exp.DataType.Type.NESTED: "Nested",
    621            exp.DataType.Type.NULLABLE: "Nullable",
    622            exp.DataType.Type.SMALLINT: "Int16",
    623            exp.DataType.Type.STRUCT: "Tuple",
    624            exp.DataType.Type.TINYINT: "Int8",
    625            exp.DataType.Type.UBIGINT: "UInt64",
    626            exp.DataType.Type.UINT: "UInt32",
    627            exp.DataType.Type.UINT128: "UInt128",
    628            exp.DataType.Type.UINT256: "UInt256",
    629            exp.DataType.Type.USMALLINT: "UInt16",
    630            exp.DataType.Type.UTINYINT: "UInt8",
    631            exp.DataType.Type.IPV4: "IPv4",
    632            exp.DataType.Type.IPV6: "IPv6",
    633            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
    634            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
    635        }
    636
    637        TRANSFORMS = {
    638            **generator.Generator.TRANSFORMS,
    639            exp.AnyValue: rename_func("any"),
    640            exp.ApproxDistinct: rename_func("uniq"),
    641            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
    642            exp.ArraySize: rename_func("LENGTH"),
    643            exp.ArraySum: rename_func("arraySum"),
    644            exp.ArgMax: arg_max_or_min_no_count("argMax"),
    645            exp.ArgMin: arg_max_or_min_no_count("argMin"),
    646            exp.Array: inline_array_sql,
    647            exp.CastToStrType: rename_func("CAST"),
    648            exp.CountIf: rename_func("countIf"),
    649            exp.CompressColumnConstraint: lambda self,
    650            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
    651            exp.ComputedColumnConstraint: lambda self,
    652            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
    653            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
    654            exp.DateAdd: date_delta_sql("DATE_ADD"),
    655            exp.DateDiff: date_delta_sql("DATE_DIFF"),
    656            exp.Explode: rename_func("arrayJoin"),
    657            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
    658            exp.IsNan: rename_func("isNaN"),
    659            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
    660            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
    661            exp.JSONPathKey: json_path_key_only_name,
    662            exp.JSONPathRoot: lambda *_: "",
    663            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
    664            exp.Nullif: rename_func("nullIf"),
    665            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
    666            exp.Pivot: no_pivot_sql,
    667            exp.Quantile: _quantile_sql,
    668            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
    669            exp.Rand: rename_func("randCanonical"),
    670            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
    671            exp.StartsWith: rename_func("startsWith"),
    672            exp.StrPosition: lambda self, e: self.func(
    673                "position", e.this, e.args.get("substr"), e.args.get("position")
    674            ),
    675            exp.TimeToStr: lambda self, e: self.func(
    676                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
    677            ),
    678            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
    679            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
    680        }
    681
    682        PROPERTIES_LOCATION = {
    683            **generator.Generator.PROPERTIES_LOCATION,
    684            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
    685            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
    686            exp.OnCluster: exp.Properties.Location.POST_NAME,
    687        }
    688
    689        JOIN_HINTS = False
    690        TABLE_HINTS = False
    691        EXPLICIT_UNION = True
    692        GROUPINGS_SEP = ""
    693        OUTER_UNION_MODIFIERS = False
    694
    695        # there's no list in docs, but it can be found in Clickhouse code
    696        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
    697        ON_CLUSTER_TARGETS = {
    698            "DATABASE",
    699            "TABLE",
    700            "VIEW",
    701            "DICTIONARY",
    702            "INDEX",
    703            "FUNCTION",
    704            "NAMED COLLECTION",
    705        }
    706
    707        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
    708            this = self.json_path_part(expression.this)
    709            return str(int(this) + 1) if is_int(this) else this
    710
    711        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
    712            return f"AS {self.sql(expression, 'this')}"
    713
    714        def _any_to_has(
    715            self,
    716            expression: exp.EQ | exp.NEQ,
    717            default: t.Callable[[t.Any], str],
    718            prefix: str = "",
    719        ) -> str:
    720            if isinstance(expression.left, exp.Any):
    721                arr = expression.left
    722                this = expression.right
    723            elif isinstance(expression.right, exp.Any):
    724                arr = expression.right
    725                this = expression.left
    726            else:
    727                return default(expression)
    728
    729            return prefix + self.func("has", arr.this.unnest(), this)
    730
    731        def eq_sql(self, expression: exp.EQ) -> str:
    732            return self._any_to_has(expression, super().eq_sql)
    733
    734        def neq_sql(self, expression: exp.NEQ) -> str:
    735            return self._any_to_has(expression, super().neq_sql, "NOT ")
    736
    737        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
    738            # Manually add a flag to make the search case-insensitive
    739            regex = self.func("CONCAT", "'(?i)'", expression.expression)
    740            return self.func("match", expression.this, regex)
    741
    742        def datatype_sql(self, expression: exp.DataType) -> str:
    743            # String is the standard ClickHouse type, every other variant is just an alias.
    744            # Additionally, any supplied length parameter will be ignored.
    745            #
    746            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    747            if expression.this in self.STRING_TYPE_MAPPING:
    748                return "String"
    749
    750            return super().datatype_sql(expression)
    751
    752        def cte_sql(self, expression: exp.CTE) -> str:
    753            if expression.args.get("scalar"):
    754                this = self.sql(expression, "this")
    755                alias = self.sql(expression, "alias")
    756                return f"{this} AS {alias}"
    757
    758            return super().cte_sql(expression)
    759
    760        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    761            return super().after_limit_modifiers(expression) + [
    762                (
    763                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    764                    if expression.args.get("settings")
    765                    else ""
    766                ),
    767                (
    768                    self.seg("FORMAT ") + self.sql(expression, "format")
    769                    if expression.args.get("format")
    770                    else ""
    771                ),
    772            ]
    773
    774        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
    775            params = self.expressions(expression, key="params", flat=True)
    776            return self.func(expression.name, *expression.expressions) + f"({params})"
    777
    778        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
    779            return self.func(expression.name, *expression.expressions)
    780
    781        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
    782            return self.anonymousaggfunc_sql(expression)
    783
    784        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
    785            return self.parameterizedagg_sql(expression)
    786
    787        def placeholder_sql(self, expression: exp.Placeholder) -> str:
    788            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
    789
    790        def oncluster_sql(self, expression: exp.OnCluster) -> str:
    791            return f"ON CLUSTER {self.sql(expression, 'this')}"
    792
    793        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    794            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    795                exp.Properties.Location.POST_NAME
    796            ):
    797                this_name = self.sql(expression.this, "this")
    798                this_properties = " ".join(
    799                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    800                )
    801                this_schema = self.schema_columns_sql(expression.this)
    802                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    803
    804            return super().createable_sql(expression, locations)
    805
    806        def prewhere_sql(self, expression: exp.PreWhere) -> str:
    807            this = self.indent(self.sql(expression, "this"))
    808            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
    809
    810        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    811            this = self.sql(expression, "this")
    812            this = f" {this}" if this else ""
    813            expr = self.sql(expression, "expression")
    814            expr = f" {expr}" if expr else ""
    815            index_type = self.sql(expression, "index_type")
    816            index_type = f" TYPE {index_type}" if index_type else ""
    817            granularity = self.sql(expression, "granularity")
    818            granularity = f" GRANULARITY {granularity}" if granularity else ""
    819
    820            return f"INDEX{this}{expr}{index_type}{granularity}"

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

###### Arguments:

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

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

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

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

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

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

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

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

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

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

    742        def datatype_sql(self, expression: exp.DataType) -> str:
    743            # String is the standard ClickHouse type, every other variant is just an alias.
    744            # Additionally, any supplied length parameter will be ignored.
    745            #
    746            # https://clickhouse.com/docs/en/sql-reference/data-types/string
    747            if expression.this in self.STRING_TYPE_MAPPING:
    748                return "String"
    749
    750            return super().datatype_sql(expression)

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

    752        def cte_sql(self, expression: exp.CTE) -> str:
    753            if expression.args.get("scalar"):
    754                this = self.sql(expression, "this")
    755                alias = self.sql(expression, "alias")
    756                return f"{this} AS {alias}"
    757
    758            return super().cte_sql(expression)

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

    760        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
    761            return super().after_limit_modifiers(expression) + [
    762                (
    763                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
    764                    if expression.args.get("settings")
    765                    else ""
    766                ),
    767                (
    768                    self.seg("FORMAT ") + self.sql(expression, "format")
    769                    if expression.args.get("format")
    770                    else ""
    771                ),
    772            ]

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

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

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

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

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

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

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

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

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

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

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

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

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

    793        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
    794            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
    795                exp.Properties.Location.POST_NAME
    796            ):
    797                this_name = self.sql(expression.this, "this")
    798                this_properties = " ".join(
    799                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
    800                )
    801                this_schema = self.schema_columns_sql(expression.this)
    802                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
    803
    804            return super().createable_sql(expression, locations)

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

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

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

    810        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
    811            this = self.sql(expression, "this")
    812            this = f" {this}" if this else ""
    813            expr = self.sql(expression, "expression")
    814            expr = f" {expr}" if expr else ""
    815            index_type = self.sql(expression, "index_type")
    816            index_type = f" TYPE {index_type}" if index_type else ""
    817            granularity = self.sql(expression, "granularity")
    818            granularity = f" GRANULARITY {granularity}" if granularity else ""
    819
    820            return f"INDEX{this}{expr}{index_type}{granularity}"

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

##### Inherited Members

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