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            "EXTRACT": exp.RegexpExtract.from_arg_list,
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("EXTRACT")
351        FUNCTION_PARSERS.pop("MATCH")
352
353        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
354        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
355
356        RANGE_PARSERS = {
357            **parser.Parser.RANGE_PARSERS,
358            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
359            and self._parse_in(this, is_global=True),
360        }
361
362        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
363        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
364        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
365        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
366
367        JOIN_KINDS = {
368            *parser.Parser.JOIN_KINDS,
369            TokenType.ANY,
370            TokenType.ASOF,
371            TokenType.ARRAY,
372        }
373
374        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
375            TokenType.ANY,
376            TokenType.ARRAY,
377            TokenType.FINAL,
378            TokenType.FORMAT,
379            TokenType.SETTINGS,
380        }
381
382        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
383            TokenType.FORMAT,
384        }
385
386        LOG_DEFAULTS_TO_LN = True
387
388        QUERY_MODIFIER_PARSERS = {
389            **parser.Parser.QUERY_MODIFIER_PARSERS,
390            TokenType.SETTINGS: lambda self: (
391                "settings",
392                self._advance() or self._parse_csv(self._parse_assignment),
393            ),
394            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
395        }
396
397        CONSTRAINT_PARSERS = {
398            **parser.Parser.CONSTRAINT_PARSERS,
399            "INDEX": lambda self: self._parse_index_constraint(),
400            "CODEC": lambda self: self._parse_compress(),
401        }
402
403        ALTER_PARSERS = {
404            **parser.Parser.ALTER_PARSERS,
405            "REPLACE": lambda self: self._parse_alter_table_replace(),
406        }
407
408        SCHEMA_UNNAMED_CONSTRAINTS = {
409            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
410            "INDEX",
411        }
412
413        def _parse_assignment(self) -> t.Optional[exp.Expression]:
414            this = super()._parse_assignment()
415
416            if self._match(TokenType.PLACEHOLDER):
417                return self.expression(
418                    exp.If,
419                    this=this,
420                    true=self._parse_assignment(),
421                    false=self._match(TokenType.COLON) and self._parse_assignment(),
422                )
423
424            return this
425
426        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
427            """
428            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
429            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
430            """
431            if not self._match(TokenType.L_BRACE):
432                return None
433
434            this = self._parse_id_var()
435            self._match(TokenType.COLON)
436            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
437                self._match_text_seq("IDENTIFIER") and "Identifier"
438            )
439
440            if not kind:
441                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
442            elif not self._match(TokenType.R_BRACE):
443                self.raise_error("Expecting }")
444
445            return self.expression(exp.Placeholder, this=this, kind=kind)
446
447        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
448            this = super()._parse_in(this)
449            this.set("is_global", is_global)
450            return this
451
452        def _parse_table(
453            self,
454            schema: bool = False,
455            joins: bool = False,
456            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
457            parse_bracket: bool = False,
458            is_db_reference: bool = False,
459            parse_partition: bool = False,
460        ) -> t.Optional[exp.Expression]:
461            this = super()._parse_table(
462                schema=schema,
463                joins=joins,
464                alias_tokens=alias_tokens,
465                parse_bracket=parse_bracket,
466                is_db_reference=is_db_reference,
467            )
468
469            if self._match(TokenType.FINAL):
470                this = self.expression(exp.Final, this=this)
471
472            return this
473
474        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
475            return super()._parse_position(haystack_first=True)
476
477        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
478        def _parse_cte(self) -> exp.CTE:
479            # WITH <identifier> AS <subquery expression>
480            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
481
482            if not cte:
483                # WITH <expression> AS <identifier>
484                cte = self.expression(
485                    exp.CTE,
486                    this=self._parse_assignment(),
487                    alias=self._parse_table_alias(),
488                    scalar=True,
489                )
490
491            return cte
492
493        def _parse_join_parts(
494            self,
495        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
496            is_global = self._match(TokenType.GLOBAL) and self._prev
497            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
498
499            if kind_pre:
500                kind = self._match_set(self.JOIN_KINDS) and self._prev
501                side = self._match_set(self.JOIN_SIDES) and self._prev
502                return is_global, side, kind
503
504            return (
505                is_global,
506                self._match_set(self.JOIN_SIDES) and self._prev,
507                self._match_set(self.JOIN_KINDS) and self._prev,
508            )
509
510        def _parse_join(
511            self, skip_join_token: bool = False, parse_bracket: bool = False
512        ) -> t.Optional[exp.Join]:
513            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
514            if join:
515                join.set("global", join.args.pop("method", None))
516
517            return join
518
519        def _parse_function(
520            self,
521            functions: t.Optional[t.Dict[str, t.Callable]] = None,
522            anonymous: bool = False,
523            optional_parens: bool = True,
524            any_token: bool = False,
525        ) -> t.Optional[exp.Expression]:
526            expr = super()._parse_function(
527                functions=functions,
528                anonymous=anonymous,
529                optional_parens=optional_parens,
530                any_token=any_token,
531            )
532
533            func = expr.this if isinstance(expr, exp.Window) else expr
534
535            # Aggregate functions can be split in 2 parts: <func_name><suffix>
536            parts = (
537                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
538            )
539
540            if parts:
541                params = self._parse_func_params(func)
542
543                kwargs = {
544                    "this": func.this,
545                    "expressions": func.expressions,
546                }
547                if parts[1]:
548                    kwargs["parts"] = parts
549                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
550                else:
551                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
552
553                kwargs["exp_class"] = exp_class
554                if params:
555                    kwargs["params"] = params
556
557                func = self.expression(**kwargs)
558
559                if isinstance(expr, exp.Window):
560                    # The window's func was parsed as Anonymous in base parser, fix its
561                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
562                    expr.set("this", func)
563                elif params:
564                    # Params have blocked super()._parse_function() from parsing the following window
565                    # (if that exists) as they're standing between the function call and the window spec
566                    expr = self._parse_window(func)
567                else:
568                    expr = func
569
570            return expr
571
572        def _parse_func_params(
573            self, this: t.Optional[exp.Func] = None
574        ) -> t.Optional[t.List[exp.Expression]]:
575            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
576                return self._parse_csv(self._parse_lambda)
577
578            if self._match(TokenType.L_PAREN):
579                params = self._parse_csv(self._parse_lambda)
580                self._match_r_paren(this)
581                return params
582
583            return None
584
585        def _parse_quantile(self) -> exp.Quantile:
586            this = self._parse_lambda()
587            params = self._parse_func_params()
588            if params:
589                return self.expression(exp.Quantile, this=params[0], quantile=this)
590            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
591
592        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
593            return super()._parse_wrapped_id_vars(optional=True)
594
595        def _parse_primary_key(
596            self, wrapped_optional: bool = False, in_props: bool = False
597        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
598            return super()._parse_primary_key(
599                wrapped_optional=wrapped_optional or in_props, in_props=in_props
600            )
601
602        def _parse_on_property(self) -> t.Optional[exp.Expression]:
603            index = self._index
604            if self._match_text_seq("CLUSTER"):
605                this = self._parse_id_var()
606                if this:
607                    return self.expression(exp.OnCluster, this=this)
608                else:
609                    self._retreat(index)
610            return None
611
612        def _parse_index_constraint(
613            self, kind: t.Optional[str] = None
614        ) -> exp.IndexColumnConstraint:
615            # INDEX name1 expr TYPE type1(args) GRANULARITY value
616            this = self._parse_id_var()
617            expression = self._parse_assignment()
618
619            index_type = self._match_text_seq("TYPE") and (
620                self._parse_function() or self._parse_var()
621            )
622
623            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
624
625            return self.expression(
626                exp.IndexColumnConstraint,
627                this=this,
628                expression=expression,
629                index_type=index_type,
630                granularity=granularity,
631            )
632
633        def _parse_partition(self) -> t.Optional[exp.Partition]:
634            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
635            if not self._match(TokenType.PARTITION):
636                return None
637
638            if self._match_text_seq("ID"):
639                # Corresponds to the PARTITION ID <string_value> syntax
640                expressions: t.List[exp.Expression] = [
641                    self.expression(exp.PartitionId, this=self._parse_string())
642                ]
643            else:
644                expressions = self._parse_expressions()
645
646            return self.expression(exp.Partition, expressions=expressions)
647
648        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
649            partition = self._parse_partition()
650
651            if not partition or not self._match(TokenType.FROM):
652                return None
653
654            return self.expression(
655                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
656            )
657
658        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
659            if not self._match_text_seq("PROJECTION"):
660                return None
661
662            return self.expression(
663                exp.ProjectionDef,
664                this=self._parse_id_var(),
665                expression=self._parse_wrapped(self._parse_statement),
666            )
667
668        def _parse_constraint(self) -> t.Optional[exp.Expression]:
669            return super()._parse_constraint() or self._parse_projection_def()
670
671    class Generator(generator.Generator):
672        QUERY_HINTS = False
673        STRUCT_DELIMITER = ("(", ")")
674        NVL2_SUPPORTED = False
675        TABLESAMPLE_REQUIRES_PARENS = False
676        TABLESAMPLE_SIZE_IS_ROWS = False
677        TABLESAMPLE_KEYWORDS = "SAMPLE"
678        LAST_DAY_SUPPORTS_DATE_PART = False
679        CAN_IMPLEMENT_ARRAY_ANY = True
680        SUPPORTS_TO_NUMBER = False
681        JOIN_HINTS = False
682        TABLE_HINTS = False
683        EXPLICIT_SET_OP = True
684        GROUPINGS_SEP = ""
685        SET_OP_MODIFIERS = False
686
687        STRING_TYPE_MAPPING = {
688            exp.DataType.Type.CHAR: "String",
689            exp.DataType.Type.LONGBLOB: "String",
690            exp.DataType.Type.LONGTEXT: "String",
691            exp.DataType.Type.MEDIUMBLOB: "String",
692            exp.DataType.Type.MEDIUMTEXT: "String",
693            exp.DataType.Type.TINYBLOB: "String",
694            exp.DataType.Type.TINYTEXT: "String",
695            exp.DataType.Type.TEXT: "String",
696            exp.DataType.Type.VARBINARY: "String",
697            exp.DataType.Type.VARCHAR: "String",
698        }
699
700        SUPPORTED_JSON_PATH_PARTS = {
701            exp.JSONPathKey,
702            exp.JSONPathRoot,
703            exp.JSONPathSubscript,
704        }
705
706        TYPE_MAPPING = {
707            **generator.Generator.TYPE_MAPPING,
708            **STRING_TYPE_MAPPING,
709            exp.DataType.Type.ARRAY: "Array",
710            exp.DataType.Type.BIGINT: "Int64",
711            exp.DataType.Type.DATE32: "Date32",
712            exp.DataType.Type.DATETIME64: "DateTime64",
713            exp.DataType.Type.DOUBLE: "Float64",
714            exp.DataType.Type.ENUM: "Enum",
715            exp.DataType.Type.ENUM8: "Enum8",
716            exp.DataType.Type.ENUM16: "Enum16",
717            exp.DataType.Type.FIXEDSTRING: "FixedString",
718            exp.DataType.Type.FLOAT: "Float32",
719            exp.DataType.Type.INT: "Int32",
720            exp.DataType.Type.MEDIUMINT: "Int32",
721            exp.DataType.Type.INT128: "Int128",
722            exp.DataType.Type.INT256: "Int256",
723            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
724            exp.DataType.Type.MAP: "Map",
725            exp.DataType.Type.NESTED: "Nested",
726            exp.DataType.Type.NULLABLE: "Nullable",
727            exp.DataType.Type.SMALLINT: "Int16",
728            exp.DataType.Type.STRUCT: "Tuple",
729            exp.DataType.Type.TINYINT: "Int8",
730            exp.DataType.Type.UBIGINT: "UInt64",
731            exp.DataType.Type.UINT: "UInt32",
732            exp.DataType.Type.UINT128: "UInt128",
733            exp.DataType.Type.UINT256: "UInt256",
734            exp.DataType.Type.USMALLINT: "UInt16",
735            exp.DataType.Type.UTINYINT: "UInt8",
736            exp.DataType.Type.IPV4: "IPv4",
737            exp.DataType.Type.IPV6: "IPv6",
738            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
739            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
740        }
741
742        TRANSFORMS = {
743            **generator.Generator.TRANSFORMS,
744            exp.AnyValue: rename_func("any"),
745            exp.ApproxDistinct: rename_func("uniq"),
746            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
747            exp.ArraySize: rename_func("LENGTH"),
748            exp.ArraySum: rename_func("arraySum"),
749            exp.ArgMax: arg_max_or_min_no_count("argMax"),
750            exp.ArgMin: arg_max_or_min_no_count("argMin"),
751            exp.Array: inline_array_sql,
752            exp.CastToStrType: rename_func("CAST"),
753            exp.CountIf: rename_func("countIf"),
754            exp.CompressColumnConstraint: lambda self,
755            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
756            exp.ComputedColumnConstraint: lambda self,
757            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
758            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
759            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
760            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
761            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
762            exp.Explode: rename_func("arrayJoin"),
763            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
764            exp.IsNan: rename_func("isNaN"),
765            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
766            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
767            exp.JSONPathKey: json_path_key_only_name,
768            exp.JSONPathRoot: lambda *_: "",
769            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
770            exp.Nullif: rename_func("nullIf"),
771            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
772            exp.Pivot: no_pivot_sql,
773            exp.Quantile: _quantile_sql,
774            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
775            exp.Rand: rename_func("randCanonical"),
776            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
777            exp.StartsWith: rename_func("startsWith"),
778            exp.StrPosition: lambda self, e: self.func(
779                "position", e.this, e.args.get("substr"), e.args.get("position")
780            ),
781            exp.TimeToStr: lambda self, e: self.func(
782                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
783            ),
784            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
785            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
786            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
787            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
788            exp.MD5Digest: rename_func("MD5"),
789            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
790            exp.SHA: rename_func("SHA1"),
791            exp.SHA2: sha256_sql,
792            exp.UnixToTime: _unix_to_time_sql,
793            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
794            exp.Variance: rename_func("varSamp"),
795            exp.Stddev: rename_func("stddevSamp"),
796        }
797
798        PROPERTIES_LOCATION = {
799            **generator.Generator.PROPERTIES_LOCATION,
800            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
801            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
802            exp.OnCluster: exp.Properties.Location.POST_NAME,
803        }
804
805        # there's no list in docs, but it can be found in Clickhouse code
806        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
807        ON_CLUSTER_TARGETS = {
808            "DATABASE",
809            "TABLE",
810            "VIEW",
811            "DICTIONARY",
812            "INDEX",
813            "FUNCTION",
814            "NAMED COLLECTION",
815        }
816
817        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
818            this = self.json_path_part(expression.this)
819            return str(int(this) + 1) if is_int(this) else this
820
821        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
822            return f"AS {self.sql(expression, 'this')}"
823
824        def _any_to_has(
825            self,
826            expression: exp.EQ | exp.NEQ,
827            default: t.Callable[[t.Any], str],
828            prefix: str = "",
829        ) -> str:
830            if isinstance(expression.left, exp.Any):
831                arr = expression.left
832                this = expression.right
833            elif isinstance(expression.right, exp.Any):
834                arr = expression.right
835                this = expression.left
836            else:
837                return default(expression)
838
839            return prefix + self.func("has", arr.this.unnest(), this)
840
841        def eq_sql(self, expression: exp.EQ) -> str:
842            return self._any_to_has(expression, super().eq_sql)
843
844        def neq_sql(self, expression: exp.NEQ) -> str:
845            return self._any_to_has(expression, super().neq_sql, "NOT ")
846
847        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
848            # Manually add a flag to make the search case-insensitive
849            regex = self.func("CONCAT", "'(?i)'", expression.expression)
850            return self.func("match", expression.this, regex)
851
852        def datatype_sql(self, expression: exp.DataType) -> str:
853            # String is the standard ClickHouse type, every other variant is just an alias.
854            # Additionally, any supplied length parameter will be ignored.
855            #
856            # https://clickhouse.com/docs/en/sql-reference/data-types/string
857            if expression.this in self.STRING_TYPE_MAPPING:
858                return "String"
859
860            return super().datatype_sql(expression)
861
862        def cte_sql(self, expression: exp.CTE) -> str:
863            if expression.args.get("scalar"):
864                this = self.sql(expression, "this")
865                alias = self.sql(expression, "alias")
866                return f"{this} AS {alias}"
867
868            return super().cte_sql(expression)
869
870        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
871            return super().after_limit_modifiers(expression) + [
872                (
873                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
874                    if expression.args.get("settings")
875                    else ""
876                ),
877                (
878                    self.seg("FORMAT ") + self.sql(expression, "format")
879                    if expression.args.get("format")
880                    else ""
881                ),
882            ]
883
884        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
885            params = self.expressions(expression, key="params", flat=True)
886            return self.func(expression.name, *expression.expressions) + f"({params})"
887
888        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
889            return self.func(expression.name, *expression.expressions)
890
891        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
892            return self.anonymousaggfunc_sql(expression)
893
894        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
895            return self.parameterizedagg_sql(expression)
896
897        def placeholder_sql(self, expression: exp.Placeholder) -> str:
898            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
899
900        def oncluster_sql(self, expression: exp.OnCluster) -> str:
901            return f"ON CLUSTER {self.sql(expression, 'this')}"
902
903        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
904            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
905                exp.Properties.Location.POST_NAME
906            ):
907                this_name = self.sql(expression.this, "this")
908                this_properties = " ".join(
909                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
910                )
911                this_schema = self.schema_columns_sql(expression.this)
912                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
913
914            return super().createable_sql(expression, locations)
915
916        def prewhere_sql(self, expression: exp.PreWhere) -> str:
917            this = self.indent(self.sql(expression, "this"))
918            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
919
920        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
921            this = self.sql(expression, "this")
922            this = f" {this}" if this else ""
923            expr = self.sql(expression, "expression")
924            expr = f" {expr}" if expr else ""
925            index_type = self.sql(expression, "index_type")
926            index_type = f" TYPE {index_type}" if index_type else ""
927            granularity = self.sql(expression, "granularity")
928            granularity = f" GRANULARITY {granularity}" if granularity else ""
929
930            return f"INDEX{this}{expr}{index_type}{granularity}"
931
932        def partition_sql(self, expression: exp.Partition) -> str:
933            return f"PARTITION {self.expressions(expression, flat=True)}"
934
935        def partitionid_sql(self, expression: exp.PartitionId) -> str:
936            return f"ID {self.sql(expression.this)}"
937
938        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
939            return (
940                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
941            )
942
943        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
944            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            "EXTRACT": exp.RegexpExtract.from_arg_list,
179            "FORMATDATETIME": _build_date_format,
180            "JSONEXTRACTSTRING": build_json_extract_path(
181                exp.JSONExtractScalar, zero_based_indexing=False
182            ),
183            "MAP": parser.build_var_map,
184            "MATCH": exp.RegexpLike.from_arg_list,
185            "RANDCANONICAL": exp.Rand.from_arg_list,
186            "TUPLE": exp.Struct.from_arg_list,
187            "TIMESTAMP_SUB": build_date_delta(exp.TimestampSub, default_unit=None),
188            "TIMESTAMPSUB": build_date_delta(exp.TimestampSub, default_unit=None),
189            "TIMESTAMP_ADD": build_date_delta(exp.TimestampAdd, default_unit=None),
190            "TIMESTAMPADD": build_date_delta(exp.TimestampAdd, default_unit=None),
191            "UNIQ": exp.ApproxDistinct.from_arg_list,
192            "XOR": lambda args: exp.Xor(expressions=args),
193            "MD5": exp.MD5Digest.from_arg_list,
194            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
195            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
196        }
197
198        AGG_FUNCTIONS = {
199            "count",
200            "min",
201            "max",
202            "sum",
203            "avg",
204            "any",
205            "stddevPop",
206            "stddevSamp",
207            "varPop",
208            "varSamp",
209            "corr",
210            "covarPop",
211            "covarSamp",
212            "entropy",
213            "exponentialMovingAverage",
214            "intervalLengthSum",
215            "kolmogorovSmirnovTest",
216            "mannWhitneyUTest",
217            "median",
218            "rankCorr",
219            "sumKahan",
220            "studentTTest",
221            "welchTTest",
222            "anyHeavy",
223            "anyLast",
224            "boundingRatio",
225            "first_value",
226            "last_value",
227            "argMin",
228            "argMax",
229            "avgWeighted",
230            "topK",
231            "topKWeighted",
232            "deltaSum",
233            "deltaSumTimestamp",
234            "groupArray",
235            "groupArrayLast",
236            "groupUniqArray",
237            "groupArrayInsertAt",
238            "groupArrayMovingAvg",
239            "groupArrayMovingSum",
240            "groupArraySample",
241            "groupBitAnd",
242            "groupBitOr",
243            "groupBitXor",
244            "groupBitmap",
245            "groupBitmapAnd",
246            "groupBitmapOr",
247            "groupBitmapXor",
248            "sumWithOverflow",
249            "sumMap",
250            "minMap",
251            "maxMap",
252            "skewSamp",
253            "skewPop",
254            "kurtSamp",
255            "kurtPop",
256            "uniq",
257            "uniqExact",
258            "uniqCombined",
259            "uniqCombined64",
260            "uniqHLL12",
261            "uniqTheta",
262            "quantile",
263            "quantiles",
264            "quantileExact",
265            "quantilesExact",
266            "quantileExactLow",
267            "quantilesExactLow",
268            "quantileExactHigh",
269            "quantilesExactHigh",
270            "quantileExactWeighted",
271            "quantilesExactWeighted",
272            "quantileTiming",
273            "quantilesTiming",
274            "quantileTimingWeighted",
275            "quantilesTimingWeighted",
276            "quantileDeterministic",
277            "quantilesDeterministic",
278            "quantileTDigest",
279            "quantilesTDigest",
280            "quantileTDigestWeighted",
281            "quantilesTDigestWeighted",
282            "quantileBFloat16",
283            "quantilesBFloat16",
284            "quantileBFloat16Weighted",
285            "quantilesBFloat16Weighted",
286            "simpleLinearRegression",
287            "stochasticLinearRegression",
288            "stochasticLogisticRegression",
289            "categoricalInformationValue",
290            "contingency",
291            "cramersV",
292            "cramersVBiasCorrected",
293            "theilsU",
294            "maxIntersections",
295            "maxIntersectionsPosition",
296            "meanZTest",
297            "quantileInterpolatedWeighted",
298            "quantilesInterpolatedWeighted",
299            "quantileGK",
300            "quantilesGK",
301            "sparkBar",
302            "sumCount",
303            "largestTriangleThreeBuckets",
304            "histogram",
305            "sequenceMatch",
306            "sequenceCount",
307            "windowFunnel",
308            "retention",
309            "uniqUpTo",
310            "sequenceNextNode",
311            "exponentialTimeDecayedAvg",
312        }
313
314        AGG_FUNCTIONS_SUFFIXES = [
315            "If",
316            "Array",
317            "ArrayIf",
318            "Map",
319            "SimpleState",
320            "State",
321            "Merge",
322            "MergeState",
323            "ForEach",
324            "Distinct",
325            "OrDefault",
326            "OrNull",
327            "Resample",
328            "ArgMin",
329            "ArgMax",
330        ]
331
332        FUNC_TOKENS = {
333            *parser.Parser.FUNC_TOKENS,
334            TokenType.SET,
335        }
336
337        AGG_FUNC_MAPPING = (
338            lambda functions, suffixes: {
339                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
340            }
341        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
342
343        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
344
345        FUNCTION_PARSERS = {
346            **parser.Parser.FUNCTION_PARSERS,
347            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
348            "QUANTILE": lambda self: self._parse_quantile(),
349        }
350
351        FUNCTION_PARSERS.pop("EXTRACT")
352        FUNCTION_PARSERS.pop("MATCH")
353
354        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
355        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
356
357        RANGE_PARSERS = {
358            **parser.Parser.RANGE_PARSERS,
359            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
360            and self._parse_in(this, is_global=True),
361        }
362
363        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
364        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
365        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
366        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
367
368        JOIN_KINDS = {
369            *parser.Parser.JOIN_KINDS,
370            TokenType.ANY,
371            TokenType.ASOF,
372            TokenType.ARRAY,
373        }
374
375        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
376            TokenType.ANY,
377            TokenType.ARRAY,
378            TokenType.FINAL,
379            TokenType.FORMAT,
380            TokenType.SETTINGS,
381        }
382
383        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
384            TokenType.FORMAT,
385        }
386
387        LOG_DEFAULTS_TO_LN = True
388
389        QUERY_MODIFIER_PARSERS = {
390            **parser.Parser.QUERY_MODIFIER_PARSERS,
391            TokenType.SETTINGS: lambda self: (
392                "settings",
393                self._advance() or self._parse_csv(self._parse_assignment),
394            ),
395            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
396        }
397
398        CONSTRAINT_PARSERS = {
399            **parser.Parser.CONSTRAINT_PARSERS,
400            "INDEX": lambda self: self._parse_index_constraint(),
401            "CODEC": lambda self: self._parse_compress(),
402        }
403
404        ALTER_PARSERS = {
405            **parser.Parser.ALTER_PARSERS,
406            "REPLACE": lambda self: self._parse_alter_table_replace(),
407        }
408
409        SCHEMA_UNNAMED_CONSTRAINTS = {
410            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
411            "INDEX",
412        }
413
414        def _parse_assignment(self) -> t.Optional[exp.Expression]:
415            this = super()._parse_assignment()
416
417            if self._match(TokenType.PLACEHOLDER):
418                return self.expression(
419                    exp.If,
420                    this=this,
421                    true=self._parse_assignment(),
422                    false=self._match(TokenType.COLON) and self._parse_assignment(),
423                )
424
425            return this
426
427        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
428            """
429            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
430            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
431            """
432            if not self._match(TokenType.L_BRACE):
433                return None
434
435            this = self._parse_id_var()
436            self._match(TokenType.COLON)
437            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
438                self._match_text_seq("IDENTIFIER") and "Identifier"
439            )
440
441            if not kind:
442                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
443            elif not self._match(TokenType.R_BRACE):
444                self.raise_error("Expecting }")
445
446            return self.expression(exp.Placeholder, this=this, kind=kind)
447
448        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
449            this = super()._parse_in(this)
450            this.set("is_global", is_global)
451            return this
452
453        def _parse_table(
454            self,
455            schema: bool = False,
456            joins: bool = False,
457            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
458            parse_bracket: bool = False,
459            is_db_reference: bool = False,
460            parse_partition: bool = False,
461        ) -> t.Optional[exp.Expression]:
462            this = super()._parse_table(
463                schema=schema,
464                joins=joins,
465                alias_tokens=alias_tokens,
466                parse_bracket=parse_bracket,
467                is_db_reference=is_db_reference,
468            )
469
470            if self._match(TokenType.FINAL):
471                this = self.expression(exp.Final, this=this)
472
473            return this
474
475        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
476            return super()._parse_position(haystack_first=True)
477
478        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
479        def _parse_cte(self) -> exp.CTE:
480            # WITH <identifier> AS <subquery expression>
481            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
482
483            if not cte:
484                # WITH <expression> AS <identifier>
485                cte = self.expression(
486                    exp.CTE,
487                    this=self._parse_assignment(),
488                    alias=self._parse_table_alias(),
489                    scalar=True,
490                )
491
492            return cte
493
494        def _parse_join_parts(
495            self,
496        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
497            is_global = self._match(TokenType.GLOBAL) and self._prev
498            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
499
500            if kind_pre:
501                kind = self._match_set(self.JOIN_KINDS) and self._prev
502                side = self._match_set(self.JOIN_SIDES) and self._prev
503                return is_global, side, kind
504
505            return (
506                is_global,
507                self._match_set(self.JOIN_SIDES) and self._prev,
508                self._match_set(self.JOIN_KINDS) and self._prev,
509            )
510
511        def _parse_join(
512            self, skip_join_token: bool = False, parse_bracket: bool = False
513        ) -> t.Optional[exp.Join]:
514            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
515            if join:
516                join.set("global", join.args.pop("method", None))
517
518            return join
519
520        def _parse_function(
521            self,
522            functions: t.Optional[t.Dict[str, t.Callable]] = None,
523            anonymous: bool = False,
524            optional_parens: bool = True,
525            any_token: bool = False,
526        ) -> t.Optional[exp.Expression]:
527            expr = super()._parse_function(
528                functions=functions,
529                anonymous=anonymous,
530                optional_parens=optional_parens,
531                any_token=any_token,
532            )
533
534            func = expr.this if isinstance(expr, exp.Window) else expr
535
536            # Aggregate functions can be split in 2 parts: <func_name><suffix>
537            parts = (
538                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
539            )
540
541            if parts:
542                params = self._parse_func_params(func)
543
544                kwargs = {
545                    "this": func.this,
546                    "expressions": func.expressions,
547                }
548                if parts[1]:
549                    kwargs["parts"] = parts
550                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
551                else:
552                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
553
554                kwargs["exp_class"] = exp_class
555                if params:
556                    kwargs["params"] = params
557
558                func = self.expression(**kwargs)
559
560                if isinstance(expr, exp.Window):
561                    # The window's func was parsed as Anonymous in base parser, fix its
562                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
563                    expr.set("this", func)
564                elif params:
565                    # Params have blocked super()._parse_function() from parsing the following window
566                    # (if that exists) as they're standing between the function call and the window spec
567                    expr = self._parse_window(func)
568                else:
569                    expr = func
570
571            return expr
572
573        def _parse_func_params(
574            self, this: t.Optional[exp.Func] = None
575        ) -> t.Optional[t.List[exp.Expression]]:
576            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
577                return self._parse_csv(self._parse_lambda)
578
579            if self._match(TokenType.L_PAREN):
580                params = self._parse_csv(self._parse_lambda)
581                self._match_r_paren(this)
582                return params
583
584            return None
585
586        def _parse_quantile(self) -> exp.Quantile:
587            this = self._parse_lambda()
588            params = self._parse_func_params()
589            if params:
590                return self.expression(exp.Quantile, this=params[0], quantile=this)
591            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
592
593        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
594            return super()._parse_wrapped_id_vars(optional=True)
595
596        def _parse_primary_key(
597            self, wrapped_optional: bool = False, in_props: bool = False
598        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
599            return super()._parse_primary_key(
600                wrapped_optional=wrapped_optional or in_props, in_props=in_props
601            )
602
603        def _parse_on_property(self) -> t.Optional[exp.Expression]:
604            index = self._index
605            if self._match_text_seq("CLUSTER"):
606                this = self._parse_id_var()
607                if this:
608                    return self.expression(exp.OnCluster, this=this)
609                else:
610                    self._retreat(index)
611            return None
612
613        def _parse_index_constraint(
614            self, kind: t.Optional[str] = None
615        ) -> exp.IndexColumnConstraint:
616            # INDEX name1 expr TYPE type1(args) GRANULARITY value
617            this = self._parse_id_var()
618            expression = self._parse_assignment()
619
620            index_type = self._match_text_seq("TYPE") and (
621                self._parse_function() or self._parse_var()
622            )
623
624            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
625
626            return self.expression(
627                exp.IndexColumnConstraint,
628                this=this,
629                expression=expression,
630                index_type=index_type,
631                granularity=granularity,
632            )
633
634        def _parse_partition(self) -> t.Optional[exp.Partition]:
635            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
636            if not self._match(TokenType.PARTITION):
637                return None
638
639            if self._match_text_seq("ID"):
640                # Corresponds to the PARTITION ID <string_value> syntax
641                expressions: t.List[exp.Expression] = [
642                    self.expression(exp.PartitionId, this=self._parse_string())
643                ]
644            else:
645                expressions = self._parse_expressions()
646
647            return self.expression(exp.Partition, expressions=expressions)
648
649        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
650            partition = self._parse_partition()
651
652            if not partition or not self._match(TokenType.FROM):
653                return None
654
655            return self.expression(
656                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
657            )
658
659        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
660            if not self._match_text_seq("PROJECTION"):
661                return None
662
663            return self.expression(
664                exp.ProjectionDef,
665                this=self._parse_id_var(),
666                expression=self._parse_wrapped(self._parse_statement),
667            )
668
669        def _parse_constraint(self) -> t.Optional[exp.Expression]:
670            return super()._parse_constraint() or self._parse_projection_def()
671
672    class Generator(generator.Generator):
673        QUERY_HINTS = False
674        STRUCT_DELIMITER = ("(", ")")
675        NVL2_SUPPORTED = False
676        TABLESAMPLE_REQUIRES_PARENS = False
677        TABLESAMPLE_SIZE_IS_ROWS = False
678        TABLESAMPLE_KEYWORDS = "SAMPLE"
679        LAST_DAY_SUPPORTS_DATE_PART = False
680        CAN_IMPLEMENT_ARRAY_ANY = True
681        SUPPORTS_TO_NUMBER = False
682        JOIN_HINTS = False
683        TABLE_HINTS = False
684        EXPLICIT_SET_OP = True
685        GROUPINGS_SEP = ""
686        SET_OP_MODIFIERS = False
687
688        STRING_TYPE_MAPPING = {
689            exp.DataType.Type.CHAR: "String",
690            exp.DataType.Type.LONGBLOB: "String",
691            exp.DataType.Type.LONGTEXT: "String",
692            exp.DataType.Type.MEDIUMBLOB: "String",
693            exp.DataType.Type.MEDIUMTEXT: "String",
694            exp.DataType.Type.TINYBLOB: "String",
695            exp.DataType.Type.TINYTEXT: "String",
696            exp.DataType.Type.TEXT: "String",
697            exp.DataType.Type.VARBINARY: "String",
698            exp.DataType.Type.VARCHAR: "String",
699        }
700
701        SUPPORTED_JSON_PATH_PARTS = {
702            exp.JSONPathKey,
703            exp.JSONPathRoot,
704            exp.JSONPathSubscript,
705        }
706
707        TYPE_MAPPING = {
708            **generator.Generator.TYPE_MAPPING,
709            **STRING_TYPE_MAPPING,
710            exp.DataType.Type.ARRAY: "Array",
711            exp.DataType.Type.BIGINT: "Int64",
712            exp.DataType.Type.DATE32: "Date32",
713            exp.DataType.Type.DATETIME64: "DateTime64",
714            exp.DataType.Type.DOUBLE: "Float64",
715            exp.DataType.Type.ENUM: "Enum",
716            exp.DataType.Type.ENUM8: "Enum8",
717            exp.DataType.Type.ENUM16: "Enum16",
718            exp.DataType.Type.FIXEDSTRING: "FixedString",
719            exp.DataType.Type.FLOAT: "Float32",
720            exp.DataType.Type.INT: "Int32",
721            exp.DataType.Type.MEDIUMINT: "Int32",
722            exp.DataType.Type.INT128: "Int128",
723            exp.DataType.Type.INT256: "Int256",
724            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
725            exp.DataType.Type.MAP: "Map",
726            exp.DataType.Type.NESTED: "Nested",
727            exp.DataType.Type.NULLABLE: "Nullable",
728            exp.DataType.Type.SMALLINT: "Int16",
729            exp.DataType.Type.STRUCT: "Tuple",
730            exp.DataType.Type.TINYINT: "Int8",
731            exp.DataType.Type.UBIGINT: "UInt64",
732            exp.DataType.Type.UINT: "UInt32",
733            exp.DataType.Type.UINT128: "UInt128",
734            exp.DataType.Type.UINT256: "UInt256",
735            exp.DataType.Type.USMALLINT: "UInt16",
736            exp.DataType.Type.UTINYINT: "UInt8",
737            exp.DataType.Type.IPV4: "IPv4",
738            exp.DataType.Type.IPV6: "IPv6",
739            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
740            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
741        }
742
743        TRANSFORMS = {
744            **generator.Generator.TRANSFORMS,
745            exp.AnyValue: rename_func("any"),
746            exp.ApproxDistinct: rename_func("uniq"),
747            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
748            exp.ArraySize: rename_func("LENGTH"),
749            exp.ArraySum: rename_func("arraySum"),
750            exp.ArgMax: arg_max_or_min_no_count("argMax"),
751            exp.ArgMin: arg_max_or_min_no_count("argMin"),
752            exp.Array: inline_array_sql,
753            exp.CastToStrType: rename_func("CAST"),
754            exp.CountIf: rename_func("countIf"),
755            exp.CompressColumnConstraint: lambda self,
756            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
757            exp.ComputedColumnConstraint: lambda self,
758            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
759            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
760            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
761            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
762            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
763            exp.Explode: rename_func("arrayJoin"),
764            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
765            exp.IsNan: rename_func("isNaN"),
766            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
767            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
768            exp.JSONPathKey: json_path_key_only_name,
769            exp.JSONPathRoot: lambda *_: "",
770            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
771            exp.Nullif: rename_func("nullIf"),
772            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
773            exp.Pivot: no_pivot_sql,
774            exp.Quantile: _quantile_sql,
775            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
776            exp.Rand: rename_func("randCanonical"),
777            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
778            exp.StartsWith: rename_func("startsWith"),
779            exp.StrPosition: lambda self, e: self.func(
780                "position", e.this, e.args.get("substr"), e.args.get("position")
781            ),
782            exp.TimeToStr: lambda self, e: self.func(
783                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
784            ),
785            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
786            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
787            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
788            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
789            exp.MD5Digest: rename_func("MD5"),
790            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
791            exp.SHA: rename_func("SHA1"),
792            exp.SHA2: sha256_sql,
793            exp.UnixToTime: _unix_to_time_sql,
794            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
795            exp.Variance: rename_func("varSamp"),
796            exp.Stddev: rename_func("stddevSamp"),
797        }
798
799        PROPERTIES_LOCATION = {
800            **generator.Generator.PROPERTIES_LOCATION,
801            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
802            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
803            exp.OnCluster: exp.Properties.Location.POST_NAME,
804        }
805
806        # there's no list in docs, but it can be found in Clickhouse code
807        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
808        ON_CLUSTER_TARGETS = {
809            "DATABASE",
810            "TABLE",
811            "VIEW",
812            "DICTIONARY",
813            "INDEX",
814            "FUNCTION",
815            "NAMED COLLECTION",
816        }
817
818        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
819            this = self.json_path_part(expression.this)
820            return str(int(this) + 1) if is_int(this) else this
821
822        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
823            return f"AS {self.sql(expression, 'this')}"
824
825        def _any_to_has(
826            self,
827            expression: exp.EQ | exp.NEQ,
828            default: t.Callable[[t.Any], str],
829            prefix: str = "",
830        ) -> str:
831            if isinstance(expression.left, exp.Any):
832                arr = expression.left
833                this = expression.right
834            elif isinstance(expression.right, exp.Any):
835                arr = expression.right
836                this = expression.left
837            else:
838                return default(expression)
839
840            return prefix + self.func("has", arr.this.unnest(), this)
841
842        def eq_sql(self, expression: exp.EQ) -> str:
843            return self._any_to_has(expression, super().eq_sql)
844
845        def neq_sql(self, expression: exp.NEQ) -> str:
846            return self._any_to_has(expression, super().neq_sql, "NOT ")
847
848        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
849            # Manually add a flag to make the search case-insensitive
850            regex = self.func("CONCAT", "'(?i)'", expression.expression)
851            return self.func("match", expression.this, regex)
852
853        def datatype_sql(self, expression: exp.DataType) -> str:
854            # String is the standard ClickHouse type, every other variant is just an alias.
855            # Additionally, any supplied length parameter will be ignored.
856            #
857            # https://clickhouse.com/docs/en/sql-reference/data-types/string
858            if expression.this in self.STRING_TYPE_MAPPING:
859                return "String"
860
861            return super().datatype_sql(expression)
862
863        def cte_sql(self, expression: exp.CTE) -> str:
864            if expression.args.get("scalar"):
865                this = self.sql(expression, "this")
866                alias = self.sql(expression, "alias")
867                return f"{this} AS {alias}"
868
869            return super().cte_sql(expression)
870
871        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
872            return super().after_limit_modifiers(expression) + [
873                (
874                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
875                    if expression.args.get("settings")
876                    else ""
877                ),
878                (
879                    self.seg("FORMAT ") + self.sql(expression, "format")
880                    if expression.args.get("format")
881                    else ""
882                ),
883            ]
884
885        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
886            params = self.expressions(expression, key="params", flat=True)
887            return self.func(expression.name, *expression.expressions) + f"({params})"
888
889        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
890            return self.func(expression.name, *expression.expressions)
891
892        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
893            return self.anonymousaggfunc_sql(expression)
894
895        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
896            return self.parameterizedagg_sql(expression)
897
898        def placeholder_sql(self, expression: exp.Placeholder) -> str:
899            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
900
901        def oncluster_sql(self, expression: exp.OnCluster) -> str:
902            return f"ON CLUSTER {self.sql(expression, 'this')}"
903
904        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
905            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
906                exp.Properties.Location.POST_NAME
907            ):
908                this_name = self.sql(expression.this, "this")
909                this_properties = " ".join(
910                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
911                )
912                this_schema = self.schema_columns_sql(expression.this)
913                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
914
915            return super().createable_sql(expression, locations)
916
917        def prewhere_sql(self, expression: exp.PreWhere) -> str:
918            this = self.indent(self.sql(expression, "this"))
919            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
920
921        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
922            this = self.sql(expression, "this")
923            this = f" {this}" if this else ""
924            expr = self.sql(expression, "expression")
925            expr = f" {expr}" if expr else ""
926            index_type = self.sql(expression, "index_type")
927            index_type = f" TYPE {index_type}" if index_type else ""
928            granularity = self.sql(expression, "granularity")
929            granularity = f" GRANULARITY {granularity}" if granularity else ""
930
931            return f"INDEX{this}{expr}{index_type}{granularity}"
932
933        def partition_sql(self, expression: exp.Partition) -> str:
934            return f"PARTITION {self.expressions(expression, flat=True)}"
935
936        def partitionid_sql(self, expression: exp.PartitionId) -> str:
937            return f"ID {self.sql(expression.this)}"
938
939        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
940            return (
941                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
942            )
943
944        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
945            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'>, '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            "EXTRACT": exp.RegexpExtract.from_arg_list,
179            "FORMATDATETIME": _build_date_format,
180            "JSONEXTRACTSTRING": build_json_extract_path(
181                exp.JSONExtractScalar, zero_based_indexing=False
182            ),
183            "MAP": parser.build_var_map,
184            "MATCH": exp.RegexpLike.from_arg_list,
185            "RANDCANONICAL": exp.Rand.from_arg_list,
186            "TUPLE": exp.Struct.from_arg_list,
187            "TIMESTAMP_SUB": build_date_delta(exp.TimestampSub, default_unit=None),
188            "TIMESTAMPSUB": build_date_delta(exp.TimestampSub, default_unit=None),
189            "TIMESTAMP_ADD": build_date_delta(exp.TimestampAdd, default_unit=None),
190            "TIMESTAMPADD": build_date_delta(exp.TimestampAdd, default_unit=None),
191            "UNIQ": exp.ApproxDistinct.from_arg_list,
192            "XOR": lambda args: exp.Xor(expressions=args),
193            "MD5": exp.MD5Digest.from_arg_list,
194            "SHA256": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(256)),
195            "SHA512": lambda args: exp.SHA2(this=seq_get(args, 0), length=exp.Literal.number(512)),
196        }
197
198        AGG_FUNCTIONS = {
199            "count",
200            "min",
201            "max",
202            "sum",
203            "avg",
204            "any",
205            "stddevPop",
206            "stddevSamp",
207            "varPop",
208            "varSamp",
209            "corr",
210            "covarPop",
211            "covarSamp",
212            "entropy",
213            "exponentialMovingAverage",
214            "intervalLengthSum",
215            "kolmogorovSmirnovTest",
216            "mannWhitneyUTest",
217            "median",
218            "rankCorr",
219            "sumKahan",
220            "studentTTest",
221            "welchTTest",
222            "anyHeavy",
223            "anyLast",
224            "boundingRatio",
225            "first_value",
226            "last_value",
227            "argMin",
228            "argMax",
229            "avgWeighted",
230            "topK",
231            "topKWeighted",
232            "deltaSum",
233            "deltaSumTimestamp",
234            "groupArray",
235            "groupArrayLast",
236            "groupUniqArray",
237            "groupArrayInsertAt",
238            "groupArrayMovingAvg",
239            "groupArrayMovingSum",
240            "groupArraySample",
241            "groupBitAnd",
242            "groupBitOr",
243            "groupBitXor",
244            "groupBitmap",
245            "groupBitmapAnd",
246            "groupBitmapOr",
247            "groupBitmapXor",
248            "sumWithOverflow",
249            "sumMap",
250            "minMap",
251            "maxMap",
252            "skewSamp",
253            "skewPop",
254            "kurtSamp",
255            "kurtPop",
256            "uniq",
257            "uniqExact",
258            "uniqCombined",
259            "uniqCombined64",
260            "uniqHLL12",
261            "uniqTheta",
262            "quantile",
263            "quantiles",
264            "quantileExact",
265            "quantilesExact",
266            "quantileExactLow",
267            "quantilesExactLow",
268            "quantileExactHigh",
269            "quantilesExactHigh",
270            "quantileExactWeighted",
271            "quantilesExactWeighted",
272            "quantileTiming",
273            "quantilesTiming",
274            "quantileTimingWeighted",
275            "quantilesTimingWeighted",
276            "quantileDeterministic",
277            "quantilesDeterministic",
278            "quantileTDigest",
279            "quantilesTDigest",
280            "quantileTDigestWeighted",
281            "quantilesTDigestWeighted",
282            "quantileBFloat16",
283            "quantilesBFloat16",
284            "quantileBFloat16Weighted",
285            "quantilesBFloat16Weighted",
286            "simpleLinearRegression",
287            "stochasticLinearRegression",
288            "stochasticLogisticRegression",
289            "categoricalInformationValue",
290            "contingency",
291            "cramersV",
292            "cramersVBiasCorrected",
293            "theilsU",
294            "maxIntersections",
295            "maxIntersectionsPosition",
296            "meanZTest",
297            "quantileInterpolatedWeighted",
298            "quantilesInterpolatedWeighted",
299            "quantileGK",
300            "quantilesGK",
301            "sparkBar",
302            "sumCount",
303            "largestTriangleThreeBuckets",
304            "histogram",
305            "sequenceMatch",
306            "sequenceCount",
307            "windowFunnel",
308            "retention",
309            "uniqUpTo",
310            "sequenceNextNode",
311            "exponentialTimeDecayedAvg",
312        }
313
314        AGG_FUNCTIONS_SUFFIXES = [
315            "If",
316            "Array",
317            "ArrayIf",
318            "Map",
319            "SimpleState",
320            "State",
321            "Merge",
322            "MergeState",
323            "ForEach",
324            "Distinct",
325            "OrDefault",
326            "OrNull",
327            "Resample",
328            "ArgMin",
329            "ArgMax",
330        ]
331
332        FUNC_TOKENS = {
333            *parser.Parser.FUNC_TOKENS,
334            TokenType.SET,
335        }
336
337        AGG_FUNC_MAPPING = (
338            lambda functions, suffixes: {
339                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
340            }
341        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
342
343        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
344
345        FUNCTION_PARSERS = {
346            **parser.Parser.FUNCTION_PARSERS,
347            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
348            "QUANTILE": lambda self: self._parse_quantile(),
349        }
350
351        FUNCTION_PARSERS.pop("EXTRACT")
352        FUNCTION_PARSERS.pop("MATCH")
353
354        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
355        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
356
357        RANGE_PARSERS = {
358            **parser.Parser.RANGE_PARSERS,
359            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
360            and self._parse_in(this, is_global=True),
361        }
362
363        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
364        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
365        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
366        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
367
368        JOIN_KINDS = {
369            *parser.Parser.JOIN_KINDS,
370            TokenType.ANY,
371            TokenType.ASOF,
372            TokenType.ARRAY,
373        }
374
375        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
376            TokenType.ANY,
377            TokenType.ARRAY,
378            TokenType.FINAL,
379            TokenType.FORMAT,
380            TokenType.SETTINGS,
381        }
382
383        ALIAS_TOKENS = parser.Parser.ALIAS_TOKENS - {
384            TokenType.FORMAT,
385        }
386
387        LOG_DEFAULTS_TO_LN = True
388
389        QUERY_MODIFIER_PARSERS = {
390            **parser.Parser.QUERY_MODIFIER_PARSERS,
391            TokenType.SETTINGS: lambda self: (
392                "settings",
393                self._advance() or self._parse_csv(self._parse_assignment),
394            ),
395            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
396        }
397
398        CONSTRAINT_PARSERS = {
399            **parser.Parser.CONSTRAINT_PARSERS,
400            "INDEX": lambda self: self._parse_index_constraint(),
401            "CODEC": lambda self: self._parse_compress(),
402        }
403
404        ALTER_PARSERS = {
405            **parser.Parser.ALTER_PARSERS,
406            "REPLACE": lambda self: self._parse_alter_table_replace(),
407        }
408
409        SCHEMA_UNNAMED_CONSTRAINTS = {
410            *parser.Parser.SCHEMA_UNNAMED_CONSTRAINTS,
411            "INDEX",
412        }
413
414        def _parse_assignment(self) -> t.Optional[exp.Expression]:
415            this = super()._parse_assignment()
416
417            if self._match(TokenType.PLACEHOLDER):
418                return self.expression(
419                    exp.If,
420                    this=this,
421                    true=self._parse_assignment(),
422                    false=self._match(TokenType.COLON) and self._parse_assignment(),
423                )
424
425            return this
426
427        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
428            """
429            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
430            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
431            """
432            if not self._match(TokenType.L_BRACE):
433                return None
434
435            this = self._parse_id_var()
436            self._match(TokenType.COLON)
437            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
438                self._match_text_seq("IDENTIFIER") and "Identifier"
439            )
440
441            if not kind:
442                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
443            elif not self._match(TokenType.R_BRACE):
444                self.raise_error("Expecting }")
445
446            return self.expression(exp.Placeholder, this=this, kind=kind)
447
448        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
449            this = super()._parse_in(this)
450            this.set("is_global", is_global)
451            return this
452
453        def _parse_table(
454            self,
455            schema: bool = False,
456            joins: bool = False,
457            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
458            parse_bracket: bool = False,
459            is_db_reference: bool = False,
460            parse_partition: bool = False,
461        ) -> t.Optional[exp.Expression]:
462            this = super()._parse_table(
463                schema=schema,
464                joins=joins,
465                alias_tokens=alias_tokens,
466                parse_bracket=parse_bracket,
467                is_db_reference=is_db_reference,
468            )
469
470            if self._match(TokenType.FINAL):
471                this = self.expression(exp.Final, this=this)
472
473            return this
474
475        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
476            return super()._parse_position(haystack_first=True)
477
478        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
479        def _parse_cte(self) -> exp.CTE:
480            # WITH <identifier> AS <subquery expression>
481            cte: t.Optional[exp.CTE] = self._try_parse(super()._parse_cte)
482
483            if not cte:
484                # WITH <expression> AS <identifier>
485                cte = self.expression(
486                    exp.CTE,
487                    this=self._parse_assignment(),
488                    alias=self._parse_table_alias(),
489                    scalar=True,
490                )
491
492            return cte
493
494        def _parse_join_parts(
495            self,
496        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
497            is_global = self._match(TokenType.GLOBAL) and self._prev
498            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
499
500            if kind_pre:
501                kind = self._match_set(self.JOIN_KINDS) and self._prev
502                side = self._match_set(self.JOIN_SIDES) and self._prev
503                return is_global, side, kind
504
505            return (
506                is_global,
507                self._match_set(self.JOIN_SIDES) and self._prev,
508                self._match_set(self.JOIN_KINDS) and self._prev,
509            )
510
511        def _parse_join(
512            self, skip_join_token: bool = False, parse_bracket: bool = False
513        ) -> t.Optional[exp.Join]:
514            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
515            if join:
516                join.set("global", join.args.pop("method", None))
517
518            return join
519
520        def _parse_function(
521            self,
522            functions: t.Optional[t.Dict[str, t.Callable]] = None,
523            anonymous: bool = False,
524            optional_parens: bool = True,
525            any_token: bool = False,
526        ) -> t.Optional[exp.Expression]:
527            expr = super()._parse_function(
528                functions=functions,
529                anonymous=anonymous,
530                optional_parens=optional_parens,
531                any_token=any_token,
532            )
533
534            func = expr.this if isinstance(expr, exp.Window) else expr
535
536            # Aggregate functions can be split in 2 parts: <func_name><suffix>
537            parts = (
538                self.AGG_FUNC_MAPPING.get(func.this) if isinstance(func, exp.Anonymous) else None
539            )
540
541            if parts:
542                params = self._parse_func_params(func)
543
544                kwargs = {
545                    "this": func.this,
546                    "expressions": func.expressions,
547                }
548                if parts[1]:
549                    kwargs["parts"] = parts
550                    exp_class = exp.CombinedParameterizedAgg if params else exp.CombinedAggFunc
551                else:
552                    exp_class = exp.ParameterizedAgg if params else exp.AnonymousAggFunc
553
554                kwargs["exp_class"] = exp_class
555                if params:
556                    kwargs["params"] = params
557
558                func = self.expression(**kwargs)
559
560                if isinstance(expr, exp.Window):
561                    # The window's func was parsed as Anonymous in base parser, fix its
562                    # type to be CH style CombinedAnonymousAggFunc / AnonymousAggFunc
563                    expr.set("this", func)
564                elif params:
565                    # Params have blocked super()._parse_function() from parsing the following window
566                    # (if that exists) as they're standing between the function call and the window spec
567                    expr = self._parse_window(func)
568                else:
569                    expr = func
570
571            return expr
572
573        def _parse_func_params(
574            self, this: t.Optional[exp.Func] = None
575        ) -> t.Optional[t.List[exp.Expression]]:
576            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
577                return self._parse_csv(self._parse_lambda)
578
579            if self._match(TokenType.L_PAREN):
580                params = self._parse_csv(self._parse_lambda)
581                self._match_r_paren(this)
582                return params
583
584            return None
585
586        def _parse_quantile(self) -> exp.Quantile:
587            this = self._parse_lambda()
588            params = self._parse_func_params()
589            if params:
590                return self.expression(exp.Quantile, this=params[0], quantile=this)
591            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
592
593        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
594            return super()._parse_wrapped_id_vars(optional=True)
595
596        def _parse_primary_key(
597            self, wrapped_optional: bool = False, in_props: bool = False
598        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
599            return super()._parse_primary_key(
600                wrapped_optional=wrapped_optional or in_props, in_props=in_props
601            )
602
603        def _parse_on_property(self) -> t.Optional[exp.Expression]:
604            index = self._index
605            if self._match_text_seq("CLUSTER"):
606                this = self._parse_id_var()
607                if this:
608                    return self.expression(exp.OnCluster, this=this)
609                else:
610                    self._retreat(index)
611            return None
612
613        def _parse_index_constraint(
614            self, kind: t.Optional[str] = None
615        ) -> exp.IndexColumnConstraint:
616            # INDEX name1 expr TYPE type1(args) GRANULARITY value
617            this = self._parse_id_var()
618            expression = self._parse_assignment()
619
620            index_type = self._match_text_seq("TYPE") and (
621                self._parse_function() or self._parse_var()
622            )
623
624            granularity = self._match_text_seq("GRANULARITY") and self._parse_term()
625
626            return self.expression(
627                exp.IndexColumnConstraint,
628                this=this,
629                expression=expression,
630                index_type=index_type,
631                granularity=granularity,
632            )
633
634        def _parse_partition(self) -> t.Optional[exp.Partition]:
635            # https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
636            if not self._match(TokenType.PARTITION):
637                return None
638
639            if self._match_text_seq("ID"):
640                # Corresponds to the PARTITION ID <string_value> syntax
641                expressions: t.List[exp.Expression] = [
642                    self.expression(exp.PartitionId, this=self._parse_string())
643                ]
644            else:
645                expressions = self._parse_expressions()
646
647            return self.expression(exp.Partition, expressions=expressions)
648
649        def _parse_alter_table_replace(self) -> t.Optional[exp.Expression]:
650            partition = self._parse_partition()
651
652            if not partition or not self._match(TokenType.FROM):
653                return None
654
655            return self.expression(
656                exp.ReplacePartition, expression=partition, source=self._parse_table_parts()
657            )
658
659        def _parse_projection_def(self) -> t.Optional[exp.ProjectionDef]:
660            if not self._match_text_seq("PROJECTION"):
661                return None
662
663            return self.expression(
664                exp.ProjectionDef,
665                this=self._parse_id_var(),
666                expression=self._parse_wrapped(self._parse_statement),
667            )
668
669        def _parse_constraint(self) -> t.Optional[exp.Expression]:
670            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.RegexpExtract'>>, '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 = {'deltaSumTimestamp', 'quantilesTDigestWeighted', 'groupBitXor', 'quantilesInterpolatedWeighted', 'meanZTest', 'boundingRatio', 'skewPop', 'avgWeighted', 'quantilesTDigest', 'sparkBar', 'uniqCombined64', 'kurtSamp', 'quantileTDigestWeighted', 'cramersVBiasCorrected', 'sequenceMatch', 'stddevPop', 'groupBitOr', 'quantilesExactWeighted', 'count', 'maxIntersections', 'quantilesDeterministic', 'exponentialTimeDecayedAvg', 'covarPop', 'cramersV', 'theilsU', 'groupArrayMovingSum', 'sumMap', 'any', 'corr', 'quantileExact', 'quantilesExactLow', 'mannWhitneyUTest', 'quantilesExact', 'studentTTest', 'uniqCombined', 'covarSamp', 'groupBitmapOr', 'contingency', 'sequenceNextNode', 'avg', 'groupBitmap', 'quantileExactLow', 'varPop', 'groupArrayInsertAt', 'histogram', 'deltaSum', 'kurtPop', 'simpleLinearRegression', 'groupArray', 'quantileGK', 'quantileExactWeighted', 'quantileTDigest', 'groupArrayMovingAvg', 'quantileTiming', 'skewSamp', 'stochasticLinearRegression', 'exponentialMovingAverage', 'anyLast', 'sumCount', 'anyHeavy', 'maxIntersectionsPosition', 'intervalLengthSum', 'max', 'sumKahan', 'uniqExact', 'groupArraySample', 'uniqHLL12', 'varSamp', 'quantilesTimingWeighted', 'welchTTest', 'quantileExactHigh', 'quantileBFloat16Weighted', 'min', 'quantilesGK', 'quantilesExactHigh', 'quantileDeterministic', 'topK', 'quantile', 'sequenceCount', 'stochasticLogisticRegression', 'argMin', 'groupBitAnd', 'sum', 'groupBitmapAnd', 'kolmogorovSmirnovTest', 'topKWeighted', 'groupUniqArray', 'quantilesTiming', 'quantiles', 'stddevSamp', 'quantilesBFloat16', 'maxMap', 'categoricalInformationValue', 'retention', 'quantileInterpolatedWeighted', 'uniqUpTo', 'uniq', 'quantilesBFloat16Weighted', 'argMax', 'median', 'last_value', 'minMap', 'entropy', 'quantileTimingWeighted', 'groupBitmapXor', 'uniqTheta', 'quantileBFloat16', 'largestTriangleThreeBuckets', 'sumWithOverflow', 'rankCorr', 'first_value', 'windowFunnel', 'groupArrayLast'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
FUNC_TOKENS = {<TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UINT: 'UINT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INT: 'INT'>, <TokenType.XML: 'XML'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.DATE: 'DATE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.ILIKE: 'ILIKE'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.IPV6: 'IPV6'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT256: 'INT256'>, <TokenType.SOME: 'SOME'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.IPV4: 'IPV4'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.RLIKE: 'RLIKE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.SUPER: 'SUPER'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.LIKE: 'LIKE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.VAR: 'VAR'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.MONEY: 'MONEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.ROW: 'ROW'>, <TokenType.TIME: 'TIME'>, <TokenType.NAME: 'NAME'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.GLOB: 'GLOB'>, <TokenType.INT128: 'INT128'>, <TokenType.XOR: 'XOR'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.LIST: 'LIST'>, <TokenType.UINT256: 'UINT256'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.INSERT: 'INSERT'>, <TokenType.SET: 'SET'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.FILTER: 'FILTER'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NESTED: 'NESTED'>, <TokenType.UUID: 'UUID'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.ALL: 'ALL'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.JSON: 'JSON'>, <TokenType.JSONB: 'JSONB'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.NULL: 'NULL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.ANY: 'ANY'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.BINARY: 'BINARY'>, <TokenType.MERGE: 'MERGE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.UINT128: 'UINT128'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.INET: 'INET'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.BIGINT: 'BIGINT'>}
AGG_FUNC_MAPPING = {'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'skewPopIf': ('skewPop', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'sequenceMatchIf': ('sequenceMatch', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'countIf': ('count', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'exponentialTimeDecayedAvgIf': ('exponentialTimeDecayedAvg', 'If'), 'covarPopIf': ('covarPop', 'If'), 'cramersVIf': ('cramersV', 'If'), 'theilsUIf': ('theilsU', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'sumMapIf': ('sumMap', 'If'), 'anyIf': ('any', 'If'), 'corrIf': ('corr', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'contingencyIf': ('contingency', 'If'), 'sequenceNextNodeIf': ('sequenceNextNode', 'If'), 'avgIf': ('avg', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'varPopIf': ('varPop', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'histogramIf': ('histogram', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'quantileTimingIf': ('quantileTiming', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'anyLastIf': ('anyLast', 'If'), 'sumCountIf': ('sumCount', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'maxIf': ('max', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'varSampIf': ('varSamp', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'minIf': ('min', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'topKIf': ('topK', 'If'), 'quantileIf': ('quantile', 'If'), 'sequenceCountIf': ('sequenceCount', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'argMinIf': ('argMin', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'sumIf': ('sum', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'quantilesIf': ('quantiles', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'maxMapIf': ('maxMap', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'retentionIf': ('retention', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'uniqUpToIf': ('uniqUpTo', 'If'), 'uniqIf': ('uniq', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'argMaxIf': ('argMax', 'If'), 'medianIf': ('median', 'If'), 'last_valueIf': ('last_value', 'If'), 'minMapIf': ('minMap', 'If'), 'entropyIf': ('entropy', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'first_valueIf': ('first_value', 'If'), 'windowFunnelIf': ('windowFunnel', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'sequenceMatchArray': ('sequenceMatch', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'countArray': ('count', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'exponentialTimeDecayedAvgArray': ('exponentialTimeDecayedAvg', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'anyArray': ('any', 'Array'), 'corrArray': ('corr', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'sequenceNextNodeArray': ('sequenceNextNode', 'Array'), 'avgArray': ('avg', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'varPopArray': ('varPop', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'histogramArray': ('histogram', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'maxArray': ('max', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'minArray': ('min', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'topKArray': ('topK', 'Array'), 'quantileArray': ('quantile', 'Array'), 'sequenceCountArray': ('sequenceCount', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'argMinArray': ('argMin', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'sumArray': ('sum', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'retentionArray': ('retention', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'uniqUpToArray': ('uniqUpTo', 'Array'), 'uniqArray': ('uniq', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'medianArray': ('median', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'minMapArray': ('minMap', 'Array'), 'entropyArray': ('entropy', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'windowFunnelArray': ('windowFunnel', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'sequenceMatchArrayIf': ('sequenceMatch', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'exponentialTimeDecayedAvgArrayIf': ('exponentialTimeDecayedAvg', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'sequenceNextNodeArrayIf': ('sequenceNextNode', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'histogramArrayIf': ('histogram', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'sequenceCountArrayIf': ('sequenceCount', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'retentionArrayIf': ('retention', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'uniqUpToArrayIf': ('uniqUpTo', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'windowFunnelArrayIf': ('windowFunnel', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'sequenceMatchMap': ('sequenceMatch', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'countMap': ('count', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'exponentialTimeDecayedAvgMap': ('exponentialTimeDecayedAvg', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'anyMap': ('any', 'Map'), 'corrMap': ('corr', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'sequenceNextNodeMap': ('sequenceNextNode', 'Map'), 'avgMap': ('avg', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'varPopMap': ('varPop', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'histogramMap': ('histogram', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'maxMap': ('maxMap', ''), 'sumKahanMap': ('sumKahan', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'minMap': ('minMap', ''), 'quantilesGKMap': ('quantilesGK', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'topKMap': ('topK', 'Map'), 'quantileMap': ('quantile', 'Map'), 'sequenceCountMap': ('sequenceCount', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'argMinMap': ('argMin', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'sumMap': ('sumMap', ''), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'retentionMap': ('retention', 'Map'), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'uniqUpToMap': ('uniqUpTo', 'Map'), 'uniqMap': ('uniq', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'argMaxMap': ('argMax', 'Map'), 'medianMap': ('median', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'minMapMap': ('minMap', 'Map'), 'entropyMap': ('entropy', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'windowFunnelMap': ('windowFunnel', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'sequenceMatchSimpleState': ('sequenceMatch', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'exponentialTimeDecayedAvgSimpleState': ('exponentialTimeDecayedAvg', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'sequenceNextNodeSimpleState': ('sequenceNextNode', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'histogramSimpleState': ('histogram', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'sequenceCountSimpleState': ('sequenceCount', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'retentionSimpleState': ('retention', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'uniqUpToSimpleState': ('uniqUpTo', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'windowFunnelSimpleState': ('windowFunnel', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'skewPopState': ('skewPop', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'sequenceMatchState': ('sequenceMatch', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'countState': ('count', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'exponentialTimeDecayedAvgState': ('exponentialTimeDecayedAvg', 'State'), 'covarPopState': ('covarPop', 'State'), 'cramersVState': ('cramersV', 'State'), 'theilsUState': ('theilsU', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'sumMapState': ('sumMap', 'State'), 'anyState': ('any', 'State'), 'corrState': ('corr', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'covarSampState': ('covarSamp', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'contingencyState': ('contingency', 'State'), 'sequenceNextNodeState': ('sequenceNextNode', 'State'), 'avgState': ('avg', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'varPopState': ('varPop', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'histogramState': ('histogram', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'groupArrayState': ('groupArray', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'quantileTimingState': ('quantileTiming', 'State'), 'skewSampState': ('skewSamp', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'anyLastState': ('anyLast', 'State'), 'sumCountState': ('sumCount', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'maxState': ('max', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'varSampState': ('varSamp', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'minState': ('min', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'topKState': ('topK', 'State'), 'quantileState': ('quantile', 'State'), 'sequenceCountState': ('sequenceCount', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'argMinState': ('argMin', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'sumState': ('sum', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'quantilesState': ('quantiles', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'maxMapState': ('maxMap', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'retentionState': ('retention', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'uniqUpToState': ('uniqUpTo', 'State'), 'uniqState': ('uniq', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'argMaxState': ('argMax', 'State'), 'medianState': ('median', 'State'), 'last_valueState': ('last_value', 'State'), 'minMapState': ('minMap', 'State'), 'entropyState': ('entropy', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'first_valueState': ('first_value', 'State'), 'windowFunnelState': ('windowFunnel', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'sequenceMatchMerge': ('sequenceMatch', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'countMerge': ('count', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'exponentialTimeDecayedAvgMerge': ('exponentialTimeDecayedAvg', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'anyMerge': ('any', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'sequenceNextNodeMerge': ('sequenceNextNode', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'histogramMerge': ('histogram', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'maxMerge': ('max', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'minMerge': ('min', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'sequenceCountMerge': ('sequenceCount', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'retentionMerge': ('retention', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'uniqUpToMerge': ('uniqUpTo', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'medianMerge': ('median', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'windowFunnelMerge': ('windowFunnel', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'sequenceMatchMergeState': ('sequenceMatch', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'exponentialTimeDecayedAvgMergeState': ('exponentialTimeDecayedAvg', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'sequenceNextNodeMergeState': ('sequenceNextNode', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'histogramMergeState': ('histogram', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'sequenceCountMergeState': ('sequenceCount', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'retentionMergeState': ('retention', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'uniqUpToMergeState': ('uniqUpTo', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'windowFunnelMergeState': ('windowFunnel', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'sequenceMatchForEach': ('sequenceMatch', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'exponentialTimeDecayedAvgForEach': ('exponentialTimeDecayedAvg', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'sequenceNextNodeForEach': ('sequenceNextNode', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'histogramForEach': ('histogram', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'sequenceCountForEach': ('sequenceCount', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'retentionForEach': ('retention', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'uniqUpToForEach': ('uniqUpTo', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'windowFunnelForEach': ('windowFunnel', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'sequenceMatchDistinct': ('sequenceMatch', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'exponentialTimeDecayedAvgDistinct': ('exponentialTimeDecayedAvg', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'sequenceNextNodeDistinct': ('sequenceNextNode', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'histogramDistinct': ('histogram', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'sequenceCountDistinct': ('sequenceCount', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'retentionDistinct': ('retention', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'uniqUpToDistinct': ('uniqUpTo', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'windowFunnelDistinct': ('windowFunnel', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'sequenceMatchOrDefault': ('sequenceMatch', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'exponentialTimeDecayedAvgOrDefault': ('exponentialTimeDecayedAvg', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'sequenceNextNodeOrDefault': ('sequenceNextNode', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'histogramOrDefault': ('histogram', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'sequenceCountOrDefault': ('sequenceCount', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'retentionOrDefault': ('retention', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'uniqUpToOrDefault': ('uniqUpTo', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'windowFunnelOrDefault': ('windowFunnel', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'sequenceMatchOrNull': ('sequenceMatch', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'exponentialTimeDecayedAvgOrNull': ('exponentialTimeDecayedAvg', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'sequenceNextNodeOrNull': ('sequenceNextNode', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'histogramOrNull': ('histogram', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'sequenceCountOrNull': ('sequenceCount', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'retentionOrNull': ('retention', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'uniqUpToOrNull': ('uniqUpTo', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'windowFunnelOrNull': ('windowFunnel', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'sequenceMatchResample': ('sequenceMatch', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'countResample': ('count', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'exponentialTimeDecayedAvgResample': ('exponentialTimeDecayedAvg', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'anyResample': ('any', 'Resample'), 'corrResample': ('corr', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'sequenceNextNodeResample': ('sequenceNextNode', 'Resample'), 'avgResample': ('avg', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'histogramResample': ('histogram', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'maxResample': ('max', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'minResample': ('min', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'topKResample': ('topK', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'sequenceCountResample': ('sequenceCount', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'sumResample': ('sum', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'retentionResample': ('retention', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'uniqUpToResample': ('uniqUpTo', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'medianResample': ('median', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'windowFunnelResample': ('windowFunnel', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'sequenceMatchArgMin': ('sequenceMatch', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'exponentialTimeDecayedAvgArgMin': ('exponentialTimeDecayedAvg', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'sequenceNextNodeArgMin': ('sequenceNextNode', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'histogramArgMin': ('histogram', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'sequenceCountArgMin': ('sequenceCount', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'retentionArgMin': ('retention', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'uniqUpToArgMin': ('uniqUpTo', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'windowFunnelArgMin': ('windowFunnel', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'sequenceMatchArgMax': ('sequenceMatch', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'exponentialTimeDecayedAvgArgMax': ('exponentialTimeDecayedAvg', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'sequenceNextNodeArgMax': ('sequenceNextNode', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'histogramArgMax': ('histogram', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'sequenceCountArgMax': ('sequenceCount', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'retentionArgMax': ('retention', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'uniqUpToArgMax': ('uniqUpTo', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'windowFunnelArgMax': ('windowFunnel', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'groupBitXor': ('groupBitXor', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'meanZTest': ('meanZTest', ''), 'boundingRatio': ('boundingRatio', ''), 'skewPop': ('skewPop', ''), 'avgWeighted': ('avgWeighted', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'sparkBar': ('sparkBar', ''), 'uniqCombined64': ('uniqCombined64', ''), 'kurtSamp': ('kurtSamp', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'sequenceMatch': ('sequenceMatch', ''), 'stddevPop': ('stddevPop', ''), 'groupBitOr': ('groupBitOr', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'count': ('count', ''), 'maxIntersections': ('maxIntersections', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'exponentialTimeDecayedAvg': ('exponentialTimeDecayedAvg', ''), 'covarPop': ('covarPop', ''), 'cramersV': ('cramersV', ''), 'theilsU': ('theilsU', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'any': ('any', ''), 'corr': ('corr', ''), 'quantileExact': ('quantileExact', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'quantilesExact': ('quantilesExact', ''), 'studentTTest': ('studentTTest', ''), 'uniqCombined': ('uniqCombined', ''), 'covarSamp': ('covarSamp', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'contingency': ('contingency', ''), 'sequenceNextNode': ('sequenceNextNode', ''), 'avg': ('avg', ''), 'groupBitmap': ('groupBitmap', ''), 'quantileExactLow': ('quantileExactLow', ''), 'varPop': ('varPop', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'histogram': ('histogram', ''), 'deltaSum': ('deltaSum', ''), 'kurtPop': ('kurtPop', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'groupArray': ('groupArray', ''), 'quantileGK': ('quantileGK', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'quantileTDigest': ('quantileTDigest', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'quantileTiming': ('quantileTiming', ''), 'skewSamp': ('skewSamp', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'anyLast': ('anyLast', ''), 'sumCount': ('sumCount', ''), 'anyHeavy': ('anyHeavy', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'max': ('max', ''), 'sumKahan': ('sumKahan', ''), 'uniqExact': ('uniqExact', ''), 'groupArraySample': ('groupArraySample', ''), 'uniqHLL12': ('uniqHLL12', ''), 'varSamp': ('varSamp', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'welchTTest': ('welchTTest', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'min': ('min', ''), 'quantilesGK': ('quantilesGK', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'topK': ('topK', ''), 'quantile': ('quantile', ''), 'sequenceCount': ('sequenceCount', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'argMin': ('argMin', ''), 'groupBitAnd': ('groupBitAnd', ''), 'sum': ('sum', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'topKWeighted': ('topKWeighted', ''), 'groupUniqArray': ('groupUniqArray', ''), 'quantilesTiming': ('quantilesTiming', ''), 'quantiles': ('quantiles', ''), 'stddevSamp': ('stddevSamp', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'retention': ('retention', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'uniqUpTo': ('uniqUpTo', ''), 'uniq': ('uniq', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'argMax': ('argMax', ''), 'median': ('median', ''), 'last_value': ('last_value', ''), 'entropy': ('entropy', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'uniqTheta': ('uniqTheta', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'rankCorr': ('rankCorr', ''), 'first_value': ('first_value', ''), 'windowFunnel': ('windowFunnel', ''), 'groupArrayLast': ('groupArrayLast', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'TUPLE', 'STRUCT'}
FUNCTION_PARSERS = {'CAST': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <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.OUTER: 'OUTER'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.ASOF: 'ASOF'>, <TokenType.ANTI: 'ANTI'>, <TokenType.CROSS: 'CROSS'>, <TokenType.INNER: 'INNER'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.SEMI: 'SEMI'>, <TokenType.ANY: 'ANY'>}
TABLE_ALIAS_TOKENS = {<TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.UINT: 'UINT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INT: 'INT'>, <TokenType.XML: 'XML'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.USE: 'USE'>, <TokenType.DATE: 'DATE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.DIV: 'DIV'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.IPV6: 'IPV6'>, <TokenType.COPY: 'COPY'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.SOME: 'SOME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT256: 'INT256'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ASC: 'ASC'>, <TokenType.CHAR: 'CHAR'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.IPV4: 'IPV4'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.CASE: 'CASE'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.SUPER: 'SUPER'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.LOAD: 'LOAD'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.END: 'END'>, <TokenType.CACHE: 'CACHE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.FALSE: 'FALSE'>, <TokenType.VAR: 'VAR'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.MONEY: 'MONEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.ROW: 'ROW'>, <TokenType.TIME: 'TIME'>, <TokenType.NAME: 'NAME'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.INT128: 'INT128'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TAG: 'TAG'>, <TokenType.LIST: 'LIST'>, <TokenType.UINT256: 'UINT256'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.VIEW: 'VIEW'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.SET: 'SET'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.RANGE: 'RANGE'>, <TokenType.IS: 'IS'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TOP: 'TOP'>, <TokenType.FILTER: 'FILTER'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NESTED: 'NESTED'>, <TokenType.DESC: 'DESC'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.ALL: 'ALL'>, <TokenType.UUID: 'UUID'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.MODEL: 'MODEL'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.JSON: 'JSON'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.ROWS: 'ROWS'>, <TokenType.DELETE: 'DELETE'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.NULL: 'NULL'>, <TokenType.KILL: 'KILL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.TRUE: 'TRUE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.BINARY: 'BINARY'>, <TokenType.MERGE: 'MERGE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.UINT128: 'UINT128'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.INET: 'INET'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.BIGINT: 'BIGINT'>}
ALIAS_TOKENS = {<TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ASOF: 'ASOF'>, <TokenType.UINT: 'UINT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INT: 'INT'>, <TokenType.XML: 'XML'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.USE: 'USE'>, <TokenType.DATE: 'DATE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.DIV: 'DIV'>, <TokenType.SEMI: 'SEMI'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.FINAL: 'FINAL'>, <TokenType.IPV6: 'IPV6'>, <TokenType.COPY: 'COPY'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.SOME: 'SOME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT256: 'INT256'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ASC: 'ASC'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.IPV4: 'IPV4'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.CASE: 'CASE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.SUPER: 'SUPER'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.LOAD: 'LOAD'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.END: 'END'>, <TokenType.CACHE: 'CACHE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.FALSE: 'FALSE'>, <TokenType.VAR: 'VAR'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.MONEY: 'MONEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.ROW: 'ROW'>, <TokenType.TIME: 'TIME'>, <TokenType.NAME: 'NAME'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.INT128: 'INT128'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TAG: 'TAG'>, <TokenType.LIST: 'LIST'>, <TokenType.UINT256: 'UINT256'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.VIEW: 'VIEW'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.SET: 'SET'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.RANGE: 'RANGE'>, <TokenType.IS: 'IS'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.FULL: 'FULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TOP: 'TOP'>, <TokenType.FILTER: 'FILTER'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NESTED: 'NESTED'>, <TokenType.DESC: 'DESC'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.ALL: 'ALL'>, <TokenType.UUID: 'UUID'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.MODEL: 'MODEL'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.JSON: 'JSON'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.ROWS: 'ROWS'>, <TokenType.APPLY: 'APPLY'>, <TokenType.DELETE: 'DELETE'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.NULL: 'NULL'>, <TokenType.KILL: 'KILL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.ANY: 'ANY'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.TRUE: 'TRUE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.BINARY: 'BINARY'>, <TokenType.MERGE: 'MERGE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.UINT128: 'UINT128'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ANTI: 'ANTI'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.INET: 'INET'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.BIGINT: 'BIGINT'>}
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', 'PRIMARY KEY', 'PERIOD', 'EXCLUDE', 'LIKE', 'CHECK', 'FOREIGN KEY', 'INDEX'}
ID_VAR_TOKENS = {<TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.ASOF: 'ASOF'>, <TokenType.UINT: 'UINT'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.INT: 'INT'>, <TokenType.XML: 'XML'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TABLE: 'TABLE'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.USE: 'USE'>, <TokenType.DATE: 'DATE'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.DIV: 'DIV'>, <TokenType.SEMI: 'SEMI'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.FINAL: 'FINAL'>, <TokenType.IPV6: 'IPV6'>, <TokenType.COPY: 'COPY'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.SOME: 'SOME'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.INT256: 'INT256'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.ASC: 'ASC'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.CHAR: 'CHAR'>, <TokenType.WINDOW: 'WINDOW'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.LEFT: 'LEFT'>, <TokenType.IPV4: 'IPV4'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.CASE: 'CASE'>, <TokenType.SETTINGS: 'SETTINGS'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.NEXT: 'NEXT'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.SUPER: 'SUPER'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.LOAD: 'LOAD'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.END: 'END'>, <TokenType.CACHE: 'CACHE'>, <TokenType.KEEP: 'KEEP'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.RIGHT: 'RIGHT'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.FALSE: 'FALSE'>, <TokenType.VAR: 'VAR'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.MONEY: 'MONEY'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.DATE32: 'DATE32'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.BIT: 'BIT'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.IDENTIFIER: 'IDENTIFIER'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.ROW: 'ROW'>, <TokenType.TIME: 'TIME'>, <TokenType.NAME: 'NAME'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.STREAMLIT: 'STREAMLIT'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.MAP: 'MAP'>, <TokenType.INT128: 'INT128'>, <TokenType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <TokenType.SHOW: 'SHOW'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TAG: 'TAG'>, <TokenType.LIST: 'LIST'>, <TokenType.UINT256: 'UINT256'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.VIEW: 'VIEW'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.SET: 'SET'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.STRAIGHT_JOIN: 'STRAIGHT_JOIN'>, <TokenType.RANGE: 'RANGE'>, <TokenType.IS: 'IS'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.ENUM: 'ENUM'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.FULL: 'FULL'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TOP: 'TOP'>, <TokenType.FILTER: 'FILTER'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.NESTED: 'NESTED'>, <TokenType.DESC: 'DESC'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.ALL: 'ALL'>, <TokenType.UUID: 'UUID'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.NATURAL: 'NATURAL'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.MODEL: 'MODEL'>, <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.JSON: 'JSON'>, <TokenType.WAREHOUSE: 'WAREHOUSE'>, <TokenType.JSONB: 'JSONB'>, <TokenType.ROWS: 'ROWS'>, <TokenType.APPLY: 'APPLY'>, <TokenType.DELETE: 'DELETE'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.TDIGEST: 'TDIGEST'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.TEXT: 'TEXT'>, <TokenType.NULL: 'NULL'>, <TokenType.KILL: 'KILL'>, <TokenType.YEAR: 'YEAR'>, <TokenType.ANY: 'ANY'>, <TokenType.OFFSET: 'OFFSET'>, <TokenType.ROLLUP: 'ROLLUP'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.TRUE: 'TRUE'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.BINARY: 'BINARY'>, <TokenType.MERGE: 'MERGE'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.UINT128: 'UINT128'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.FORMAT: 'FORMAT'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.UNNEST: 'UNNEST'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.ANTI: 'ANTI'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.INET: 'INET'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.BIGINT: 'BIGINT'>}
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
INSERT_ALTERNATIVES
CLONE_KEYWORDS
HISTORICAL_DATA_KIND
OPCLASS_FOLLOW_KEYWORDS
OPTYPE_FOLLOW_TOKENS
TABLE_INDEX_HINT_TOKENS
VIEW_ATTRIBUTES
WINDOW_ALIAS_TOKENS
WINDOW_BEFORE_PAREN_TOKENS
WINDOW_SIDES
JSON_KEY_VALUE_SEPARATOR_TOKENS
FETCH_TOKENS
ADD_CONSTRAINT_TOKENS
DISTINCT_TOKENS
NULL_TOKENS
UNNEST_OFFSET_ALIAS_TOKENS
SELECT_START_TOKENS
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_JSON_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):
672    class Generator(generator.Generator):
673        QUERY_HINTS = False
674        STRUCT_DELIMITER = ("(", ")")
675        NVL2_SUPPORTED = False
676        TABLESAMPLE_REQUIRES_PARENS = False
677        TABLESAMPLE_SIZE_IS_ROWS = False
678        TABLESAMPLE_KEYWORDS = "SAMPLE"
679        LAST_DAY_SUPPORTS_DATE_PART = False
680        CAN_IMPLEMENT_ARRAY_ANY = True
681        SUPPORTS_TO_NUMBER = False
682        JOIN_HINTS = False
683        TABLE_HINTS = False
684        EXPLICIT_SET_OP = True
685        GROUPINGS_SEP = ""
686        SET_OP_MODIFIERS = False
687
688        STRING_TYPE_MAPPING = {
689            exp.DataType.Type.CHAR: "String",
690            exp.DataType.Type.LONGBLOB: "String",
691            exp.DataType.Type.LONGTEXT: "String",
692            exp.DataType.Type.MEDIUMBLOB: "String",
693            exp.DataType.Type.MEDIUMTEXT: "String",
694            exp.DataType.Type.TINYBLOB: "String",
695            exp.DataType.Type.TINYTEXT: "String",
696            exp.DataType.Type.TEXT: "String",
697            exp.DataType.Type.VARBINARY: "String",
698            exp.DataType.Type.VARCHAR: "String",
699        }
700
701        SUPPORTED_JSON_PATH_PARTS = {
702            exp.JSONPathKey,
703            exp.JSONPathRoot,
704            exp.JSONPathSubscript,
705        }
706
707        TYPE_MAPPING = {
708            **generator.Generator.TYPE_MAPPING,
709            **STRING_TYPE_MAPPING,
710            exp.DataType.Type.ARRAY: "Array",
711            exp.DataType.Type.BIGINT: "Int64",
712            exp.DataType.Type.DATE32: "Date32",
713            exp.DataType.Type.DATETIME64: "DateTime64",
714            exp.DataType.Type.DOUBLE: "Float64",
715            exp.DataType.Type.ENUM: "Enum",
716            exp.DataType.Type.ENUM8: "Enum8",
717            exp.DataType.Type.ENUM16: "Enum16",
718            exp.DataType.Type.FIXEDSTRING: "FixedString",
719            exp.DataType.Type.FLOAT: "Float32",
720            exp.DataType.Type.INT: "Int32",
721            exp.DataType.Type.MEDIUMINT: "Int32",
722            exp.DataType.Type.INT128: "Int128",
723            exp.DataType.Type.INT256: "Int256",
724            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
725            exp.DataType.Type.MAP: "Map",
726            exp.DataType.Type.NESTED: "Nested",
727            exp.DataType.Type.NULLABLE: "Nullable",
728            exp.DataType.Type.SMALLINT: "Int16",
729            exp.DataType.Type.STRUCT: "Tuple",
730            exp.DataType.Type.TINYINT: "Int8",
731            exp.DataType.Type.UBIGINT: "UInt64",
732            exp.DataType.Type.UINT: "UInt32",
733            exp.DataType.Type.UINT128: "UInt128",
734            exp.DataType.Type.UINT256: "UInt256",
735            exp.DataType.Type.USMALLINT: "UInt16",
736            exp.DataType.Type.UTINYINT: "UInt8",
737            exp.DataType.Type.IPV4: "IPv4",
738            exp.DataType.Type.IPV6: "IPv6",
739            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
740            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
741        }
742
743        TRANSFORMS = {
744            **generator.Generator.TRANSFORMS,
745            exp.AnyValue: rename_func("any"),
746            exp.ApproxDistinct: rename_func("uniq"),
747            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
748            exp.ArraySize: rename_func("LENGTH"),
749            exp.ArraySum: rename_func("arraySum"),
750            exp.ArgMax: arg_max_or_min_no_count("argMax"),
751            exp.ArgMin: arg_max_or_min_no_count("argMin"),
752            exp.Array: inline_array_sql,
753            exp.CastToStrType: rename_func("CAST"),
754            exp.CountIf: rename_func("countIf"),
755            exp.CompressColumnConstraint: lambda self,
756            e: f"CODEC({self.expressions(e, key='this', flat=True)})",
757            exp.ComputedColumnConstraint: lambda self,
758            e: f"{'MATERIALIZED' if e.args.get('persisted') else 'ALIAS'} {self.sql(e, 'this')}",
759            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
760            exp.DateAdd: _datetime_delta_sql("DATE_ADD"),
761            exp.DateDiff: _datetime_delta_sql("DATE_DIFF"),
762            exp.DateSub: _datetime_delta_sql("DATE_SUB"),
763            exp.Explode: rename_func("arrayJoin"),
764            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
765            exp.IsNan: rename_func("isNaN"),
766            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
767            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
768            exp.JSONPathKey: json_path_key_only_name,
769            exp.JSONPathRoot: lambda *_: "",
770            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
771            exp.Nullif: rename_func("nullIf"),
772            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
773            exp.Pivot: no_pivot_sql,
774            exp.Quantile: _quantile_sql,
775            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
776            exp.Rand: rename_func("randCanonical"),
777            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
778            exp.StartsWith: rename_func("startsWith"),
779            exp.StrPosition: lambda self, e: self.func(
780                "position", e.this, e.args.get("substr"), e.args.get("position")
781            ),
782            exp.TimeToStr: lambda self, e: self.func(
783                "DATE_FORMAT", e.this, self.format_time(e), e.args.get("timezone")
784            ),
785            exp.TimestampAdd: _datetime_delta_sql("TIMESTAMP_ADD"),
786            exp.TimestampSub: _datetime_delta_sql("TIMESTAMP_SUB"),
787            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
788            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
789            exp.MD5Digest: rename_func("MD5"),
790            exp.MD5: lambda self, e: self.func("LOWER", self.func("HEX", self.func("MD5", e.this))),
791            exp.SHA: rename_func("SHA1"),
792            exp.SHA2: sha256_sql,
793            exp.UnixToTime: _unix_to_time_sql,
794            exp.TimestampTrunc: timestamptrunc_sql(zone=True),
795            exp.Variance: rename_func("varSamp"),
796            exp.Stddev: rename_func("stddevSamp"),
797        }
798
799        PROPERTIES_LOCATION = {
800            **generator.Generator.PROPERTIES_LOCATION,
801            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
802            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
803            exp.OnCluster: exp.Properties.Location.POST_NAME,
804        }
805
806        # there's no list in docs, but it can be found in Clickhouse code
807        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
808        ON_CLUSTER_TARGETS = {
809            "DATABASE",
810            "TABLE",
811            "VIEW",
812            "DICTIONARY",
813            "INDEX",
814            "FUNCTION",
815            "NAMED COLLECTION",
816        }
817
818        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
819            this = self.json_path_part(expression.this)
820            return str(int(this) + 1) if is_int(this) else this
821
822        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
823            return f"AS {self.sql(expression, 'this')}"
824
825        def _any_to_has(
826            self,
827            expression: exp.EQ | exp.NEQ,
828            default: t.Callable[[t.Any], str],
829            prefix: str = "",
830        ) -> str:
831            if isinstance(expression.left, exp.Any):
832                arr = expression.left
833                this = expression.right
834            elif isinstance(expression.right, exp.Any):
835                arr = expression.right
836                this = expression.left
837            else:
838                return default(expression)
839
840            return prefix + self.func("has", arr.this.unnest(), this)
841
842        def eq_sql(self, expression: exp.EQ) -> str:
843            return self._any_to_has(expression, super().eq_sql)
844
845        def neq_sql(self, expression: exp.NEQ) -> str:
846            return self._any_to_has(expression, super().neq_sql, "NOT ")
847
848        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
849            # Manually add a flag to make the search case-insensitive
850            regex = self.func("CONCAT", "'(?i)'", expression.expression)
851            return self.func("match", expression.this, regex)
852
853        def datatype_sql(self, expression: exp.DataType) -> str:
854            # String is the standard ClickHouse type, every other variant is just an alias.
855            # Additionally, any supplied length parameter will be ignored.
856            #
857            # https://clickhouse.com/docs/en/sql-reference/data-types/string
858            if expression.this in self.STRING_TYPE_MAPPING:
859                return "String"
860
861            return super().datatype_sql(expression)
862
863        def cte_sql(self, expression: exp.CTE) -> str:
864            if expression.args.get("scalar"):
865                this = self.sql(expression, "this")
866                alias = self.sql(expression, "alias")
867                return f"{this} AS {alias}"
868
869            return super().cte_sql(expression)
870
871        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
872            return super().after_limit_modifiers(expression) + [
873                (
874                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
875                    if expression.args.get("settings")
876                    else ""
877                ),
878                (
879                    self.seg("FORMAT ") + self.sql(expression, "format")
880                    if expression.args.get("format")
881                    else ""
882                ),
883            ]
884
885        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
886            params = self.expressions(expression, key="params", flat=True)
887            return self.func(expression.name, *expression.expressions) + f"({params})"
888
889        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
890            return self.func(expression.name, *expression.expressions)
891
892        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
893            return self.anonymousaggfunc_sql(expression)
894
895        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
896            return self.parameterizedagg_sql(expression)
897
898        def placeholder_sql(self, expression: exp.Placeholder) -> str:
899            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
900
901        def oncluster_sql(self, expression: exp.OnCluster) -> str:
902            return f"ON CLUSTER {self.sql(expression, 'this')}"
903
904        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
905            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
906                exp.Properties.Location.POST_NAME
907            ):
908                this_name = self.sql(expression.this, "this")
909                this_properties = " ".join(
910                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
911                )
912                this_schema = self.schema_columns_sql(expression.this)
913                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
914
915            return super().createable_sql(expression, locations)
916
917        def prewhere_sql(self, expression: exp.PreWhere) -> str:
918            this = self.indent(self.sql(expression, "this"))
919            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
920
921        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
922            this = self.sql(expression, "this")
923            this = f" {this}" if this else ""
924            expr = self.sql(expression, "expression")
925            expr = f" {expr}" if expr else ""
926            index_type = self.sql(expression, "index_type")
927            index_type = f" TYPE {index_type}" if index_type else ""
928            granularity = self.sql(expression, "granularity")
929            granularity = f" GRANULARITY {granularity}" if granularity else ""
930
931            return f"INDEX{this}{expr}{index_type}{granularity}"
932
933        def partition_sql(self, expression: exp.Partition) -> str:
934            return f"PARTITION {self.expressions(expression, flat=True)}"
935
936        def partitionid_sql(self, expression: exp.PartitionId) -> str:
937            return f"ID {self.sql(expression.this)}"
938
939        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
940            return (
941                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
942            )
943
944        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
945            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
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.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.WithSystemVersioningProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCluster'>: <Location.POST_NAME: 'POST_NAME'>}
ON_CLUSTER_TARGETS = {'DICTIONARY', 'VIEW', 'FUNCTION', 'TABLE', 'NAMED COLLECTION', 'INDEX', 'DATABASE'}
def likeproperty_sql(self, expression: sqlglot.expressions.LikeProperty) -> str:
822        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
823            return f"AS {self.sql(expression, 'this')}"
def eq_sql(self, expression: sqlglot.expressions.EQ) -> str:
842        def eq_sql(self, expression: exp.EQ) -> str:
843            return self._any_to_has(expression, super().eq_sql)
def neq_sql(self, expression: sqlglot.expressions.NEQ) -> str:
845        def neq_sql(self, expression: exp.NEQ) -> str:
846            return self._any_to_has(expression, super().neq_sql, "NOT ")
def regexpilike_sql(self, expression: sqlglot.expressions.RegexpILike) -> str:
848        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
849            # Manually add a flag to make the search case-insensitive
850            regex = self.func("CONCAT", "'(?i)'", expression.expression)
851            return self.func("match", expression.this, regex)
def datatype_sql(self, expression: sqlglot.expressions.DataType) -> str:
853        def datatype_sql(self, expression: exp.DataType) -> str:
854            # String is the standard ClickHouse type, every other variant is just an alias.
855            # Additionally, any supplied length parameter will be ignored.
856            #
857            # https://clickhouse.com/docs/en/sql-reference/data-types/string
858            if expression.this in self.STRING_TYPE_MAPPING:
859                return "String"
860
861            return super().datatype_sql(expression)
def cte_sql(self, expression: sqlglot.expressions.CTE) -> str:
863        def cte_sql(self, expression: exp.CTE) -> str:
864            if expression.args.get("scalar"):
865                this = self.sql(expression, "this")
866                alias = self.sql(expression, "alias")
867                return f"{this} AS {alias}"
868
869            return super().cte_sql(expression)
def after_limit_modifiers(self, expression: sqlglot.expressions.Expression) -> List[str]:
871        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
872            return super().after_limit_modifiers(expression) + [
873                (
874                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
875                    if expression.args.get("settings")
876                    else ""
877                ),
878                (
879                    self.seg("FORMAT ") + self.sql(expression, "format")
880                    if expression.args.get("format")
881                    else ""
882                ),
883            ]
def parameterizedagg_sql(self, expression: sqlglot.expressions.ParameterizedAgg) -> str:
885        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
886            params = self.expressions(expression, key="params", flat=True)
887            return self.func(expression.name, *expression.expressions) + f"({params})"
def anonymousaggfunc_sql(self, expression: sqlglot.expressions.AnonymousAggFunc) -> str:
889        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
890            return self.func(expression.name, *expression.expressions)
def combinedaggfunc_sql(self, expression: sqlglot.expressions.CombinedAggFunc) -> str:
892        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
893            return self.anonymousaggfunc_sql(expression)
def combinedparameterizedagg_sql(self, expression: sqlglot.expressions.CombinedParameterizedAgg) -> str:
895        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
896            return self.parameterizedagg_sql(expression)
def placeholder_sql(self, expression: sqlglot.expressions.Placeholder) -> str:
898        def placeholder_sql(self, expression: exp.Placeholder) -> str:
899            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
def oncluster_sql(self, expression: sqlglot.expressions.OnCluster) -> str:
901        def oncluster_sql(self, expression: exp.OnCluster) -> str:
902            return f"ON CLUSTER {self.sql(expression, 'this')}"
def createable_sql( self, expression: sqlglot.expressions.Create, locations: DefaultDict) -> str:
904        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
905            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
906                exp.Properties.Location.POST_NAME
907            ):
908                this_name = self.sql(expression.this, "this")
909                this_properties = " ".join(
910                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
911                )
912                this_schema = self.schema_columns_sql(expression.this)
913                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
914
915            return super().createable_sql(expression, locations)
def prewhere_sql(self, expression: sqlglot.expressions.PreWhere) -> str:
917        def prewhere_sql(self, expression: exp.PreWhere) -> str:
918            this = self.indent(self.sql(expression, "this"))
919            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
def indexcolumnconstraint_sql(self, expression: sqlglot.expressions.IndexColumnConstraint) -> str:
921        def indexcolumnconstraint_sql(self, expression: exp.IndexColumnConstraint) -> str:
922            this = self.sql(expression, "this")
923            this = f" {this}" if this else ""
924            expr = self.sql(expression, "expression")
925            expr = f" {expr}" if expr else ""
926            index_type = self.sql(expression, "index_type")
927            index_type = f" TYPE {index_type}" if index_type else ""
928            granularity = self.sql(expression, "granularity")
929            granularity = f" GRANULARITY {granularity}" if granularity else ""
930
931            return f"INDEX{this}{expr}{index_type}{granularity}"
def partition_sql(self, expression: sqlglot.expressions.Partition) -> str:
933        def partition_sql(self, expression: exp.Partition) -> str:
934            return f"PARTITION {self.expressions(expression, flat=True)}"
def partitionid_sql(self, expression: sqlglot.expressions.PartitionId) -> str:
936        def partitionid_sql(self, expression: exp.PartitionId) -> str:
937            return f"ID {self.sql(expression.this)}"
def replacepartition_sql(self, expression: sqlglot.expressions.ReplacePartition) -> str:
939        def replacepartition_sql(self, expression: exp.ReplacePartition) -> str:
940            return (
941                f"REPLACE {self.sql(expression.expression)} FROM {self.sql(expression, 'source')}"
942            )
def projectiondef_sql(self, expression: sqlglot.expressions.ProjectionDef) -> str:
944        def projectiondef_sql(self, expression: exp.ProjectionDef) -> str:
945            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
SUPPORTS_TABLE_ALIAS_COLUMNS
UNPIVOT_ALIASES_ARE_IDENTIFIERS
JSON_KEY_VALUE_PAIR_SEP
INSERT_OVERWRITE
SUPPORTS_SELECT_INTO
SUPPORTS_UNLOGGED_TABLES
SUPPORTS_CREATE_TABLE_LIKE
LIKE_PROPERTY_INSIDE_SCHEMA
MULTI_ARG_DISTINCT
JSON_TYPE_REQUIRED_FOR_EXTRACTION
JSON_PATH_BRACKETED_KEY_SUPPORTED
JSON_PATH_SINGLE_QUOTE_ESCAPE
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
strtodate_sql
strtotime_sql