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

Determines how function names are going to be normalized.

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

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

SAFE_DIVISION = True

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

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

Mapping of an unescaped escape sequence to the corresponding character.

tokenizer_class = <class 'ClickHouse.Tokenizer'>
parser_class = <class 'ClickHouse.Parser'>
generator_class = <class 'ClickHouse.Generator'>
TIME_TRIE: Dict = {}
FORMAT_TRIE: Dict = {}
INVERSE_TIME_MAPPING: Dict[str, str] = {}
INVERSE_TIME_TRIE: Dict = {}
INVERSE_ESCAPE_SEQUENCES: Dict[str, str] = {'\x00': '\\0'}
QUOTE_START = "'"
QUOTE_END = "'"
IDENTIFIER_START = '"'
IDENTIFIER_END = '"'
BIT_START: Optional[str] = '0b'
BIT_END: Optional[str] = ''
HEX_START: Optional[str] = '0x'
HEX_END: Optional[str] = ''
BYTE_START: Optional[str] = None
BYTE_END: Optional[str] = None
UNICODE_START: Optional[str] = None
UNICODE_END: Optional[str] = None
class ClickHouse.Tokenizer(sqlglot.tokens.Tokenizer):
56    class Tokenizer(tokens.Tokenizer):
57        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
58        IDENTIFIERS = ['"', "`"]
59        STRING_ESCAPES = ["'", "\\"]
60        BIT_STRINGS = [("0b", "")]
61        HEX_STRINGS = [("0x", ""), ("0X", "")]
62        HEREDOC_STRINGS = ["$"]
63
64        KEYWORDS = {
65            **tokens.Tokenizer.KEYWORDS,
66            "ATTACH": TokenType.COMMAND,
67            "DATETIME64": TokenType.DATETIME64,
68            "DICTIONARY": TokenType.DICTIONARY,
69            "ENUM": TokenType.ENUM,
70            "ENUM8": TokenType.ENUM8,
71            "ENUM16": TokenType.ENUM16,
72            "FINAL": TokenType.FINAL,
73            "FIXEDSTRING": TokenType.FIXEDSTRING,
74            "FLOAT32": TokenType.FLOAT,
75            "FLOAT64": TokenType.DOUBLE,
76            "GLOBAL": TokenType.GLOBAL,
77            "INT256": TokenType.INT256,
78            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
79            "MAP": TokenType.MAP,
80            "NESTED": TokenType.NESTED,
81            "SAMPLE": TokenType.TABLE_SAMPLE,
82            "TUPLE": TokenType.STRUCT,
83            "UINT128": TokenType.UINT128,
84            "UINT16": TokenType.USMALLINT,
85            "UINT256": TokenType.UINT256,
86            "UINT32": TokenType.UINT,
87            "UINT64": TokenType.UBIGINT,
88            "UINT8": TokenType.UTINYINT,
89        }
90
91        SINGLE_TOKENS = {
92            **tokens.Tokenizer.SINGLE_TOKENS,
93            "$": TokenType.HEREDOC_STRING,
94        }
COMMENTS = ['--', '#', '#!', ('/*', '*/')]
IDENTIFIERS = ['"', '`']
STRING_ESCAPES = ["'", '\\']
BIT_STRINGS = [('0b', '')]
HEX_STRINGS = [('0x', ''), ('0X', '')]
HEREDOC_STRINGS = ['$']
KEYWORDS = {'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, ':=': <TokenType.COLON_EQ: 'COLON_EQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'TRUNCATE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, "'": <TokenType.QUOTE: 'QUOTE'>, '`': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '"': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '#': <TokenType.HASH: 'HASH'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}
class ClickHouse.Parser(sqlglot.parser.Parser):
 96    class Parser(parser.Parser):
 97        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
 98        # * select x from t1 union all select x from t2 limit 1;
 99        # * select x from t1 union all (select x from t2 limit 1);
100        MODIFIERS_ATTACHED_TO_UNION = False
101
102        FUNCTIONS = {
103            **parser.Parser.FUNCTIONS,
104            "ANY": exp.AnyValue.from_arg_list,
105            "COUNTIF": _parse_count_if,
106            "DATE_ADD": lambda args: exp.DateAdd(
107                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
108            ),
109            "DATEADD": lambda args: exp.DateAdd(
110                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
111            ),
112            "DATE_DIFF": lambda args: exp.DateDiff(
113                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
114            ),
115            "DATEDIFF": lambda args: exp.DateDiff(
116                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
117            ),
118            "MAP": parse_var_map,
119            "MATCH": exp.RegexpLike.from_arg_list,
120            "RANDCANONICAL": exp.Rand.from_arg_list,
121            "UNIQ": exp.ApproxDistinct.from_arg_list,
122            "XOR": lambda args: exp.Xor(expressions=args),
123        }
124
125        AGG_FUNCTIONS = {
126            "count",
127            "min",
128            "max",
129            "sum",
130            "avg",
131            "any",
132            "stddevPop",
133            "stddevSamp",
134            "varPop",
135            "varSamp",
136            "corr",
137            "covarPop",
138            "covarSamp",
139            "entropy",
140            "exponentialMovingAverage",
141            "intervalLengthSum",
142            "kolmogorovSmirnovTest",
143            "mannWhitneyUTest",
144            "median",
145            "rankCorr",
146            "sumKahan",
147            "studentTTest",
148            "welchTTest",
149            "anyHeavy",
150            "anyLast",
151            "boundingRatio",
152            "first_value",
153            "last_value",
154            "argMin",
155            "argMax",
156            "avgWeighted",
157            "topK",
158            "topKWeighted",
159            "deltaSum",
160            "deltaSumTimestamp",
161            "groupArray",
162            "groupArrayLast",
163            "groupUniqArray",
164            "groupArrayInsertAt",
165            "groupArrayMovingAvg",
166            "groupArrayMovingSum",
167            "groupArraySample",
168            "groupBitAnd",
169            "groupBitOr",
170            "groupBitXor",
171            "groupBitmap",
172            "groupBitmapAnd",
173            "groupBitmapOr",
174            "groupBitmapXor",
175            "sumWithOverflow",
176            "sumMap",
177            "minMap",
178            "maxMap",
179            "skewSamp",
180            "skewPop",
181            "kurtSamp",
182            "kurtPop",
183            "uniq",
184            "uniqExact",
185            "uniqCombined",
186            "uniqCombined64",
187            "uniqHLL12",
188            "uniqTheta",
189            "quantile",
190            "quantiles",
191            "quantileExact",
192            "quantilesExact",
193            "quantileExactLow",
194            "quantilesExactLow",
195            "quantileExactHigh",
196            "quantilesExactHigh",
197            "quantileExactWeighted",
198            "quantilesExactWeighted",
199            "quantileTiming",
200            "quantilesTiming",
201            "quantileTimingWeighted",
202            "quantilesTimingWeighted",
203            "quantileDeterministic",
204            "quantilesDeterministic",
205            "quantileTDigest",
206            "quantilesTDigest",
207            "quantileTDigestWeighted",
208            "quantilesTDigestWeighted",
209            "quantileBFloat16",
210            "quantilesBFloat16",
211            "quantileBFloat16Weighted",
212            "quantilesBFloat16Weighted",
213            "simpleLinearRegression",
214            "stochasticLinearRegression",
215            "stochasticLogisticRegression",
216            "categoricalInformationValue",
217            "contingency",
218            "cramersV",
219            "cramersVBiasCorrected",
220            "theilsU",
221            "maxIntersections",
222            "maxIntersectionsPosition",
223            "meanZTest",
224            "quantileInterpolatedWeighted",
225            "quantilesInterpolatedWeighted",
226            "quantileGK",
227            "quantilesGK",
228            "sparkBar",
229            "sumCount",
230            "largestTriangleThreeBuckets",
231        }
232
233        AGG_FUNCTIONS_SUFFIXES = [
234            "If",
235            "Array",
236            "ArrayIf",
237            "Map",
238            "SimpleState",
239            "State",
240            "Merge",
241            "MergeState",
242            "ForEach",
243            "Distinct",
244            "OrDefault",
245            "OrNull",
246            "Resample",
247            "ArgMin",
248            "ArgMax",
249        ]
250
251        AGG_FUNC_MAPPING = (
252            lambda functions, suffixes: {
253                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
254            }
255        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
256
257        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
258
259        FUNCTION_PARSERS = {
260            **parser.Parser.FUNCTION_PARSERS,
261            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
262            "QUANTILE": lambda self: self._parse_quantile(),
263        }
264
265        FUNCTION_PARSERS.pop("MATCH")
266
267        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
268        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
269
270        RANGE_PARSERS = {
271            **parser.Parser.RANGE_PARSERS,
272            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
273            and self._parse_in(this, is_global=True),
274        }
275
276        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
277        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
278        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
279        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
280
281        JOIN_KINDS = {
282            *parser.Parser.JOIN_KINDS,
283            TokenType.ANY,
284            TokenType.ASOF,
285            TokenType.ARRAY,
286        }
287
288        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
289            TokenType.ANY,
290            TokenType.ARRAY,
291            TokenType.FINAL,
292            TokenType.FORMAT,
293            TokenType.SETTINGS,
294        }
295
296        LOG_DEFAULTS_TO_LN = True
297
298        QUERY_MODIFIER_PARSERS = {
299            **parser.Parser.QUERY_MODIFIER_PARSERS,
300            TokenType.SETTINGS: lambda self: (
301                "settings",
302                self._advance() or self._parse_csv(self._parse_conjunction),
303            ),
304            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
305        }
306
307        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
308            this = super()._parse_conjunction()
309
310            if self._match(TokenType.PLACEHOLDER):
311                return self.expression(
312                    exp.If,
313                    this=this,
314                    true=self._parse_conjunction(),
315                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
316                )
317
318            return this
319
320        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
321            """
322            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
323            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
324            """
325            if not self._match(TokenType.L_BRACE):
326                return None
327
328            this = self._parse_id_var()
329            self._match(TokenType.COLON)
330            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
331                self._match_text_seq("IDENTIFIER") and "Identifier"
332            )
333
334            if not kind:
335                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
336            elif not self._match(TokenType.R_BRACE):
337                self.raise_error("Expecting }")
338
339            return self.expression(exp.Placeholder, this=this, kind=kind)
340
341        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
342            this = super()._parse_in(this)
343            this.set("is_global", is_global)
344            return this
345
346        def _parse_table(
347            self,
348            schema: bool = False,
349            joins: bool = False,
350            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
351            parse_bracket: bool = False,
352        ) -> t.Optional[exp.Expression]:
353            this = super()._parse_table(
354                schema=schema, joins=joins, alias_tokens=alias_tokens, parse_bracket=parse_bracket
355            )
356
357            if self._match(TokenType.FINAL):
358                this = self.expression(exp.Final, this=this)
359
360            return this
361
362        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
363            return super()._parse_position(haystack_first=True)
364
365        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
366        def _parse_cte(self) -> exp.CTE:
367            index = self._index
368            try:
369                # WITH <identifier> AS <subquery expression>
370                return super()._parse_cte()
371            except ParseError:
372                # WITH <expression> AS <identifier>
373                self._retreat(index)
374
375                return self.expression(
376                    exp.CTE,
377                    this=self._parse_field(),
378                    alias=self._parse_table_alias(),
379                    scalar=True,
380                )
381
382        def _parse_join_parts(
383            self,
384        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
385            is_global = self._match(TokenType.GLOBAL) and self._prev
386            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
387
388            if kind_pre:
389                kind = self._match_set(self.JOIN_KINDS) and self._prev
390                side = self._match_set(self.JOIN_SIDES) and self._prev
391                return is_global, side, kind
392
393            return (
394                is_global,
395                self._match_set(self.JOIN_SIDES) and self._prev,
396                self._match_set(self.JOIN_KINDS) and self._prev,
397            )
398
399        def _parse_join(
400            self, skip_join_token: bool = False, parse_bracket: bool = False
401        ) -> t.Optional[exp.Join]:
402            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
403
404            if join:
405                join.set("global", join.args.pop("method", None))
406            return join
407
408        def _parse_function(
409            self,
410            functions: t.Optional[t.Dict[str, t.Callable]] = None,
411            anonymous: bool = False,
412            optional_parens: bool = True,
413        ) -> t.Optional[exp.Expression]:
414            func = super()._parse_function(
415                functions=functions, anonymous=anonymous, optional_parens=optional_parens
416            )
417
418            if isinstance(func, exp.Anonymous):
419                parts = self.AGG_FUNC_MAPPING.get(func.this)
420                params = self._parse_func_params(func)
421
422                if params:
423                    if parts and parts[1]:
424                        return self.expression(
425                            exp.CombinedParameterizedAgg,
426                            this=func.this,
427                            expressions=func.expressions,
428                            params=params,
429                            parts=parts,
430                        )
431                    return self.expression(
432                        exp.ParameterizedAgg,
433                        this=func.this,
434                        expressions=func.expressions,
435                        params=params,
436                    )
437
438                if parts:
439                    if parts[1]:
440                        return self.expression(
441                            exp.CombinedAggFunc,
442                            this=func.this,
443                            expressions=func.expressions,
444                            parts=parts,
445                        )
446                    return self.expression(
447                        exp.AnonymousAggFunc,
448                        this=func.this,
449                        expressions=func.expressions,
450                    )
451
452            return func
453
454        def _parse_func_params(
455            self, this: t.Optional[exp.Func] = None
456        ) -> t.Optional[t.List[exp.Expression]]:
457            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
458                return self._parse_csv(self._parse_lambda)
459
460            if self._match(TokenType.L_PAREN):
461                params = self._parse_csv(self._parse_lambda)
462                self._match_r_paren(this)
463                return params
464
465            return None
466
467        def _parse_quantile(self) -> exp.Quantile:
468            this = self._parse_lambda()
469            params = self._parse_func_params()
470            if params:
471                return self.expression(exp.Quantile, this=params[0], quantile=this)
472            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
473
474        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
475            return super()._parse_wrapped_id_vars(optional=True)
476
477        def _parse_primary_key(
478            self, wrapped_optional: bool = False, in_props: bool = False
479        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
480            return super()._parse_primary_key(
481                wrapped_optional=wrapped_optional or in_props, in_props=in_props
482            )
483
484        def _parse_on_property(self) -> t.Optional[exp.Expression]:
485            index = self._index
486            if self._match_text_seq("CLUSTER"):
487                this = self._parse_id_var()
488                if this:
489                    return self.expression(exp.OnCluster, this=this)
490                else:
491                    self._retreat(index)
492            return None

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

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

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

Arguments:
  • pretty: Whether or not to format the produced SQL string. Default: False.
  • identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
  • normalize: Whether or not to normalize identifiers to lowercase. Default: False.
  • pad: Determines the pad size in a formatted string. Default: 2.
  • indent: Determines the indentation size in a formatted string. Default: 2.
  • normalize_functions: Whether or not to normalize all function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
  • unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
  • max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
  • leading_comma: Determines whether or not the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
  • max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
  • comments: Whether or not to preserve comments in the output SQL code. Default: True
QUERY_HINTS = False
STRUCT_DELIMITER = ('(', ')')
NVL2_SUPPORTED = False
TABLESAMPLE_REQUIRES_PARENS = False
TABLESAMPLE_SIZE_IS_ROWS = False
TABLESAMPLE_KEYWORDS = 'SAMPLE'
LAST_DAY_SUPPORTS_DATE_PART = False
STRING_TYPE_MAPPING = {<Type.CHAR: 'CHAR'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String'}
TYPE_MAPPING = {<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.INET: 'INET'>: 'INET', <Type.CHAR: 'CHAR'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String', <Type.ARRAY: 'ARRAY'>: 'Array', <Type.BIGINT: 'BIGINT'>: 'Int64', <Type.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'}
TRANSFORMS = {<class 'sqlglot.expressions.DateAdd'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CheckColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CommentColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DateFormatColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DefaultColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EncodeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExternalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.HeapProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InlineLengthColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LanguageProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LocationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.MaterializedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NonClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NotForReplicationColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnCommitProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnUpdateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OutputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PathColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ReturnsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SampleProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SettingsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StabilityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ToTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransientProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransformModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VarMap'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.AnyValue'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ApproxDistinct'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArgMax'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.ArgMin'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.Array'>: <function inline_array_sql>, <class 'sqlglot.expressions.CastToStrType'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CountIf'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CurrentDate'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.DateDiff'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.Explode'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Final'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.IsNan'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Map'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Nullif'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.PartitionedByProperty'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Pivot'>: <function no_pivot_sql>, <class 'sqlglot.expressions.Quantile'>: <function _quantile_sql>, <class 'sqlglot.expressions.RegexpLike'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Rand'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.StartsWith'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.StrPosition'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Xor'>: <function ClickHouse.Generator.<lambda>>}
PROPERTIES_LOCATION = {<class 'sqlglot.expressions.AlgorithmProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.AutoIncrementProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BlockCompressionProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CharacterSetProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ChecksumProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CollateProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Cluster'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ClusteredByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DataBlocksizeProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.DefinerProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.DictRange'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DictProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistStyleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.EngineProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExternalProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.FallbackProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.FileFormatProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.FreespaceProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.HeapProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.InputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.IsolatedLoadingProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.JournalProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.LanguageProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LikeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LocationProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LockingProperty'>: <Location.POST_ALIAS: 'POST_ALIAS'>, <class 'sqlglot.expressions.LogProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.MaterializedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.MergeBlockRatioProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.OnProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCommitProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.Order'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OutputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedOfProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PrimaryKey'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Property'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ReturnsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatDelimitedProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatSerdeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SampleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SchemaCommentProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SerdeProperties'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Set'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SettingsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SetProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.SortKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.StabilityProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TemporaryProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ToTableProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TransientProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.TransformModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.MergeTreeTTL'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.VolatileProperty'>: <Location.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.WithDataProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.WithSystemVersioningProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCluster'>: <Location.POST_NAME: 'POST_NAME'>}
JOIN_HINTS = False
TABLE_HINTS = False
EXPLICIT_UNION = True
GROUPINGS_SEP = ''
ON_CLUSTER_TARGETS = {'FUNCTION', 'TABLE', 'NAMED COLLECTION', 'DICTIONARY', 'VIEW', 'INDEX', 'DATABASE'}
def eq_sql(self, expression: sqlglot.expressions.EQ) -> str:
616        def eq_sql(self, expression: exp.EQ) -> str:
617            return self._any_to_has(expression, super().eq_sql)
def neq_sql(self, expression: sqlglot.expressions.NEQ) -> str:
619        def neq_sql(self, expression: exp.NEQ) -> str:
620            return self._any_to_has(expression, super().neq_sql, "NOT ")
def regexpilike_sql(self, expression: sqlglot.expressions.RegexpILike) -> str:
622        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
623            # Manually add a flag to make the search case-insensitive
624            regex = self.func("CONCAT", "'(?i)'", expression.expression)
625            return f"match({self.format_args(expression.this, regex)})"
def datatype_sql(self, expression: sqlglot.expressions.DataType) -> str:
627        def datatype_sql(self, expression: exp.DataType) -> str:
628            # String is the standard ClickHouse type, every other variant is just an alias.
629            # Additionally, any supplied length parameter will be ignored.
630            #
631            # https://clickhouse.com/docs/en/sql-reference/data-types/string
632            if expression.this in self.STRING_TYPE_MAPPING:
633                return "String"
634
635            return super().datatype_sql(expression)
def cte_sql(self, expression: sqlglot.expressions.CTE) -> str:
637        def cte_sql(self, expression: exp.CTE) -> str:
638            if expression.args.get("scalar"):
639                this = self.sql(expression, "this")
640                alias = self.sql(expression, "alias")
641                return f"{this} AS {alias}"
642
643            return super().cte_sql(expression)
def after_limit_modifiers(self, expression: sqlglot.expressions.Expression) -> List[str]:
645        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
646            return super().after_limit_modifiers(expression) + [
647                self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
648                if expression.args.get("settings")
649                else "",
650                self.seg("FORMAT ") + self.sql(expression, "format")
651                if expression.args.get("format")
652                else "",
653            ]
def parameterizedagg_sql(self, expression: sqlglot.expressions.ParameterizedAgg) -> str:
655        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
656            params = self.expressions(expression, key="params", flat=True)
657            return self.func(expression.name, *expression.expressions) + f"({params})"
def anonymousaggfunc_sql(self, expression: sqlglot.expressions.AnonymousAggFunc) -> str:
659        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
660            return self.func(expression.name, *expression.expressions)
def combinedaggfunc_sql(self, expression: sqlglot.expressions.CombinedAggFunc) -> str:
662        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
663            return self.anonymousaggfunc_sql(expression)
def combinedparameterizedagg_sql(self, expression: sqlglot.expressions.CombinedParameterizedAgg) -> str:
665        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
666            return self.parameterizedagg_sql(expression)
def placeholder_sql(self, expression: sqlglot.expressions.Placeholder) -> str:
668        def placeholder_sql(self, expression: exp.Placeholder) -> str:
669            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
def oncluster_sql(self, expression: sqlglot.expressions.OnCluster) -> str:
671        def oncluster_sql(self, expression: exp.OnCluster) -> str:
672            return f"ON CLUSTER {self.sql(expression, 'this')}"
def createable_sql( self, expression: sqlglot.expressions.Create, locations: DefaultDict) -> str:
674        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
675            kind = self.sql(expression, "kind").upper()
676            if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
677                this_name = self.sql(expression.this, "this")
678                this_properties = " ".join(
679                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
680                )
681                this_schema = self.schema_columns_sql(expression.this)
682                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
683
684            return super().createable_sql(expression, locations)
SELECT_KINDS: Tuple[str, ...] = ()
Inherited Members
sqlglot.generator.Generator
Generator
NULL_ORDERING_SUPPORTED
LOCKING_READS_SUPPORTED
WRAP_DERIVED_VALUES
CREATE_FUNCTION_RETURN_AS
MATCHED_BY_SOURCE
SINGLE_STRING_INTERVAL
INTERVAL_ALLOWS_PLURAL_FORM
LIMIT_FETCH
LIMIT_ONLY_LITERALS
RENAME_TABLE_WITH_DB
INDEX_ON
QUERY_HINT_SEP
IS_BOOL_ALLOWED
DUPLICATE_KEY_UPDATE_WITH_SET
LIMIT_IS_TOP
RETURNING_END
COLUMN_JOIN_MARKS_SUPPORTED
EXTRACT_ALLOWS_QUOTES
TZ_TO_WITH_TIME_ZONE
VALUES_AS_TABLE
ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
UNNEST_WITH_ORDINALITY
AGGREGATE_FILTER_SUPPORTED
SEMI_ANTI_JOIN_WITH_SIDE
COMPUTED_COLUMN_WITH_TYPE
SUPPORTS_TABLE_COPY
TABLESAMPLE_WITH_METHOD
TABLESAMPLE_SEED_KEYWORD
COLLATE_IS_FUNC
DATA_TYPE_SPECIFIERS_ALLOWED
ENSURE_BOOLS
CTE_RECURSIVE_KEYWORD_REQUIRED
SUPPORTS_SINGLE_ARG_CONCAT
SUPPORTS_TABLE_ALIAS_COLUMNS
UNPIVOT_ALIASES_ARE_IDENTIFIERS
STAR_MAPPING
TIME_PART_SINGULARS
TOKEN_MAPPING
PARAMETER_TOKEN
RESERVED_KEYWORDS
WITH_SEPARATED_COMMENTS
EXCLUDE_COMMENTS
UNWRAPPED_INTERVAL_VALUES
EXPRESSIONS_WITHOUT_NESTED_CTES
KEY_VALUE_DEFINITIONS
SENTINEL_LINE_BREAK
pretty
identify
normalize
pad
unsupported_level
max_unsupported
leading_comma
max_text_width
comments
dialect
normalize_functions
unsupported_messages
generate
preprocess
unsupported
sep
seg
pad_comment
maybe_comment
wrap
no_identify
normalize_func
indent
sql
uncache_sql
cache_sql
characterset_sql
column_sql
columnposition_sql
columndef_sql
columnconstraint_sql
computedcolumnconstraint_sql
autoincrementcolumnconstraint_sql
compresscolumnconstraint_sql
generatedasidentitycolumnconstraint_sql
generatedasrowcolumnconstraint_sql
periodforsystemtimeconstraint_sql
notnullcolumnconstraint_sql
transformcolumnconstraint_sql
primarykeycolumnconstraint_sql
uniquecolumnconstraint_sql
create_sql
clone_sql
describe_sql
prepend_ctes
with_sql
tablealias_sql
bitstring_sql
hexstring_sql
bytestring_sql
unicodestring_sql
rawstring_sql
datatypeparam_sql
directory_sql
delete_sql
drop_sql
except_sql
except_op
fetch_sql
filter_sql
hint_sql
index_sql
identifier_sql
inputoutputformat_sql
national_sql
partition_sql
properties_sql
root_properties
properties
with_properties
locate_properties
property_name
property_sql
likeproperty_sql
fallbackproperty_sql
journalproperty_sql
freespaceproperty_sql
checksumproperty_sql
mergeblockratioproperty_sql
datablocksizeproperty_sql
blockcompressionproperty_sql
isolatedloadingproperty_sql
partitionboundspec_sql
partitionedofproperty_sql
lockingproperty_sql
withdataproperty_sql
withsystemversioningproperty_sql
insert_sql
intersect_sql
intersect_op
introducer_sql
kill_sql
pseudotype_sql
objectidentifier_sql
onconflict_sql
returning_sql
rowformatdelimitedproperty_sql
withtablehint_sql
indextablehint_sql
historicaldata_sql
table_sql
tablesample_sql
pivot_sql
version_sql
tuple_sql
update_sql
values_sql
var_sql
into_sql
from_sql
group_sql
having_sql
connect_sql
prior_sql
join_sql
lambda_sql
lateral_op
lateral_sql
limit_sql
offset_sql
setitem_sql
set_sql
pragma_sql
lock_sql
literal_sql
escape_str
loaddata_sql
null_sql
boolean_sql
order_sql
withfill_sql
cluster_sql
distribute_sql
sort_sql
ordered_sql
matchrecognize_sql
query_modifiers
offset_limit_modifiers
after_having_modifiers
select_sql
schema_sql
schema_columns_sql
star_sql
parameter_sql
sessionparameter_sql
subquery_sql
qualify_sql
union_sql
union_op
unnest_sql
where_sql
window_sql
partition_by_sql
windowspec_sql
withingroup_sql
between_sql
bracket_sql
all_sql
any_sql
exists_sql
case_sql
constraint_sql
nextvaluefor_sql
extract_sql
trim_sql
convert_concat_args
concat_sql
concatws_sql
check_sql
foreignkey_sql
primarykey_sql
if_sql
matchagainst_sql
jsonkeyvalue_sql
formatjson_sql
jsonobject_sql
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
add_sql
and_sql
xor_sql
connector_sql
bitwiseand_sql
bitwiseleftshift_sql
bitwisenot_sql
bitwiseor_sql
bitwiserightshift_sql
bitwisexor_sql
cast_sql
currentdate_sql
collate_sql
command_sql
comment_sql
mergetreettlaction_sql
mergetreettl_sql
transaction_sql
commit_sql
rollback_sql
altercolumn_sql
renametable_sql
altertable_sql
add_column_sql
droppartition_sql
addconstraint_sql
distinct_sql
ignorenulls_sql
respectnulls_sql
intdiv_sql
dpipe_sql
div_sql
overlaps_sql
distance_sql
dot_sql
propertyeq_sql
escape_sql
glob_sql
gt_sql
gte_sql
ilike_sql
ilikeany_sql
is_sql
like_sql
likeany_sql
similarto_sql
lt_sql
lte_sql
mod_sql
mul_sql
nullsafeeq_sql
nullsafeneq_sql
or_sql
slice_sql
sub_sql
trycast_sql
log_sql
use_sql
binary
function_fallback_sql
func
format_args
text_width
format_time
expressions
op_expressions
naked_property
set_operation
tag_sql
token_sql
userdefinedfunction_sql
joinhint_sql
kwarg_sql
when_sql
merge_sql
tochar_sql
dictproperty_sql
dictrange_sql
dictsubproperty_sql
clusteredbyproperty_sql
anyvalue_sql
querytransform_sql
indexconstraintoption_sql
indexcolumnconstraint_sql
nvl2_sql
comprehension_sql
columnprefix_sql
opclass_sql
predict_sql
forin_sql
refresh_sql
operator_sql
toarray_sql
tsordstotime_sql
tsordstodate_sql
unixdate_sql
lastday_sql