Edit on GitHub

sqlglot.dialects.clickhouse

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

Determines how function names are going to be normalized.

Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

FORCE_EARLY_ALIAS_REF_EXPANSION = True

Whether alias reference expansion (_expand_alias_refs()) should run before column qualification (_qualify_columns()).

For example:

WITH data AS ( SELECT 1 AS id, 2 AS my_id ) SELECT id AS my_id FROM data WHERE my_id = 1 GROUP BY my_id, HAVING my_id = 1

In most dialects "my_id" would refer to "data.my_id" (which is done in _qualify_columns()) across the query, except: - BigQuery, which will forward the alias to GROUP BY + HAVING clauses i.e it resolves to "WHERE my_id = 1 GROUP BY id HAVING id = 1" - Clickhouse, which will forward the alias across the query i.e it resolves to "WHERE id = 1 GROUP BY id HAVING id = 1"

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 ( ).

SUPPORTS_COLUMN_JOIN_MARKS = False

Whether the old-style outer join (+) syntax is supported.

tokenizer_class = <class 'ClickHouse.Tokenizer'>
jsonpath_tokenizer_class = <class 'sqlglot.tokens.JSONPathTokenizer'>
parser_class = <class 'ClickHouse.Parser'>
generator_class = <class 'ClickHouse.Generator'>
TIME_TRIE: Dict = {}
FORMAT_TRIE: Dict = {}
INVERSE_TIME_MAPPING: Dict[str, str] = {}
INVERSE_TIME_TRIE: Dict = {}
INVERSE_FORMAT_MAPPING: Dict[str, str] = {}
INVERSE_FORMAT_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
class ClickHouse.Tokenizer(sqlglot.tokens.Tokenizer):
112    class Tokenizer(tokens.Tokenizer):
113        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
114        IDENTIFIERS = ['"', "`"]
115        STRING_ESCAPES = ["'", "\\"]
116        BIT_STRINGS = [("0b", "")]
117        HEX_STRINGS = [("0x", ""), ("0X", "")]
118        HEREDOC_STRINGS = ["$"]
119
120        KEYWORDS = {
121            **tokens.Tokenizer.KEYWORDS,
122            "ATTACH": TokenType.COMMAND,
123            "DATE32": TokenType.DATE32,
124            "DATETIME64": TokenType.DATETIME64,
125            "DICTIONARY": TokenType.DICTIONARY,
126            "ENUM8": TokenType.ENUM8,
127            "ENUM16": TokenType.ENUM16,
128            "FINAL": TokenType.FINAL,
129            "FIXEDSTRING": TokenType.FIXEDSTRING,
130            "FLOAT32": TokenType.FLOAT,
131            "FLOAT64": TokenType.DOUBLE,
132            "GLOBAL": TokenType.GLOBAL,
133            "INT256": TokenType.INT256,
134            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
135            "MAP": TokenType.MAP,
136            "NESTED": TokenType.NESTED,
137            "SAMPLE": TokenType.TABLE_SAMPLE,
138            "TUPLE": TokenType.STRUCT,
139            "UINT128": TokenType.UINT128,
140            "UINT16": TokenType.USMALLINT,
141            "UINT256": TokenType.UINT256,
142            "UINT32": TokenType.UINT,
143            "UINT64": TokenType.UBIGINT,
144            "UINT8": TokenType.UTINYINT,
145            "IPV4": TokenType.IPV4,
146            "IPV6": TokenType.IPV6,
147            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
148            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
149            "SYSTEM": TokenType.COMMAND,
150            "PREWHERE": TokenType.PREWHERE,
151        }
152        KEYWORDS.pop("/*+")
153
154        SINGLE_TOKENS = {
155            **tokens.Tokenizer.SINGLE_TOKENS,
156            "$": TokenType.HEREDOC_STRING,
157        }
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.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, ':=': <TokenType.COLON_EQ: 'COLON_EQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'COPY': <TokenType.COPY: 'COPY'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'STRAIGHT_JOIN': <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, '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'>, 'LIST': <TokenType.LIST: 'LIST'>, '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'>, 'JSONB': <TokenType.JSONB: 'JSONB'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'BPCHAR': <TokenType.BPCHAR: 'BPCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'TIMESTAMP_LTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'TIMESTAMPNTZ': <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, 'TIMESTAMP_NTZ': <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'VECTOR': <TokenType.VECTOR: 'VECTOR'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATE32': <TokenType.DATE32: 'DATE32'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>, 'IPV4': <TokenType.IPV4: 'IPV4'>, 'IPV6': <TokenType.IPV6: 'IPV6'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, 'SYSTEM': <TokenType.COMMAND: 'COMMAND'>, 'PREWHERE': <TokenType.PREWHERE: 'PREWHERE'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, '#': <TokenType.HASH: 'HASH'>, "'": <TokenType.UNKNOWN: 'UNKNOWN'>, '`': <TokenType.UNKNOWN: 'UNKNOWN'>, '"': <TokenType.UNKNOWN: 'UNKNOWN'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}
class ClickHouse.Parser(sqlglot.parser.Parser):
159    class Parser(parser.Parser):
160        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
161        # * select x from t1 union all select x from t2 limit 1;
162        # * select x from t1 union all (select x from t2 limit 1);
163        MODIFIERS_ATTACHED_TO_SET_OP = False
164        INTERVAL_SPANS = False
165
166        FUNCTIONS = {
167            **parser.Parser.FUNCTIONS,
168            "ANY": exp.AnyValue.from_arg_list,
169            "ARRAYSUM": exp.ArraySum.from_arg_list,
170            "COUNTIF": _build_count_if,
171            "DATE_ADD": build_date_delta(exp.DateAdd, default_unit=None),
172            "DATEADD": build_date_delta(exp.DateAdd, default_unit=None),
173            "DATE_DIFF": build_date_delta(exp.DateDiff, default_unit=None),
174            "DATEDIFF": build_date_delta(exp.DateDiff, default_unit=None),
175            "DATE_FORMAT": _build_date_format,
176            "DATE_SUB": build_date_delta(exp.DateSub, default_unit=None),
177            "DATESUB": build_date_delta(exp.DateSub, default_unit=None),
178            "FORMATDATETIME": _build_date_format,
179            "JSONEXTRACTSTRING": build_json_extract_path(
180                exp.JSONExtractScalar, zero_based_indexing=False
181            ),
182            "MAP": parser.build_var_map,
183            "MATCH": exp.RegexpLike.from_arg_list,
184            "RANDCANONICAL": exp.Rand.from_arg_list,
185            "TUPLE": exp.Struct.from_arg_list,
186            "TIMESTAMP_SUB": build_date_delta(exp.TimestampSub, default_unit=None),
187            "TIMESTAMPSUB": build_date_delta(exp.TimestampSub, default_unit=None),
188            "TIMESTAMP_ADD": build_date_delta(exp.TimestampAdd, default_unit=None),
189            "TIMESTAMPADD": build_date_delta(exp.TimestampAdd, default_unit=None),
190            "UNIQ": exp.ApproxDistinct.from_arg_list,
191            "XOR": lambda args: exp.Xor(expressions=args),
192            "MD5": exp.MD5Digest.from_arg_list,
193            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
194            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
195        }
196
197        AGG_FUNCTIONS = {
198            "count",
199            "min",
200            "max",
201            "sum",
202            "avg",
203            "any",
204            "stddevPop",
205            "stddevSamp",
206            "varPop",
207            "varSamp",
208            "corr",
209            "covarPop",
210            "covarSamp",
211            "entropy",
212            "exponentialMovingAverage",
213            "intervalLengthSum",
214            "kolmogorovSmirnovTest",
215            "mannWhitneyUTest",
216            "median",
217            "rankCorr",
218            "sumKahan",
219            "studentTTest",
220            "welchTTest",
221            "anyHeavy",
222            "anyLast",
223            "boundingRatio",
224            "first_value",
225            "last_value",
226            "argMin",
227            "argMax",
228            "avgWeighted",
229            "topK",
230            "topKWeighted",
231            "deltaSum",
232            "deltaSumTimestamp",
233            "groupArray",
234            "groupArrayLast",
235            "groupUniqArray",
236            "groupArrayInsertAt",
237            "groupArrayMovingAvg",
238            "groupArrayMovingSum",
239            "groupArraySample",
240            "groupBitAnd",
241            "groupBitOr",
242            "groupBitXor",
243            "groupBitmap",
244            "groupBitmapAnd",
245            "groupBitmapOr",
246            "groupBitmapXor",
247            "sumWithOverflow",
248            "sumMap",
249            "minMap",
250            "maxMap",
251            "skewSamp",
252            "skewPop",
253            "kurtSamp",
254            "kurtPop",
255            "uniq",
256            "uniqExact",
257            "uniqCombined",
258            "uniqCombined64",
259            "uniqHLL12",
260            "uniqTheta",
261            "quantile",
262            "quantiles",
263            "quantileExact",
264            "quantilesExact",
265            "quantileExactLow",
266            "quantilesExactLow",
267            "quantileExactHigh",
268            "quantilesExactHigh",
269            "quantileExactWeighted",
270            "quantilesExactWeighted",
271            "quantileTiming",
272            "quantilesTiming",
273            "quantileTimingWeighted",
274            "quantilesTimingWeighted",
275            "quantileDeterministic",
276            "quantilesDeterministic",
277            "quantileTDigest",
278            "quantilesTDigest",
279            "quantileTDigestWeighted",
280            "quantilesTDigestWeighted",
281            "quantileBFloat16",
282            "quantilesBFloat16",
283            "quantileBFloat16Weighted",
284            "quantilesBFloat16Weighted",
285            "simpleLinearRegression",
286            "stochasticLinearRegression",
287            "stochasticLogisticRegression",
288            "categoricalInformationValue",
289            "contingency",
290            "cramersV",
291            "cramersVBiasCorrected",
292            "theilsU",
293            "maxIntersections",
294            "maxIntersectionsPosition",
295            "meanZTest",
296            "quantileInterpolatedWeighted",
297            "quantilesInterpolatedWeighted",
298            "quantileGK",
299            "quantilesGK",
300            "sparkBar",
301            "sumCount",
302            "largestTriangleThreeBuckets",
303            "histogram",
304            "sequenceMatch",
305            "sequenceCount",
306            "windowFunnel",
307            "retention",
308            "uniqUpTo",
309            "sequenceNextNode",
310            "exponentialTimeDecayedAvg",
311        }
312
313        AGG_FUNCTIONS_SUFFIXES = [
314            "If",
315            "Array",
316            "ArrayIf",
317            "Map",
318            "SimpleState",
319            "State",
320            "Merge",
321            "MergeState",
322            "ForEach",
323            "Distinct",
324            "OrDefault",
325            "OrNull",
326            "Resample",
327            "ArgMin",
328            "ArgMax",
329        ]
330
331        FUNC_TOKENS = {
332            *parser.Parser.FUNC_TOKENS,
333            TokenType.SET,
334        }
335
336        AGG_FUNC_MAPPING = (
337            lambda functions, suffixes: {
338                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
339            }
340        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
341
342        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
343
344        FUNCTION_PARSERS = {
345            **parser.Parser.FUNCTION_PARSERS,
346            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
347            "QUANTILE": lambda self: self._parse_quantile(),
348        }
349
350        FUNCTION_PARSERS.pop("MATCH")
351
352        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
353        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
354
355        RANGE_PARSERS = {
356            **parser.Parser.RANGE_PARSERS,
357            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
358            and self._parse_in(this, is_global=True),
359        }
360
361        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
362        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
363        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
364        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
365
366        JOIN_KINDS = {
367            *parser.Parser.JOIN_KINDS,
368            TokenType.ANY,
369            TokenType.ASOF,
370            TokenType.ARRAY,
371        }
372
373        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
374            TokenType.ANY,
375            TokenType.ARRAY,
376            TokenType.FINAL,
377            TokenType.FORMAT,
378            TokenType.SETTINGS,
379        }
380
381        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
382            TokenType.FORMAT,
383        }
384
385        LOG_DEFAULTS_TO_LN = True
386
387        QUERY_MODIFIER_PARSERS = {
388            **parser.Parser.QUERY_MODIFIER_PARSERS,
389            TokenType.SETTINGS: lambda self: (
390                "settings",
391                self._advance() or self._parse_csv(self._parse_assignment),
392            ),
393            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
394        }
395
396        CONSTRAINT_PARSERS = {
397            **parser.Parser.CONSTRAINT_PARSERS,
398            "INDEX": lambda self: self._parse_index_constraint(),
399            "CODEC": lambda self: self._parse_compress(),
400        }
401
402        ALTER_PARSERS = {
403            **parser.Parser.ALTER_PARSERS,
404            "REPLACE": lambda self: self._parse_alter_table_replace(),
405        }
406
407        SCHEMA_UNNAMED_CONSTRAINTS = {
408            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
409            "INDEX",
410        }
411
412        def _parse_extract(self) -> exp.Extract | exp.Anonymous:
413            index = self._index
414            this = self._parse_bitwise()
415            if self._match(TokenType.FROM):
416                self._retreat(index)
417                return super()._parse_extract()
418
419            # We return Anonymous here because extract and regexpExtract have different semantics,
420            # so parsing extract(foo, bar) into RegexpExtract can potentially break queries. E.g.,
421            # `extract('foobar', 'b')` works, but CH crashes for `regexpExtract('foobar', 'b')`.
422            #
423            # TODO: can we somehow convert the former into an equivalent `regexpExtract` call?
424            self._match(TokenType.COMMA)
425            return self.expression(
426                exp.Anonymous, this="extract", expressions=[this, self._parse_bitwise()]
427            )
428
429        def _parse_assignment(self) -> t.Optional[exp.Expression]:
430            this = super()._parse_assignment()
431
432            if self._match(TokenType.PLACEHOLDER):
433                return self.expression(
434                    exp.If,
435                    this=this,
436                    true=self._parse_assignment(),
437                    false=self._match(TokenType.COLON) and self._parse_assignment(),
438                )
439
440            return this
441
442        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
443            """
444            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
445            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
446            """
447            if not self._match(TokenType.L_BRACE):
448                return None
449
450            this = self._parse_id_var()
451            self._match(TokenType.COLON)
452            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
453                self._match_text_seq("IDENTIFIER") and "Identifier"
454            )
455
456            if not kind:
457                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
458            elif not self._match(TokenType.R_BRACE):
459                self.raise_error("Expecting }")
460
461            return self.expression(exp.Placeholder, this=this, kind=kind)
462
463        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
464            this = super()._parse_in(this)
465            this.set("is_global", is_global)
466            return this
467
468        def _parse_table(
469            self,
470            schema: bool = False,
471            joins: bool = False,
472            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
473            parse_bracket: bool = False,
474            is_db_reference: bool = False,
475            parse_partition: bool = False,
476        ) -> t.Optional[exp.Expression]:
477            this = super()._parse_table(
478                schema=schema,
479                joins=joins,
480                alias_tokens=alias_tokens,
481                parse_bracket=parse_bracket,
482                is_db_reference=is_db_reference,
483            )
484
485            if self._match(TokenType.FINAL):
486                this = self.expression(exp.Final, this=this)
487
488            return this
489
490        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
491            return super()._parse_position(haystack_first=True)
492
493        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
494        def _parse_cte(self) -> exp.CTE:
495            # WITH <identifier> AS <subquery expression>
496            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
497
498            if not cte:
499                # WITH <expression> AS <identifier>
500                cte = self.expression(
501                    exp.CTE,
502                    this=self._parse_assignment(),
503                    alias=self._parse_table_alias(),
504                    scalar=True,
505                )
506
507            return cte
508
509        def _parse_join_parts(
510            self,
511        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
512            is_global = self._match(TokenType.GLOBAL) and self._prev
513            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
514
515            if kind_pre:
516                kind = self._match_set(self.JOIN_KINDS) and self._prev
517                side = self._match_set(self.JOIN_SIDES) and self._prev
518                return is_global, side, kind
519
520            return (
521                is_global,
522                self._match_set(self.JOIN_SIDES) and self._prev,
523                self._match_set(self.JOIN_KINDS) and self._prev,
524            )
525
526        def _parse_join(
527            self, skip_join_token: bool = False, parse_bracket: bool = False
528        ) -> t.Optional[exp.Join]:
529            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
530            if join:
531                join.set("global", join.args.pop("method", None))
532
533            return join
534
535        def _parse_function(
536            self,
537            functions: t.Optional[t.Dict[str, t.Callable]] = None,
538            anonymous: bool = False,
539            optional_parens: bool = True,
540            any_token: bool = False,
541        ) -> t.Optional[exp.Expression]:
542            expr = super()._parse_function(
543                functions=functions,
544                anonymous=anonymous,
545                optional_parens=optional_parens,
546                any_token=any_token,
547            )
548
549            func = expr.this if isinstance(expr, exp.Window) else expr
550
551            # Aggregate functions can be split in 2 parts: <func_name><suffix>
552            parts = (
553                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
554            )
555
556            if parts:
557                params = self._parse_func_params(func)
558
559                kwargs = {
560                    "this": func.this,
561                    "expressions": func.expressions,
562                }
563                if parts[1]:
564                    kwargs["parts"] = parts
565                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
566                else:
567                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
568
569                kwargs["exp_class"] = exp_class
570                if params:
571                    kwargs["params"] = params
572
573                func = self.expression(**kwargs)
574
575                if isinstance(expr, exp.Window):
576                    # The window's func was parsed as Anonymous in base parser, fix its
577                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
578                    expr.set("this", func)
579                elif params:
580                    # Params have blocked super()._parse_function() from parsing the following window
581                    # (if that exists) as they're standing between the function call and the window spec
582                    expr = self._parse_window(func)
583                else:
584                    expr = func
585
586            return expr
587
588        def _parse_func_params(
589            self, this: t.Optional[exp.Func] = None
590        ) -> t.Optional[t.List[exp.Expression]]:
591            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
592                return self._parse_csv(self._parse_lambda)
593
594            if self._match(TokenType.L_PAREN):
595                params = self._parse_csv(self._parse_lambda)
596                self._match_r_paren(this)
597                return params
598
599            return None
600
601        def _parse_quantile(self) -> exp.Quantile:
602            this = self._parse_lambda()
603            params = self._parse_func_params()
604            if params:
605                return self.expression(exp.Quantile, this=params[0], quantile=this)
606            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
607
608        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
609            return super()._parse_wrapped_id_vars(optional=True)
610
611        def _parse_primary_key(
612            self, wrapped_optional: bool = False, in_props: bool = False
613        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
614            return super()._parse_primary_key(
615                wrapped_optional=wrapped_optional or in_props, in_props=in_props
616            )
617
618        def _parse_on_property(self) -> t.Optional[exp.Expression]:
619            index = self._index
620            if self._match_text_seq("CLUSTER"):
621                this = self._parse_id_var()
622                if this:
623                    return self.expression(exp.OnCluster, this=this)
624                else:
625                    self._retreat(index)
626            return None
627
628        def _parse_index_constraint(
629            self, kind: t.Optional[str] = None
630        ) -> exp.IndexColumnConstraint:
631            # INDEX name1 expr TYPE type1(args) GRANULARITY value
632            this = self._parse_id_var()
633            expression = self._parse_assignment()
634
635            index_type = self._match_text_seq("TYPE") and (
636                self._parse_function() or self._parse_var()
637            )
638
639            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
640
641            return self.expression(
642                exp.IndexColumnConstraint,
643                this=this,
644                expression=expression,
645                index_type=index_type,
646                granularity=granularity,
647            )
648
649        def _parse_partition(self) -> t.Optional[exp.Partition]:
650            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
651            if not self._match(TokenType.PARTITION):
652                return None
653
654            if self._match_text_seq("ID"):
655                # Corresponds to the PARTITION ID <string_value> syntax
656                expressions: t.List[exp.Expression] = [
657                    self.expression(exp.PartitionId, this=self._parse_string())
658                ]
659            else:
660                expressions = self._parse_expressions()
661
662            return self.expression(exp.Partition, expressions=expressions)
663
664        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
665            partition = self._parse_partition()
666
667            if not partition or not self._match(TokenType.FROM):
668                return None
669
670            return self.expression(
671                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
672            )
673
674        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
675            if not self._match_text_seq("PROJECTION"):
676                return None
677
678            return self.expression(
679                exp.ProjectionDef,
680                this=self._parse_id_var(),
681                expression=self._parse_wrapped(self._parse_statement),
682            )
683
684        def _parse_constraint(self) -> t.Optional[exp.Expression]:
685            return super()._parse_constraint() or self._parse_projection_def()

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

Arguments:
  • error_level: The desired error level. Default: ErrorLevel.IMMEDIATE
  • error_message_context: The amount of context to capture from a query string when displaying the error message (in number of characters). Default: 100
  • max_errors: Maximum number of error messages to include in a raised ParseError. This is only relevant if error_level is ErrorLevel.RAISE. Default: 3
MODIFIERS_ATTACHED_TO_SET_OP = False
INTERVAL_SPANS = False
FUNCTIONS = {'ABS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Abs'>>, 'ADD_MONTHS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AddMonths'>>, 'ANONYMOUS_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnonymousAggFunc'>>, 'ANY_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'APPROX_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_COUNT_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxQuantile'>>, 'APPROX_TOP_K': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxTopK'>>, 'ARG_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARGMAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'MAX_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARG_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARGMIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'MIN_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Array'>>, 'ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAgg'>>, 'ARRAY_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAll'>>, 'ARRAY_ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAny'>>, 'ARRAY_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CONSTRUCT_COMPACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConstructCompact'>>, 'ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'ARRAY_HAS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'ARRAY_CONTAINS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, 'ARRAY_HAS_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContainsAll'>>, '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 build_date_delta.<locals>._builder>, 'DATEDIFF': <function build_date_delta.<locals>._builder>, 'DATE_DIFF': <function build_date_delta.<locals>._builder>, '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': <function build_date_delta.<locals>._builder>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Datetime'>>, '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'>>, 'GAP_FILL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GapFill'>>, 'GENERATE_DATE_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateDateArray'>>, 'GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, 'GREATEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Greatest'>>, 'GROUP_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GroupConcat'>>, 'HEX': <function build_hex>, 'HLL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Hll'>>, 'IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'IIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'INITCAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Initcap'>>, 'IS_INF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'ISINF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'IS_NAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'ISNAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'J_S_O_N_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArray'>>, 'J_S_O_N_ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayAgg'>>, 'JSON_ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayContains'>>, 'JSONB_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBContains'>>, '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'>>, 'LIST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.List'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ln'>>, 'LOG': <function build_logarithm>, 'LOGICAL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOLAND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'LOGICAL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOLOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'LOWER': <function build_lower>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'LOWER_HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LowerHex'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MAP': <function build_var_map>, 'MAP_FROM_ENTRIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MapFromEntries'>>, 'MATCH_AGAINST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MatchAgainst'>>, 'MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Max'>>, 'MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Min'>>, 'MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Month'>>, 'MONTHS_BETWEEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MonthsBetween'>>, 'NEXT_VALUE_FOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NextValueFor'>>, 'NTH_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NthValue'>>, 'NULLIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nullif'>>, 'NUMBER_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NumberToStr'>>, 'NVL2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nvl2'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'QUARTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quarter'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_I_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpILike'>>, 'REGEXP_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'REGEXP_REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpReplace'>>, 'REGEXP_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpSplit'>>, 'REPEAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Repeat'>>, 'RIGHT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Right'>>, 'ROUND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Round'>>, 'ROW_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RowNumber'>>, 'SHA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA2'>>, 'SAFE_DIVIDE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SafeDivide'>>, 'SIGN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SIGNUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SORT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SortArray'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Split'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sqrt'>>, 'STANDARD_HASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StandardHash'>>, 'STAR_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StarMap'>>, 'STARTS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STARTSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STDDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToDate'>>, 'STR_TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToMap'>>, 'STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToTime'>>, 'STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToUnix'>>, 'STRING_TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, 'SPLIT_BY_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StringToArray'>>, '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': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Time'>>, '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': <function build_date_delta.<locals>._builder>, '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': <function build_date_delta.<locals>._builder>, 'TIMESTAMP_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampTrunc'>>, 'TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToArray'>>, 'TO_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToBase64'>>, 'TO_CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToChar'>>, 'TO_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToDays'>>, 'TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToMap'>>, 'TO_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToNumber'>>, 'TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Transform'>>, 'TRIM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Trim'>>, 'TRY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Try'>>, 'TRY_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TryCast'>>, 'TS_OR_DI_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDiToDi'>>, 'TS_OR_DS_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsAdd'>>, 'TS_OR_DS_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsDiff'>>, 'TS_OR_DS_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToDate'>>, 'TS_OR_DS_TO_DATE_STR': <function Parser.<lambda>>, 'TS_OR_DS_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToTime'>>, 'TS_OR_DS_TO_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToTimestamp'>>, 'UNHEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Unhex'>>, 'UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixDate'>>, 'UNIX_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToStr'>>, 'UNIX_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTime'>>, 'UNIX_TO_TIME_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTimeStr'>>, 'UNNEST': <function Parser.<lambda>>, 'UPPER': <function build_upper>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'VAR_MAP': <function build_var_map>, 'VARIANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'VAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Week'>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WEEKOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WHEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.When'>>, 'X_M_L_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.XMLTable'>>, 'XOR': <function ClickHouse.Parser.<lambda>>, 'YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Year'>>, 'GLOB': <function Parser.<lambda>>, 'JSON_EXTRACT_PATH_TEXT': <function build_extract_json_with_path.<locals>._builder>, 'LIKE': <function build_like>, 'LOG2': <function Parser.<lambda>>, 'LOG10': <function Parser.<lambda>>, 'MOD': <function build_mod>, 'SCOPE_RESOLUTION': <function Parser.<lambda>>, 'TO_HEX': <function build_hex>, 'ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'ARRAYSUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySum'>>, 'DATEADD': <function build_date_delta.<locals>._builder>, 'DATE_FORMAT': <function _build_date_format>, 'DATESUB': <function build_date_delta.<locals>._builder>, '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'>>, 'TIMESTAMPSUB': <function build_date_delta.<locals>._builder>, 'TIMESTAMPADD': <function build_date_delta.<locals>._builder>, 'UNIQ': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'SHA256': <function ClickHouse.Parser.<lambda>>, 'SHA512': <function ClickHouse.Parser.<lambda>>}
AGG_FUNCTIONS = {'quantilesDeterministic', 'intervalLengthSum', 'quantileExactLow', 'cramersV', 'sequenceMatch', 'quantilesTimingWeighted', 'quantileBFloat16Weighted', 'deltaSum', 'kolmogorovSmirnovTest', 'groupBitmapOr', 'sumKahan', 'rankCorr', 'quantileExactHigh', 'groupArrayInsertAt', 'maxIntersectionsPosition', 'sequenceCount', 'windowFunnel', 'quantilesBFloat16', 'exponentialMovingAverage', 'welchTTest', 'quantilesExact', 'covarPop', 'max', 'mannWhitneyUTest', 'kurtPop', 'deltaSumTimestamp', 'quantilesExactHigh', 'groupArray', 'uniqCombined', 'any', 'sum', 'quantilesBFloat16Weighted', 'uniqHLL12', 'uniq', 'exponentialTimeDecayedAvg', 'simpleLinearRegression', 'stddevPop', 'quantileTiming', 'uniqExact', 'studentTTest', 'quantileTimingWeighted', 'quantileInterpolatedWeighted', 'quantile', 'theilsU', 'retention', 'median', 'quantilesTiming', 'quantileExactWeighted', 'sparkBar', 'uniqUpTo', 'maxMap', 'groupBitmapXor', 'quantileGK', 'avg', 'groupBitmap', 'groupBitmapAnd', 'skewPop', 'uniqCombined64', 'quantileDeterministic', 'kurtSamp', 'corr', 'last_value', 'sumWithOverflow', 'groupUniqArray', 'groupArrayMovingAvg', 'topKWeighted', 'meanZTest', 'topK', 'groupBitAnd', 'anyHeavy', 'groupArrayLast', 'quantilesInterpolatedWeighted', 'quantilesTDigestWeighted', 'groupArraySample', 'maxIntersections', 'quantileTDigestWeighted', 'boundingRatio', 'quantileBFloat16', 'anyLast', 'avgWeighted', 'quantileTDigest', 'groupArrayMovingSum', 'uniqTheta', 'entropy', 'cramersVBiasCorrected', 'quantilesGK', 'largestTriangleThreeBuckets', 'argMax', 'sequenceNextNode', 'argMin', 'stddevSamp', 'minMap', 'categoricalInformationValue', 'sumMap', 'min', 'varPop', 'groupBitOr', 'first_value', 'quantilesExactWeighted', 'groupBitXor', 'quantilesTDigest', 'varSamp', 'count', 'quantiles', 'stochasticLinearRegression', 'skewSamp', 'quantilesExactLow', 'covarSamp', 'contingency', 'sumCount', 'quantileExact', 'histogram', 'stochasticLogisticRegression'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
FUNC_TOKENS = {<TokenType.BPCHAR: 'BPCHAR'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.NULL: 'NULL'>, <TokenType.ROW: 'ROW'>, <TokenType.DATE32: 'DATE32'>, <TokenType.IPV4: 'IPV4'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.INDEX: 'INDEX'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.GLOB: 'GLOB'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.LIKE: 'LIKE'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.VAR: 'VAR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.JSONB: 'JSONB'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT128: 'INT128'>, <TokenType.ALL: 'ALL'>, <TokenType.TIME: 'TIME'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SOME: 'SOME'>, <TokenType.INT: 'INT'>, <TokenType.UINT256: 'UINT256'>, <TokenType.LEFT: 'LEFT'>, <TokenType.CHAR: 'CHAR'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.SET: 'SET'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.MAP: 'MAP'>, <TokenType.XOR: 'XOR'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.INT256: 'INT256'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.YEAR: 'YEAR'>, <TokenType.SUPER: 'SUPER'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.UUID: 'UUID'>, <TokenType.IPV6: 'IPV6'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.MONEY: 'MONEY'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.MERGE: 'MERGE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.ANY: 'ANY'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TABLE: 'TABLE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.LIST: 'LIST'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.INSERT: 'INSERT'>, <TokenType.TEXT: 'TEXT'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.NAME: 'NAME'>, <TokenType.XML: 'XML'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.UINT: 'UINT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.DATE: 'DATE'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.INET: 'INET'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.JSON: 'JSON'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.BIT: 'BIT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>}
AGG_FUNC_MAPPING = {'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'cramersVIf': ('cramersV', 'If'), 'sequenceMatchIf': ('sequenceMatch', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'sequenceCountIf': ('sequenceCount', 'If'), 'windowFunnelIf': ('windowFunnel', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'covarPopIf': ('covarPop', 'If'), 'maxIf': ('max', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'anyIf': ('any', 'If'), 'sumIf': ('sum', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'uniqIf': ('uniq', 'If'), 'exponentialTimeDecayedAvgIf': ('exponentialTimeDecayedAvg', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'quantileIf': ('quantile', 'If'), 'theilsUIf': ('theilsU', 'If'), 'retentionIf': ('retention', 'If'), 'medianIf': ('median', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'uniqUpToIf': ('uniqUpTo', 'If'), 'maxMapIf': ('maxMap', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'avgIf': ('avg', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'skewPopIf': ('skewPop', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'corrIf': ('corr', 'If'), 'last_valueIf': ('last_value', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'topKIf': ('topK', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'anyLastIf': ('anyLast', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'entropyIf': ('entropy', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'argMaxIf': ('argMax', 'If'), 'sequenceNextNodeIf': ('sequenceNextNode', 'If'), 'argMinIf': ('argMin', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'minMapIf': ('minMap', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'sumMapIf': ('sumMap', 'If'), 'minIf': ('min', 'If'), 'varPopIf': ('varPop', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'first_valueIf': ('first_value', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'varSampIf': ('varSamp', 'If'), 'countIf': ('count', 'If'), 'quantilesIf': ('quantiles', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'contingencyIf': ('contingency', 'If'), 'sumCountIf': ('sumCount', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'histogramIf': ('histogram', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'sequenceMatchArray': ('sequenceMatch', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'sequenceCountArray': ('sequenceCount', 'Array'), 'windowFunnelArray': ('windowFunnel', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'maxArray': ('max', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'anyArray': ('any', 'Array'), 'sumArray': ('sum', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'uniqArray': ('uniq', 'Array'), 'exponentialTimeDecayedAvgArray': ('exponentialTimeDecayedAvg', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'quantileArray': ('quantile', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'retentionArray': ('retention', 'Array'), 'medianArray': ('median', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'uniqUpToArray': ('uniqUpTo', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'avgArray': ('avg', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'corrArray': ('corr', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'topKArray': ('topK', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'entropyArray': ('entropy', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'sequenceNextNodeArray': ('sequenceNextNode', 'Array'), 'argMinArray': ('argMin', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'minMapArray': ('minMap', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'minArray': ('min', 'Array'), 'varPopArray': ('varPop', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'countArray': ('count', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'histogramArray': ('histogram', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'sequenceMatchArrayIf': ('sequenceMatch', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'sequenceCountArrayIf': ('sequenceCount', 'ArrayIf'), 'windowFunnelArrayIf': ('windowFunnel', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'exponentialTimeDecayedAvgArrayIf': ('exponentialTimeDecayedAvg', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'retentionArrayIf': ('retention', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'uniqUpToArrayIf': ('uniqUpTo', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'sequenceNextNodeArrayIf': ('sequenceNextNode', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'histogramArrayIf': ('histogram', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'sequenceMatchMap': ('sequenceMatch', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'sequenceCountMap': ('sequenceCount', 'Map'), 'windowFunnelMap': ('windowFunnel', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'maxMap': ('maxMap', ''), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'anyMap': ('any', 'Map'), 'sumMap': ('sumMap', ''), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'uniqMap': ('uniq', 'Map'), 'exponentialTimeDecayedAvgMap': ('exponentialTimeDecayedAvg', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'quantileMap': ('quantile', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'retentionMap': ('retention', 'Map'), 'medianMap': ('median', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'uniqUpToMap': ('uniqUpTo', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'avgMap': ('avg', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'corrMap': ('corr', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'topKMap': ('topK', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'entropyMap': ('entropy', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'sequenceNextNodeMap': ('sequenceNextNode', 'Map'), 'argMinMap': ('argMin', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'minMapMap': ('minMap', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'minMap': ('minMap', ''), 'varPopMap': ('varPop', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'countMap': ('count', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'histogramMap': ('histogram', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'sequenceMatchSimpleState': ('sequenceMatch', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'sequenceCountSimpleState': ('sequenceCount', 'SimpleState'), 'windowFunnelSimpleState': ('windowFunnel', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'exponentialTimeDecayedAvgSimpleState': ('exponentialTimeDecayedAvg', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'retentionSimpleState': ('retention', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'uniqUpToSimpleState': ('uniqUpTo', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'sequenceNextNodeSimpleState': ('sequenceNextNode', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'histogramSimpleState': ('histogram', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'cramersVState': ('cramersV', 'State'), 'sequenceMatchState': ('sequenceMatch', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'sequenceCountState': ('sequenceCount', 'State'), 'windowFunnelState': ('windowFunnel', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'covarPopState': ('covarPop', 'State'), 'maxState': ('max', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'groupArrayState': ('groupArray', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'anyState': ('any', 'State'), 'sumState': ('sum', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'uniqState': ('uniq', 'State'), 'exponentialTimeDecayedAvgState': ('exponentialTimeDecayedAvg', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'quantileState': ('quantile', 'State'), 'theilsUState': ('theilsU', 'State'), 'retentionState': ('retention', 'State'), 'medianState': ('median', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'uniqUpToState': ('uniqUpTo', 'State'), 'maxMapState': ('maxMap', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'avgState': ('avg', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'skewPopState': ('skewPop', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'corrState': ('corr', 'State'), 'last_valueState': ('last_value', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'topKState': ('topK', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'anyLastState': ('anyLast', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'entropyState': ('entropy', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'argMaxState': ('argMax', 'State'), 'sequenceNextNodeState': ('sequenceNextNode', 'State'), 'argMinState': ('argMin', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'minMapState': ('minMap', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'sumMapState': ('sumMap', 'State'), 'minState': ('min', 'State'), 'varPopState': ('varPop', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'first_valueState': ('first_value', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'varSampState': ('varSamp', 'State'), 'countState': ('count', 'State'), 'quantilesState': ('quantiles', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'skewSampState': ('skewSamp', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'covarSampState': ('covarSamp', 'State'), 'contingencyState': ('contingency', 'State'), 'sumCountState': ('sumCount', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'histogramState': ('histogram', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'sequenceMatchMerge': ('sequenceMatch', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'sequenceCountMerge': ('sequenceCount', 'Merge'), 'windowFunnelMerge': ('windowFunnel', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'maxMerge': ('max', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'anyMerge': ('any', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'exponentialTimeDecayedAvgMerge': ('exponentialTimeDecayedAvg', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'retentionMerge': ('retention', 'Merge'), 'medianMerge': ('median', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'uniqUpToMerge': ('uniqUpTo', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'sequenceNextNodeMerge': ('sequenceNextNode', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'minMerge': ('min', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'countMerge': ('count', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'histogramMerge': ('histogram', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'sequenceMatchMergeState': ('sequenceMatch', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'sequenceCountMergeState': ('sequenceCount', 'MergeState'), 'windowFunnelMergeState': ('windowFunnel', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'exponentialTimeDecayedAvgMergeState': ('exponentialTimeDecayedAvg', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'retentionMergeState': ('retention', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'uniqUpToMergeState': ('uniqUpTo', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'sequenceNextNodeMergeState': ('sequenceNextNode', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'histogramMergeState': ('histogram', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'sequenceMatchForEach': ('sequenceMatch', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'sequenceCountForEach': ('sequenceCount', 'ForEach'), 'windowFunnelForEach': ('windowFunnel', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'exponentialTimeDecayedAvgForEach': ('exponentialTimeDecayedAvg', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'retentionForEach': ('retention', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'uniqUpToForEach': ('uniqUpTo', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'sequenceNextNodeForEach': ('sequenceNextNode', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'histogramForEach': ('histogram', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'sequenceMatchDistinct': ('sequenceMatch', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'sequenceCountDistinct': ('sequenceCount', 'Distinct'), 'windowFunnelDistinct': ('windowFunnel', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'exponentialTimeDecayedAvgDistinct': ('exponentialTimeDecayedAvg', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'retentionDistinct': ('retention', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'uniqUpToDistinct': ('uniqUpTo', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'sequenceNextNodeDistinct': ('sequenceNextNode', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'histogramDistinct': ('histogram', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'sequenceMatchOrDefault': ('sequenceMatch', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'sequenceCountOrDefault': ('sequenceCount', 'OrDefault'), 'windowFunnelOrDefault': ('windowFunnel', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'exponentialTimeDecayedAvgOrDefault': ('exponentialTimeDecayedAvg', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'retentionOrDefault': ('retention', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'uniqUpToOrDefault': ('uniqUpTo', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'sequenceNextNodeOrDefault': ('sequenceNextNode', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'histogramOrDefault': ('histogram', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'sequenceMatchOrNull': ('sequenceMatch', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'sequenceCountOrNull': ('sequenceCount', 'OrNull'), 'windowFunnelOrNull': ('windowFunnel', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'exponentialTimeDecayedAvgOrNull': ('exponentialTimeDecayedAvg', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'retentionOrNull': ('retention', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'uniqUpToOrNull': ('uniqUpTo', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'sequenceNextNodeOrNull': ('sequenceNextNode', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'histogramOrNull': ('histogram', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'sequenceMatchResample': ('sequenceMatch', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'sequenceCountResample': ('sequenceCount', 'Resample'), 'windowFunnelResample': ('windowFunnel', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'maxResample': ('max', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'anyResample': ('any', 'Resample'), 'sumResample': ('sum', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'exponentialTimeDecayedAvgResample': ('exponentialTimeDecayedAvg', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'retentionResample': ('retention', 'Resample'), 'medianResample': ('median', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'uniqUpToResample': ('uniqUpTo', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'avgResample': ('avg', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'corrResample': ('corr', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'topKResample': ('topK', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'sequenceNextNodeResample': ('sequenceNextNode', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'minResample': ('min', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'countResample': ('count', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'histogramResample': ('histogram', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'sequenceMatchArgMin': ('sequenceMatch', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'sequenceCountArgMin': ('sequenceCount', 'ArgMin'), 'windowFunnelArgMin': ('windowFunnel', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'exponentialTimeDecayedAvgArgMin': ('exponentialTimeDecayedAvg', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'retentionArgMin': ('retention', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'uniqUpToArgMin': ('uniqUpTo', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'sequenceNextNodeArgMin': ('sequenceNextNode', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'histogramArgMin': ('histogram', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'sequenceMatchArgMax': ('sequenceMatch', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'sequenceCountArgMax': ('sequenceCount', 'ArgMax'), 'windowFunnelArgMax': ('windowFunnel', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'exponentialTimeDecayedAvgArgMax': ('exponentialTimeDecayedAvg', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'retentionArgMax': ('retention', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'uniqUpToArgMax': ('uniqUpTo', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'sequenceNextNodeArgMax': ('sequenceNextNode', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'histogramArgMax': ('histogram', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'quantileExactLow': ('quantileExactLow', ''), 'cramersV': ('cramersV', ''), 'sequenceMatch': ('sequenceMatch', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'deltaSum': ('deltaSum', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'sumKahan': ('sumKahan', ''), 'rankCorr': ('rankCorr', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'sequenceCount': ('sequenceCount', ''), 'windowFunnel': ('windowFunnel', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'welchTTest': ('welchTTest', ''), 'quantilesExact': ('quantilesExact', ''), 'covarPop': ('covarPop', ''), 'max': ('max', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'kurtPop': ('kurtPop', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'groupArray': ('groupArray', ''), 'uniqCombined': ('uniqCombined', ''), 'any': ('any', ''), 'sum': ('sum', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'uniqHLL12': ('uniqHLL12', ''), 'uniq': ('uniq', ''), 'exponentialTimeDecayedAvg': ('exponentialTimeDecayedAvg', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'stddevPop': ('stddevPop', ''), 'quantileTiming': ('quantileTiming', ''), 'uniqExact': ('uniqExact', ''), 'studentTTest': ('studentTTest', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'quantile': ('quantile', ''), 'theilsU': ('theilsU', ''), 'retention': ('retention', ''), 'median': ('median', ''), 'quantilesTiming': ('quantilesTiming', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'sparkBar': ('sparkBar', ''), 'uniqUpTo': ('uniqUpTo', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'quantileGK': ('quantileGK', ''), 'avg': ('avg', ''), 'groupBitmap': ('groupBitmap', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'skewPop': ('skewPop', ''), 'uniqCombined64': ('uniqCombined64', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'kurtSamp': ('kurtSamp', ''), 'corr': ('corr', ''), 'last_value': ('last_value', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'groupUniqArray': ('groupUniqArray', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'topKWeighted': ('topKWeighted', ''), 'meanZTest': ('meanZTest', ''), 'topK': ('topK', ''), 'groupBitAnd': ('groupBitAnd', ''), 'anyHeavy': ('anyHeavy', ''), 'groupArrayLast': ('groupArrayLast', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'groupArraySample': ('groupArraySample', ''), 'maxIntersections': ('maxIntersections', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'boundingRatio': ('boundingRatio', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'anyLast': ('anyLast', ''), 'avgWeighted': ('avgWeighted', ''), 'quantileTDigest': ('quantileTDigest', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'uniqTheta': ('uniqTheta', ''), 'entropy': ('entropy', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'quantilesGK': ('quantilesGK', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'argMax': ('argMax', ''), 'sequenceNextNode': ('sequenceNextNode', ''), 'argMin': ('argMin', ''), 'stddevSamp': ('stddevSamp', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'min': ('min', ''), 'varPop': ('varPop', ''), 'groupBitOr': ('groupBitOr', ''), 'first_value': ('first_value', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'groupBitXor': ('groupBitXor', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'varSamp': ('varSamp', ''), 'count': ('count', ''), 'quantiles': ('quantiles', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'skewSamp': ('skewSamp', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'covarSamp': ('covarSamp', ''), 'contingency': ('contingency', ''), 'sumCount': ('sumCount', ''), 'quantileExact': ('quantileExact', ''), 'histogram': ('histogram', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'STRUCT', 'TUPLE'}
FUNCTION_PARSERS = {'CAST': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'GAP_FILL': <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>>, 'CONNECT_BY_ROOT': <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>._parse_binary_range>, <TokenType.ILIKE: 'ILIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IN: 'IN'>: <function Parser.<lambda>>, <TokenType.IRLIKE: 'IRLIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.IS: 'IS'>: <function Parser.<lambda>>, <TokenType.LIKE: 'LIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.OVERLAPS: 'OVERLAPS'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.RLIKE: 'RLIKE'>: <function binary_range_parser.<locals>._parse_binary_range>, <TokenType.SIMILAR_TO: 'SIMILAR_TO'>: <function binary_range_parser.<locals>._parse_binary_range>, <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.ASOF: 'ASOF'>, <TokenType.ANTI: 'ANTI'>, <TokenType.SEMI: 'SEMI'>, <TokenType.CROSS: 'CROSS'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.ANY: 'ANY'>, <TokenType.INNER: 'INNER'>, <TokenType.OUTER: 'OUTER'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>}
TABLE_ALIAS_TOKENS = {<TokenType.BPCHAR: 'BPCHAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.NULL: 'NULL'>, <TokenType.ROW: 'ROW'>, <TokenType.DATE32: 'DATE32'>, <TokenType.IPV4: 'IPV4'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.INDEX: 'INDEX'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.FALSE: 'FALSE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.TOP: 'TOP'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.MODEL: 'MODEL'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.ASC: 'ASC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.VAR: 'VAR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.JSONB: 'JSONB'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.USE: 'USE'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT128: 'INT128'>, <TokenType.ALL: 'ALL'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TIME: 'TIME'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SOME: 'SOME'>, <TokenType.INT: 'INT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UINT256: 'UINT256'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.CHAR: 'CHAR'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SET: 'SET'>, <TokenType.MAP: 'MAP'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.INT256: 'INT256'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.YEAR: 'YEAR'>, <TokenType.SUPER: 'SUPER'>, <TokenType.UUID: 'UUID'>, <TokenType.CACHE: 'CACHE'>, <TokenType.IPV6: 'IPV6'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.MONEY: 'MONEY'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.MERGE: 'MERGE'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.CASE: 'CASE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.KILL: 'KILL'>, <TokenType.TABLE: 'TABLE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.DIV: 'DIV'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.LIST: 'LIST'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DESC: 'DESC'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.ROWS: 'ROWS'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.NEXT: 'NEXT'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TEXT: 'TEXT'>, <TokenType.TAG: 'TAG'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.NAME: 'NAME'>, <TokenType.IS: 'IS'>, <TokenType.XML: 'XML'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.VIEW: 'VIEW'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.UINT: 'UINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.COPY: 'COPY'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DATE: 'DATE'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.INET: 'INET'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.JSON: 'JSON'>, <TokenType.END: 'END'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.BIT: 'BIT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>}
ALIAS_TOKENS = {<TokenType.BPCHAR: 'BPCHAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.NULL: 'NULL'>, <TokenType.ROW: 'ROW'>, <TokenType.DATE32: 'DATE32'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.IPV4: 'IPV4'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.INDEX: 'INDEX'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.FALSE: 'FALSE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.TOP: 'TOP'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ASOF: 'ASOF'>, <TokenType.MODEL: 'MODEL'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.ASC: 'ASC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.VAR: 'VAR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.JSONB: 'JSONB'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.USE: 'USE'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT128: 'INT128'>, <TokenType.ALL: 'ALL'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TIME: 'TIME'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SOME: 'SOME'>, <TokenType.INT: 'INT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UINT256: 'UINT256'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.LEFT: 'LEFT'>, <TokenType.CHAR: 'CHAR'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SET: 'SET'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.MAP: 'MAP'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.INT256: 'INT256'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.YEAR: 'YEAR'>, <TokenType.SUPER: 'SUPER'>, <TokenType.UUID: 'UUID'>, <TokenType.CACHE: 'CACHE'>, <TokenType.FINAL: 'FINAL'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.IPV6: 'IPV6'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.MONEY: 'MONEY'>, <TokenType.ANTI: 'ANTI'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.MERGE: 'MERGE'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.CASE: 'CASE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.ANY: 'ANY'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.KILL: 'KILL'>, <TokenType.TABLE: 'TABLE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.DIV: 'DIV'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.LIST: 'LIST'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DESC: 'DESC'>, <TokenType.SEMI: 'SEMI'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.FULL: 'FULL'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.NEXT: 'NEXT'>, <TokenType.APPLY: 'APPLY'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TEXT: 'TEXT'>, <TokenType.TAG: 'TAG'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.NAME: 'NAME'>, <TokenType.IS: 'IS'>, <TokenType.XML: 'XML'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.VIEW: 'VIEW'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.UINT: 'UINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.COPY: 'COPY'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DATE: 'DATE'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.INET: 'INET'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.JSON: 'JSON'>, <TokenType.END: 'END'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.BIT: 'BIT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>}
LOG_DEFAULTS_TO_LN = True
QUERY_MODIFIER_PARSERS = {<TokenType.MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'>: <function Parser.<lambda>>, <TokenType.PREWHERE: 'PREWHERE'>: <function Parser.<lambda>>, <TokenType.WHERE: 'WHERE'>: <function Parser.<lambda>>, <TokenType.GROUP_BY: 'GROUP_BY'>: <function Parser.<lambda>>, <TokenType.HAVING: 'HAVING'>: <function Parser.<lambda>>, <TokenType.QUALIFY: 'QUALIFY'>: <function Parser.<lambda>>, <TokenType.WINDOW: 'WINDOW'>: <function Parser.<lambda>>, <TokenType.ORDER_BY: 'ORDER_BY'>: <function Parser.<lambda>>, <TokenType.LIMIT: 'LIMIT'>: <function Parser.<lambda>>, <TokenType.FETCH: 'FETCH'>: <function Parser.<lambda>>, <TokenType.OFFSET: 'OFFSET'>: <function Parser.<lambda>>, <TokenType.FOR: 'FOR'>: <function Parser.<lambda>>, <TokenType.LOCK: 'LOCK'>: <function Parser.<lambda>>, <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>: <function Parser.<lambda>>, <TokenType.USING: 'USING'>: <function Parser.<lambda>>, <TokenType.CLUSTER_BY: 'CLUSTER_BY'>: <function Parser.<lambda>>, <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>: <function Parser.<lambda>>, <TokenType.SORT_BY: 'SORT_BY'>: <function Parser.<lambda>>, <TokenType.CONNECT_BY: 'CONNECT_BY'>: <function Parser.<lambda>>, <TokenType.START_WITH: 'START_WITH'>: <function Parser.<lambda>>, <TokenType.SETTINGS: 'SETTINGS'>: <function ClickHouse.Parser.<lambda>>, <TokenType.FORMAT: 'FORMAT'>: <function ClickHouse.Parser.<lambda>>}
CONSTRAINT_PARSERS = {'AUTOINCREMENT': <function Parser.<lambda>>, 'AUTO_INCREMENT': <function Parser.<lambda>>, 'CASESPECIFIC': <function Parser.<lambda>>, 'CHARACTER SET': <function Parser.<lambda>>, 'CHECK': <function Parser.<lambda>>, 'COLLATE': <function Parser.<lambda>>, 'COMMENT': <function Parser.<lambda>>, 'COMPRESS': <function Parser.<lambda>>, 'CLUSTERED': <function Parser.<lambda>>, 'NONCLUSTERED': <function Parser.<lambda>>, 'DEFAULT': <function Parser.<lambda>>, 'ENCODE': <function Parser.<lambda>>, 'EPHEMERAL': <function Parser.<lambda>>, 'EXCLUDE': <function Parser.<lambda>>, 'FOREIGN KEY': <function Parser.<lambda>>, 'FORMAT': <function Parser.<lambda>>, 'GENERATED': <function Parser.<lambda>>, 'IDENTITY': <function Parser.<lambda>>, 'INLINE': <function Parser.<lambda>>, 'LIKE': <function Parser.<lambda>>, 'NOT': <function Parser.<lambda>>, 'NULL': <function Parser.<lambda>>, 'ON': <function Parser.<lambda>>, 'PATH': <function Parser.<lambda>>, 'PERIOD': <function Parser.<lambda>>, 'PRIMARY KEY': <function Parser.<lambda>>, 'REFERENCES': <function Parser.<lambda>>, 'TITLE': <function Parser.<lambda>>, 'TTL': <function Parser.<lambda>>, 'UNIQUE': <function Parser.<lambda>>, 'UPPERCASE': <function Parser.<lambda>>, 'WITH': <function Parser.<lambda>>, 'INDEX': <function ClickHouse.Parser.<lambda>>, 'CODEC': <function ClickHouse.Parser.<lambda>>}
ALTER_PARSERS = {'ADD': <function Parser.<lambda>>, 'ALTER': <function Parser.<lambda>>, 'CLUSTER BY': <function Parser.<lambda>>, 'DELETE': <function Parser.<lambda>>, 'DROP': <function Parser.<lambda>>, 'RENAME': <function Parser.<lambda>>, 'SET': <function Parser.<lambda>>, 'REPLACE': <function ClickHouse.Parser.<lambda>>}
SCHEMA_UNNAMED_CONSTRAINTS = {'UNIQUE', 'EXCLUDE', 'FOREIGN KEY', 'INDEX', 'CHECK', 'PERIOD', 'LIKE', 'PRIMARY KEY'}
ID_VAR_TOKENS = {<TokenType.BPCHAR: 'BPCHAR'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.NULL: 'NULL'>, <TokenType.ROW: 'ROW'>, <TokenType.DATE32: 'DATE32'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.IPV4: 'IPV4'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.INDEX: 'INDEX'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.FALSE: 'FALSE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.NESTED: 'NESTED'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.TRUE: 'TRUE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.TOP: 'TOP'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ASOF: 'ASOF'>, <TokenType.MODEL: 'MODEL'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.ASC: 'ASC'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.VAR: 'VAR'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.JSONB: 'JSONB'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.USE: 'USE'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT128: 'INT128'>, <TokenType.ALL: 'ALL'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.LOAD: 'LOAD'>, <TokenType.TIME: 'TIME'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BINARY: 'BINARY'>, <TokenType.SOME: 'SOME'>, <TokenType.INT: 'INT'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.UINT256: 'UINT256'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.LEFT: 'LEFT'>, <TokenType.CHAR: 'CHAR'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.SET: 'SET'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.MAP: 'MAP'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.INT256: 'INT256'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.UINT128: 'UINT128'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.YEAR: 'YEAR'>, <TokenType.SUPER: 'SUPER'>, <TokenType.UUID: 'UUID'>, <TokenType.CACHE: 'CACHE'>, <TokenType.FINAL: 'FINAL'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.IPV6: 'IPV6'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.MONEY: 'MONEY'>, <TokenType.ANTI: 'ANTI'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.MERGE: 'MERGE'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.CASE: 'CASE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.ANY: 'ANY'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.KILL: 'KILL'>, <TokenType.TABLE: 'TABLE'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.DIV: 'DIV'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.LIST: 'LIST'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.DESC: 'DESC'>, <TokenType.SEMI: 'SEMI'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.FULL: 'FULL'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.NEXT: 'NEXT'>, <TokenType.APPLY: 'APPLY'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.TEXT: 'TEXT'>, <TokenType.TAG: 'TAG'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.NAME: 'NAME'>, <TokenType.IS: 'IS'>, <TokenType.XML: 'XML'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.KEEP: 'KEEP'>, <TokenType.VIEW: 'VIEW'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.UINT: 'UINT'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.COPY: 'COPY'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.DATE: 'DATE'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.INET: 'INET'>, <TokenType.VECTOR: 'VECTOR'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.JSON: 'JSON'>, <TokenType.END: 'END'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.DELETE: 'DELETE'>, <TokenType.BIT: 'BIT'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>}
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
INTERVAL_VARS
ARRAY_CONSTRUCTORS
COMMENT_TABLE_ALIAS_TOKENS
UPDATE_ALIAS_TOKENS
TRIM_TYPES
CONJUNCTION
ASSIGNMENT
DISJUNCTION
EQUALITY
COMPARISON
BITWISE
TERM
FACTOR
EXPONENT
TIMES
TIMESTAMPS
SET_OPERATIONS
JOIN_METHODS
JOIN_SIDES
JOIN_HINTS
LAMBDAS
EXPRESSION_PARSERS
STATEMENT_PARSERS
UNARY_PARSERS
STRING_PARSERS
NUMERIC_PARSERS
PRIMARY_PARSERS
PLACEHOLDER_PARSERS
PROPERTY_PARSERS
ALTER_ALTER_PARSERS
INVALID_FUNC_NAME_TOKENS
KEY_VALUE_DEFINITIONS
SET_PARSERS
SHOW_PARSERS
TYPE_LITERAL_PARSERS
TYPE_CONVERTERS
DDL_SELECT_TOKENS
PRE_VOLATILE_TOKENS
TRANSACTION_KIND
TRANSACTION_CHARACTERISTICS
CONFLICT_ACTIONS
CREATE_SEQUENCE
ISOLATED_LOADING_OPTIONS
USABLES
CAST_ACTIONS
SCHEMA_BINDING_OPTIONS
INSERT_ALTERNATIVES
CLONE_KEYWORDS
HISTORICAL_DATA_PREFIX
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
COPY_INTO_VARLEN_OPTIONS
STRICT_CAST
PREFIXED_PIVOT_COLUMNS
IDENTIFY_PIVOT_STRINGS
ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
TABLESAMPLE_CSV
DEFAULT_SAMPLING_METHOD
SET_REQUIRES_ASSIGNMENT_DELIMITER
TRIM_PATTERN_FIRST
STRING_ALIASES
SET_OP_MODIFIERS
NO_PAREN_IF_COMMANDS
JSON_ARROWS_REQUIRE_JSON_TYPE
COLON_IS_VARIANT_EXTRACT
VALUES_FOLLOWED_BY_PAREN
SUPPORTS_IMPLICIT_UNNEST
SUPPORTS_PARTITION_SELECTION
error_level
error_message_context
max_errors
dialect
reset
parse
parse_into
check_errors
raise_error
expression
validate_expression
errors
sql
class ClickHouse.Generator(sqlglot.generator.Generator):
687    class Generator(generator.Generator):
688        QUERY_HINTS = False
689        STRUCT_DELIMITER = ("(", ")")
690        NVL2_SUPPORTED = False
691        TABLESAMPLE_REQUIRES_PARENS = False
692        TABLESAMPLE_SIZE_IS_ROWS = False
693        TABLESAMPLE_KEYWORDS = "SAMPLE"
694        LAST_DAY_SUPPORTS_DATE_PART = False
695        CAN_IMPLEMENT_ARRAY_ANY = True
696        SUPPORTS_TO_NUMBER = False
697        JOIN_HINTS = False
698        TABLE_HINTS = False
699        EXPLICIT_SET_OP = True
700        GROUPINGS_SEP = ""
701        SET_OP_MODIFIERS = False
702        SUPPORTS_TABLE_ALIAS_COLUMNS = False
703
704        STRING_TYPE_MAPPING = {
705            exp.DataType.Type.CHAR: "String",
706            exp.DataType.Type.LONGBLOB: "String",
707            exp.DataType.Type.LONGTEXT: "String",
708            exp.DataType.Type.MEDIUMBLOB: "String",
709            exp.DataType.Type.MEDIUMTEXT: "String",
710            exp.DataType.Type.TINYBLOB: "String",
711            exp.DataType.Type.TINYTEXT: "String",
712            exp.DataType.Type.TEXT: "String",
713            exp.DataType.Type.VARBINARY: "String",
714            exp.DataType.Type.VARCHAR: "String",
715        }
716
717        SUPPORTED_JSON_PATH_PARTS = {
718            exp.JSONPathKey,
719            exp.JSONPathRoot,
720            exp.JSONPathSubscript,
721        }
722
723        TYPE_MAPPING = {
724            **generator.Generator.TYPE_MAPPING,
725            **STRING_TYPE_MAPPING,
726            exp.DataType.Type.ARRAY: "Array",
727            exp.DataType.Type.BIGINT: "Int64",
728            exp.DataType.Type.DATE32: "Date32",
729            exp.DataType.Type.DATETIME64: "DateTime64",
730            exp.DataType.Type.DOUBLE: "Float64",
731            exp.DataType.Type.ENUM: "Enum",
732            exp.DataType.Type.ENUM8: "Enum8",
733            exp.DataType.Type.ENUM16: "Enum16",
734            exp.DataType.Type.FIXEDSTRING: "FixedString",
735            exp.DataType.Type.FLOAT: "Float32",
736            exp.DataType.Type.INT: "Int32",
737            exp.DataType.Type.MEDIUMINT: "Int32",
738            exp.DataType.Type.INT128: "Int128",
739            exp.DataType.Type.INT256: "Int256",
740            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
741            exp.DataType.Type.MAP: "Map",
742            exp.DataType.Type.NESTED: "Nested",
743            exp.DataType.Type.NULLABLE: "Nullable",
744            exp.DataType.Type.SMALLINT: "Int16",
745            exp.DataType.Type.STRUCT: "Tuple",
746            exp.DataType.Type.TINYINT: "Int8",
747            exp.DataType.Type.UBIGINT: "UInt64",
748            exp.DataType.Type.UINT: "UInt32",
749            exp.DataType.Type.UINT128: "UInt128",
750            exp.DataType.Type.UINT256: "UInt256",
751            exp.DataType.Type.USMALLINT: "UInt16",
752            exp.DataType.Type.UTINYINT: "UInt8",
753            exp.DataType.Type.IPV4: "IPv4",
754            exp.DataType.Type.IPV6: "IPv6",
755            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
756            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
757        }
758
759        TRANSFORMS = {
760            **generator.Generator.TRANSFORMS,
761            exp.AnyValue: rename_func("any"),
762            exp.ApproxDistinct: rename_func("uniq"),
763            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
764            exp.ArraySize: rename_func("LENGTH"),
765            exp.ArraySum: rename_func("arraySum"),
766            exp.ArgMax: arg_max_or_min_no_count("argMax"),
767            exp.ArgMin: arg_max_or_min_no_count("argMin"),
768            exp.Array: inline_array_sql,
769            exp.CastToStrType: rename_func("CAST"),
770            exp.CountIf: rename_func("countIf"),
771            exp.CompressColumnConstraint: lambda self,
772            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
773            exp.ComputedColumnConstraint: lambda self,
774            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
775            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
776            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
777            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
778            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
779            exp.Explode: rename_func("arrayJoin"),
780            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
781            exp.IsNan: rename_func("isNaN"),
782            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
783            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
784            exp.JSONPathKey: json_path_key_only_name,
785            exp.JSONPathRoot: lambda *_: "",
786            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
787            exp.Nullif: rename_func("nullIf"),
788            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
789            exp.Pivot: no_pivot_sql,
790            exp.Quantile: _quantile_sql,
791            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
792            exp.Rand: rename_func("randCanonical"),
793            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
794            exp.StartsWith: rename_func("startsWith"),
795            exp.StrPosition: lambda self, e: self.func(
796                "position", e.this, e.args.get("substr"), e.args.get("position")
797            ),
798            exp.TimeToStr: lambda self, e: self.func(
799                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
800            ),
801            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
802            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
803            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
804            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
805            exp.MD5Digest: rename_func("MD5"),
806            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
807            exp.SHA: rename_func("SHA1"),
808            exp.SHA2: sha256_sql,
809            exp.UnixToTime: _unix_to_time_sql,
810            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
811            exp.Variance: rename_func("varSamp"),
812            exp.Stddev: rename_func("stddevSamp"),
813        }
814
815        PROPERTIES_LOCATION = {
816            **generator.Generator.PROPERTIES_LOCATION,
817            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
818            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
819            exp.OnCluster: exp.Properties.Location.POST_NAME,
820        }
821
822        # there's no list in docs, but it can be found in Clickhouse code
823        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
824        ON_CLUSTER_TARGETS = {
825            "DATABASE",
826            "TABLE",
827            "VIEW",
828            "DICTIONARY",
829            "INDEX",
830            "FUNCTION",
831            "NAMED COLLECTION",
832        }
833
834        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
835            this = self.json_path_part(expression.this)
836            return str(int(this) + 1) if is_int(this) else this
837
838        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
839            return f"AS {self.sql(expression, 'this')}"
840
841        def _any_to_has(
842            self,
843            expression: exp.EQ | exp.NEQ,
844            default: t.Callable[[t.Any], str],
845            prefix: str = "",
846        ) -> str:
847            if isinstance(expression.left, exp.Any):
848                arr = expression.left
849                this = expression.right
850            elif isinstance(expression.right, exp.Any):
851                arr = expression.right
852                this = expression.left
853            else:
854                return default(expression)
855
856            return prefix + self.func("has", arr.this.unnest(), this)
857
858        def eq_sql(self, expression: exp.EQ) -> str:
859            return self._any_to_has(expression, super().eq_sql)
860
861        def neq_sql(self, expression: exp.NEQ) -> str:
862            return self._any_to_has(expression, super().neq_sql, "NOT ")
863
864        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
865            # Manually add a flag to make the search case-insensitive
866            regex = self.func("CONCAT", "'(?i)'", expression.expression)
867            return self.func("match", expression.this, regex)
868
869        def datatype_sql(self, expression: exp.DataType) -> str:
870            # String is the standard ClickHouse type, every other variant is just an alias.
871            # Additionally, any supplied length parameter will be ignored.
872            #
873            # https://clickhouse.com/docs/en/sql-reference/data-types/string
874            if expression.this in self.STRING_TYPE_MAPPING:
875                return "String"
876
877            return super().datatype_sql(expression)
878
879        def cte_sql(self, expression: exp.CTE) -> str:
880            if expression.args.get("scalar"):
881                this = self.sql(expression, "this")
882                alias = self.sql(expression, "alias")
883                return f"{this} AS {alias}"
884
885            return super().cte_sql(expression)
886
887        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
888            return super().after_limit_modifiers(expression) + [
889                (
890                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
891                    if expression.args.get("settings")
892                    else ""
893                ),
894                (
895                    self.seg("FORMAT ") + self.sql(expression, "format")
896                    if expression.args.get("format")
897                    else ""
898                ),
899            ]
900
901        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
902            params = self.expressions(expression, key="params", flat=True)
903            return self.func(expression.name, *expression.expressions) + f"({params})"
904
905        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
906            return self.func(expression.name, *expression.expressions)
907
908        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
909            return self.anonymousaggfunc_sql(expression)
910
911        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
912            return self.parameterizedagg_sql(expression)
913
914        def placeholder_sql(self, expression: exp.Placeholder) -> str:
915            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
916
917        def oncluster_sql(self, expression: exp.OnCluster) -> str:
918            return f"ON CLUSTER {self.sql(expression, 'this')}"
919
920        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
921            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
922                exp.Properties.Location.POST_NAME
923            ):
924                this_name = self.sql(expression.this, "this")
925                this_properties = " ".join(
926                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
927                )
928                this_schema = self.schema_columns_sql(expression.this)
929                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
930
931            return super().createable_sql(expression, locations)
932
933        def prewhere_sql(self, expression: exp.PreWhere) -> str:
934            this = self.indent(self.sql(expression, "this"))
935            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
936
937        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
938            this = self.sql(expression, "this")
939            this = f" {this}" if this else ""
940            expr = self.sql(expression, "expression")
941            expr = f" {expr}" if expr else ""
942            index_type = self.sql(expression, "index_type")
943            index_type = f" TYPE {index_type}" if index_type else ""
944            granularity = self.sql(expression, "granularity")
945            granularity = f" GRANULARITY {granularity}" if granularity else ""
946
947            return f"INDEX{this}{expr}{index_type}{granularity}"
948
949        def partition_sql(self, expression: exp.Partition) -> str:
950            return f"PARTITION {self.expressions(expression, flat=True)}"
951
952        def partitionid_sql(self, expression: exp.PartitionId) -> str:
953            return f"ID {self.sql(expression.this)}"
954
955        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
956            return (
957                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
958            )
959
960        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
961            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"

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

Arguments:
  • pretty: Whether to format the produced SQL string. Default: False.
  • identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
  • normalize: Whether to normalize identifiers to lowercase. Default: False.
  • pad: The pad size in a formatted string. For example, this affects the indentation of a projection in a query, relative to its nesting level. Default: 2.
  • indent: The indentation size in a formatted string. For example, this affects the indentation of subqueries and filters under a WHERE clause. Default: 2.
  • normalize_functions: How to normalize function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
  • unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
  • max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
  • leading_comma: Whether the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
  • max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
  • comments: Whether to preserve comments in the output SQL code. Default: True
QUERY_HINTS = False
STRUCT_DELIMITER = ('(', ')')
NVL2_SUPPORTED = False
TABLESAMPLE_REQUIRES_PARENS = False
TABLESAMPLE_SIZE_IS_ROWS = False
TABLESAMPLE_KEYWORDS = 'SAMPLE'
LAST_DAY_SUPPORTS_DATE_PART = False
CAN_IMPLEMENT_ARRAY_ANY = True
SUPPORTS_TO_NUMBER = False
JOIN_HINTS = False
TABLE_HINTS = False
EXPLICIT_SET_OP = True
GROUPINGS_SEP = ''
SET_OP_MODIFIERS = False
SUPPORTS_TABLE_ALIAS_COLUMNS = False
STRING_TYPE_MAPPING = {<Type.CHAR: 'CHAR'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String'}
TYPE_MAPPING = {<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.INET: 'INET'>: 'INET', <Type.ROWVERSION: 'ROWVERSION'>: 'VARBINARY', <Type.CHAR: 'CHAR'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String', <Type.ARRAY: 'ARRAY'>: 'Array', <Type.BIGINT: 'BIGINT'>: 'Int64', <Type.DATE32: 'DATE32'>: 'Date32', <Type.DATETIME64: 'DATETIME64'>: 'DateTime64', <Type.DOUBLE: 'DOUBLE'>: 'Float64', <Type.ENUM: 'ENUM'>: 'Enum', <Type.ENUM8: 'ENUM8'>: 'Enum8', <Type.ENUM16: 'ENUM16'>: 'Enum16', <Type.FIXEDSTRING: 'FIXEDSTRING'>: 'FixedString', <Type.FLOAT: 'FLOAT'>: 'Float32', <Type.INT: 'INT'>: 'Int32', <Type.MEDIUMINT: 'MEDIUMINT'>: 'Int32', <Type.INT128: 'INT128'>: 'Int128', <Type.INT256: 'INT256'>: 'Int256', <Type.LOWCARDINALITY: 'LOWCARDINALITY'>: 'LowCardinality', <Type.MAP: 'MAP'>: 'Map', <Type.NESTED: 'NESTED'>: 'Nested', <Type.NULLABLE: 'NULLABLE'>: 'Nullable', <Type.SMALLINT: 'SMALLINT'>: 'Int16', <Type.STRUCT: 'STRUCT'>: 'Tuple', <Type.TINYINT: 'TINYINT'>: 'Int8', <Type.UBIGINT: 'UBIGINT'>: 'UInt64', <Type.UINT: 'UINT'>: 'UInt32', <Type.UINT128: 'UINT128'>: 'UInt128', <Type.UINT256: 'UINT256'>: 'UInt256', <Type.USMALLINT: 'USMALLINT'>: 'UInt16', <Type.UTINYINT: 'UTINYINT'>: 'UInt8', <Type.IPV4: 'IPV4'>: 'IPv4', <Type.IPV6: 'IPV6'>: 'IPv6', <Type.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>: 'AggregateFunction', <Type.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>: 'SimpleAggregateFunction'}
TRANSFORMS = {<class 'sqlglot.expressions.JSONPathKey'>: <function json_path_key_only_name>, <class 'sqlglot.expressions.JSONPathRoot'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.AllowedValuesProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.BackupProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CommentColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ConnectByRoot'>: <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.DynamicProperty'>: <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.ProjectionPolicyColumnConstraint'>: <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.SecureProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetConfigProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SettingsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SharingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StabilityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StrictProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TagColumnConstraint'>: <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.WithSchemaBindingProperty'>: <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 _datetime_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.DateDiff'>: <function _datetime_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.DateSub'>: <function _datetime_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.TimestampAdd'>: <function _datetime_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.TimestampSub'>: <function _datetime_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.Xor'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.MD5Digest'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.MD5'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.SHA'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.SHA2'>: <function sha256_sql>, <class 'sqlglot.expressions.UnixToTime'>: <function _unix_to_time_sql>, <class 'sqlglot.expressions.TimestampTrunc'>: <function timestamptrunc_sql.<locals>._timestamptrunc_sql>, <class 'sqlglot.expressions.Variance'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Stddev'>: <function rename_func.<locals>.<lambda>>}
PROPERTIES_LOCATION = {<class 'sqlglot.expressions.AllowedValuesProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AlgorithmProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.AutoIncrementProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BackupProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BlockCompressionProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CharacterSetProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ChecksumProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CollateProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Cluster'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ClusteredByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DataBlocksizeProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.DataDeletionProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DefinerProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.DictRange'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DictProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DynamicProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <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.SecureProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.SerdeProperties'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Set'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SettingsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SetProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.SetConfigProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SharingProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SequenceProperties'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SortKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.StabilityProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.StrictProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TemporaryProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ToTableProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TransientProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.TransformModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.MergeTreeTTL'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.UnloggedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ViewAttributeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.VolatileProperty'>: <Location.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.WithDataProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.WithSchemaBindingProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.WithSystemVersioningProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCluster'>: <Location.POST_NAME: 'POST_NAME'>}
ON_CLUSTER_TARGETS = {'FUNCTION', 'DICTIONARY', 'NAMED COLLECTION', 'INDEX', 'TABLE', 'DATABASE', 'VIEW'}
def likeproperty_sql(self, expression: sqlglot.expressions.LikeProperty) -> str:
838        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
839            return f"AS {self.sql(expression, 'this')}"
def eq_sql(self, expression: sqlglot.expressions.EQ) -> str:
858        def eq_sql(self, expression: exp.EQ) -> str:
859            return self._any_to_has(expression, super().eq_sql)
def neq_sql(self, expression: sqlglot.expressions.NEQ) -> str:
861        def neq_sql(self, expression: exp.NEQ) -> str:
862            return self._any_to_has(expression, super().neq_sql, "NOT ")
def regexpilike_sql(self, expression: sqlglot.expressions.RegexpILike) -> str:
864        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
865            # Manually add a flag to make the search case-insensitive
866            regex = self.func("CONCAT", "'(?i)'", expression.expression)
867            return self.func("match", expression.this, regex)
def datatype_sql(self, expression: sqlglot.expressions.DataType) -> str:
869        def datatype_sql(self, expression: exp.DataType) -> str:
870            # String is the standard ClickHouse type, every other variant is just an alias.
871            # Additionally, any supplied length parameter will be ignored.
872            #
873            # https://clickhouse.com/docs/en/sql-reference/data-types/string
874            if expression.this in self.STRING_TYPE_MAPPING:
875                return "String"
876
877            return super().datatype_sql(expression)
def cte_sql(self, expression: sqlglot.expressions.CTE) -> str:
879        def cte_sql(self, expression: exp.CTE) -> str:
880            if expression.args.get("scalar"):
881                this = self.sql(expression, "this")
882                alias = self.sql(expression, "alias")
883                return f"{this} AS {alias}"
884
885            return super().cte_sql(expression)
def after_limit_modifiers(self, expression: sqlglot.expressions.Expression) -> List[str]:
887        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
888            return super().after_limit_modifiers(expression) + [
889                (
890                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
891                    if expression.args.get("settings")
892                    else ""
893                ),
894                (
895                    self.seg("FORMAT ") + self.sql(expression, "format")
896                    if expression.args.get("format")
897                    else ""
898                ),
899            ]
def parameterizedagg_sql(self, expression: sqlglot.expressions.ParameterizedAgg) -> str:
901        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
902            params = self.expressions(expression, key="params", flat=True)
903            return self.func(expression.name, *expression.expressions) + f"({params})"
def anonymousaggfunc_sql(self, expression: sqlglot.expressions.AnonymousAggFunc) -> str:
905        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
906            return self.func(expression.name, *expression.expressions)
def combinedaggfunc_sql(self, expression: sqlglot.expressions.CombinedAggFunc) -> str:
908        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
909            return self.anonymousaggfunc_sql(expression)
def combinedparameterizedagg_sql(self, expression: sqlglot.expressions.CombinedParameterizedAgg) -> str:
911        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
912            return self.parameterizedagg_sql(expression)
def placeholder_sql(self, expression: sqlglot.expressions.Placeholder) -> str:
914        def placeholder_sql(self, expression: exp.Placeholder) -> str:
915            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
def oncluster_sql(self, expression: sqlglot.expressions.OnCluster) -> str:
917        def oncluster_sql(self, expression: exp.OnCluster) -> str:
918            return f"ON CLUSTER {self.sql(expression, 'this')}"
def createable_sql( self, expression: sqlglot.expressions.Create, locations: DefaultDict) -> str:
920        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
921            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
922                exp.Properties.Location.POST_NAME
923            ):
924                this_name = self.sql(expression.this, "this")
925                this_properties = " ".join(
926                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
927                )
928                this_schema = self.schema_columns_sql(expression.this)
929                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
930
931            return super().createable_sql(expression, locations)
def prewhere_sql(self, expression: sqlglot.expressions.PreWhere) -> str:
933        def prewhere_sql(self, expression: exp.PreWhere) -> str:
934            this = self.indent(self.sql(expression, "this"))
935            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
def indexcolumnconstraint_sql(self, expression: sqlglot.expressions.IndexColumnConstraint) -> str:
937        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
938            this = self.sql(expression, "this")
939            this = f" {this}" if this else ""
940            expr = self.sql(expression, "expression")
941            expr = f" {expr}" if expr else ""
942            index_type = self.sql(expression, "index_type")
943            index_type = f" TYPE {index_type}" if index_type else ""
944            granularity = self.sql(expression, "granularity")
945            granularity = f" GRANULARITY {granularity}" if granularity else ""
946
947            return f"INDEX{this}{expr}{index_type}{granularity}"
def partition_sql(self, expression: sqlglot.expressions.Partition) -> str:
949        def partition_sql(self, expression: exp.Partition) -> str:
950            return f"PARTITION {self.expressions(expression, flat=True)}"
def partitionid_sql(self, expression: sqlglot.expressions.PartitionId) -> str:
952        def partitionid_sql(self, expression: exp.PartitionId) -> str:
953            return f"ID {self.sql(expression.this)}"
def replacepartition_sql(self, expression: sqlglot.expressions.ReplacePartition) -> str:
955        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
956            return (
957                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
958            )
def projectiondef_sql(self, expression: sqlglot.expressions.ProjectionDef) -> str:
960        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
961            return f"PROJECTION {self.sql(expression.this)} {self.wrap(expression.expression)}"
SELECT_KINDS: Tuple[str, ...] = ()
TRY_SUPPORTED = False
SUPPORTS_UESCAPE = False
AFTER_HAVING_MODIFIER_TRANSFORMS = {'qualify': <function Generator.<lambda>>, 'windows': <function Generator.<lambda>>}
Inherited Members
sqlglot.generator.Generator
Generator
NULL_ORDERING_SUPPORTED
IGNORE_NULLS_IN_FUNC
LOCKING_READS_SUPPORTED
WRAP_DERIVED_VALUES
CREATE_FUNCTION_RETURN_AS
MATCHED_BY_SOURCE
SINGLE_STRING_INTERVAL
INTERVAL_ALLOWS_PLURAL_FORM
LIMIT_FETCH
LIMIT_ONLY_LITERALS
RENAME_TABLE_WITH_DB
INDEX_ON
QUERY_HINT_SEP
IS_BOOL_ALLOWED
DUPLICATE_KEY_UPDATE_WITH_SET
LIMIT_IS_TOP
RETURNING_END
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
UNPIVOT_ALIASES_ARE_IDENTIFIERS
JSON_KEY_VALUE_PAIR_SEP
INSERT_OVERWRITE
SUPPORTS_SELECT_INTO
SUPPORTS_UNLOGGED_TABLES
SUPPORTS_CREATE_TABLE_LIKE
LIKE_PROPERTY_INSIDE_SCHEMA
MULTI_ARG_DISTINCT
JSON_TYPE_REQUIRED_FOR_EXTRACTION
JSON_PATH_BRACKETED_KEY_SUPPORTED
JSON_PATH_SINGLE_QUOTE_ESCAPE
COPY_PARAMS_ARE_WRAPPED
COPY_PARAMS_EQ_REQUIRED
COPY_HAS_INTO_KEYWORD
STAR_EXCEPT
HEX_FUNC
WITH_PROPERTIES_PREFIX
QUOTE_JSON_PATH
PARSE_JSON_NAME
TIME_PART_SINGULARS
TOKEN_MAPPING
PARAMETER_TOKEN
NAMED_PLACEHOLDER_TOKEN
RESERVED_KEYWORDS
WITH_SEPARATED_COMMENTS
EXCLUDE_COMMENTS
UNWRAPPED_INTERVAL_VALUES
PARAMETERIZABLE_TEXT_TYPES
EXPRESSIONS_WITHOUT_NESTED_CTES
SENTINEL_LINE_BREAK
pretty
identify
normalize
pad
unsupported_level
max_unsupported
leading_comma
max_text_width
comments
dialect
normalize_functions
unsupported_messages
generate
preprocess
unsupported
sep
seg
pad_comment
maybe_comment
wrap
no_identify
normalize_func
indent
sql
uncache_sql
cache_sql
characterset_sql
column_parts
column_sql
columnposition_sql
columndef_sql
columnconstraint_sql
computedcolumnconstraint_sql
autoincrementcolumnconstraint_sql
compresscolumnconstraint_sql
generatedasidentitycolumnconstraint_sql
generatedasrowcolumnconstraint_sql
periodforsystemtimeconstraint_sql
notnullcolumnconstraint_sql
transformcolumnconstraint_sql
primarykeycolumnconstraint_sql
uniquecolumnconstraint_sql
create_sql
sequenceproperties_sql
clone_sql
describe_sql
heredoc_sql
prepend_ctes
with_sql
tablealias_sql
bitstring_sql
hexstring_sql
bytestring_sql
unicodestring_sql
rawstring_sql
datatypeparam_sql
directory_sql
delete_sql
drop_sql
except_sql
except_op
fetch_sql
filter_sql
hint_sql
indexparameters_sql
index_sql
identifier_sql
hex_sql
lowerhex_sql
inputoutputformat_sql
national_sql
properties_sql
root_properties
properties
with_properties
locate_properties
property_name
property_sql
fallbackproperty_sql
journalproperty_sql
freespaceproperty_sql
checksumproperty_sql
mergeblockratioproperty_sql
datablocksizeproperty_sql
blockcompressionproperty_sql
isolatedloadingproperty_sql
partitionboundspec_sql
partitionedofproperty_sql
lockingproperty_sql
withdataproperty_sql
withsystemversioningproperty_sql
insert_sql
intersect_sql
intersect_op
introducer_sql
kill_sql
pseudotype_sql
objectidentifier_sql
onconflict_sql
returning_sql
rowformatdelimitedproperty_sql
withtablehint_sql
indextablehint_sql
historicaldata_sql
table_parts
table_sql
tablesample_sql
pivot_sql
version_sql
tuple_sql
update_sql
values_sql
var_sql
into_sql
from_sql
group_sql
having_sql
connect_sql
prior_sql
join_sql
lambda_sql
lateral_op
lateral_sql
limit_sql
offset_sql
setitem_sql
set_sql
pragma_sql
lock_sql
literal_sql
escape_str
loaddata_sql
null_sql
boolean_sql
order_sql
withfill_sql
cluster_sql
distribute_sql
sort_sql
ordered_sql
matchrecognizemeasure_sql
matchrecognize_sql
query_modifiers
options_modifier
queryoption_sql
offset_limit_modifiers
select_sql
schema_sql
schema_columns_sql
star_sql
parameter_sql
sessionparameter_sql
subquery_sql
qualify_sql
set_operations
union_sql
union_op
unnest_sql
where_sql
window_sql
partition_by_sql
windowspec_sql
withingroup_sql
between_sql
bracket_offset_expressions
bracket_sql
all_sql
any_sql
exists_sql
case_sql
constraint_sql
nextvaluefor_sql
extract_sql
trim_sql
convert_concat_args
concat_sql
concatws_sql
check_sql
foreignkey_sql
primarykey_sql
if_sql
matchagainst_sql
jsonkeyvalue_sql
jsonpath_sql
json_path_part
formatjson_sql
jsonobject_sql
jsonobjectagg_sql
jsonarray_sql
jsonarrayagg_sql
jsoncolumndef_sql
jsonschema_sql
jsontable_sql
openjsoncolumndef_sql
openjson_sql
in_sql
in_unnest_op
interval_sql
return_sql
reference_sql
anonymous_sql
paren_sql
neg_sql
not_sql
alias_sql
pivotalias_sql
aliases_sql
atindex_sql
attimezone_sql
fromtimezone_sql
add_sql
and_sql
or_sql
xor_sql
connector_sql
bitwiseand_sql
bitwiseleftshift_sql
bitwisenot_sql
bitwiseor_sql
bitwiserightshift_sql
bitwisexor_sql
cast_sql
currentdate_sql
currenttimestamp_sql
collate_sql
command_sql
comment_sql
mergetreettlaction_sql
mergetreettl_sql
transaction_sql
commit_sql
rollback_sql
altercolumn_sql
alterdiststyle_sql
altersortkey_sql
renametable_sql
renamecolumn_sql
alterset_sql
altertable_sql
add_column_sql
droppartition_sql
addconstraint_sql
distinct_sql
ignorenulls_sql
respectnulls_sql
havingmax_sql
intdiv_sql
dpipe_sql
div_sql
overlaps_sql
distance_sql
dot_sql
propertyeq_sql
escape_sql
glob_sql
gt_sql
gte_sql
ilike_sql
ilikeany_sql
is_sql
like_sql
likeany_sql
similarto_sql
lt_sql
lte_sql
mod_sql
mul_sql
nullsafeeq_sql
nullsafeneq_sql
slice_sql
sub_sql
trycast_sql
try_sql
log_sql
use_sql
binary
function_fallback_sql
func
format_args
too_wide
format_time
expressions
op_expressions
naked_property
tag_sql
token_sql
userdefinedfunction_sql
joinhint_sql
kwarg_sql
when_sql
merge_sql
tochar_sql
tonumber_sql
dictproperty_sql
dictrange_sql
dictsubproperty_sql
clusteredbyproperty_sql
anyvalue_sql
querytransform_sql
indexconstraintoption_sql
checkcolumnconstraint_sql
nvl2_sql
comprehension_sql
columnprefix_sql
opclass_sql
predict_sql
forin_sql
refresh_sql
operator_sql
toarray_sql
tsordstotime_sql
tsordstotimestamp_sql
tsordstodate_sql
unixdate_sql
lastday_sql
dateadd_sql
arrayany_sql
generateseries_sql
struct_sql
partitionrange_sql
truncatetable_sql
convert_sql
copyparameter_sql
credentials_sql
copy_sql
semicolon_sql
datadeletionproperty_sql
maskingpolicycolumnconstraint_sql
gapfill_sql
scope_resolution
scoperesolution_sql
parsejson_sql
length_sql
rand_sql
strtodate_sql
strtotime_sql
changes_sql