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

Determines how function names are going to be normalized.

Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

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):
 59    class Tokenizer(tokens.Tokenizer):
 60        COMMENTS = ["--", "#", "#!", ("/*", "*/")]
 61        IDENTIFIERS = ['"', "`"]
 62        STRING_ESCAPES = ["'", "\\"]
 63        BIT_STRINGS = [("0b", "")]
 64        HEX_STRINGS = [("0x", ""), ("0X", "")]
 65        HEREDOC_STRINGS = ["$"]
 66
 67        KEYWORDS = {
 68            **tokens.Tokenizer.KEYWORDS,
 69            "ATTACH": TokenType.COMMAND,
 70            "DATE32": TokenType.DATE32,
 71            "DATETIME64": TokenType.DATETIME64,
 72            "DICTIONARY": TokenType.DICTIONARY,
 73            "ENUM8": TokenType.ENUM8,
 74            "ENUM16": TokenType.ENUM16,
 75            "FINAL": TokenType.FINAL,
 76            "FIXEDSTRING": TokenType.FIXEDSTRING,
 77            "FLOAT32": TokenType.FLOAT,
 78            "FLOAT64": TokenType.DOUBLE,
 79            "GLOBAL": TokenType.GLOBAL,
 80            "INT256": TokenType.INT256,
 81            "LOWCARDINALITY": TokenType.LOWCARDINALITY,
 82            "MAP": TokenType.MAP,
 83            "NESTED": TokenType.NESTED,
 84            "SAMPLE": TokenType.TABLE_SAMPLE,
 85            "TUPLE": TokenType.STRUCT,
 86            "UINT128": TokenType.UINT128,
 87            "UINT16": TokenType.USMALLINT,
 88            "UINT256": TokenType.UINT256,
 89            "UINT32": TokenType.UINT,
 90            "UINT64": TokenType.UBIGINT,
 91            "UINT8": TokenType.UTINYINT,
 92            "IPV4": TokenType.IPV4,
 93            "IPV6": TokenType.IPV6,
 94            "AGGREGATEFUNCTION": TokenType.AGGREGATEFUNCTION,
 95            "SIMPLEAGGREGATEFUNCTION": TokenType.SIMPLEAGGREGATEFUNCTION,
 96            "SYSTEM": TokenType.COMMAND,
 97            "PREWHERE": TokenType.PREWHERE,
 98        }
 99
100        SINGLE_TOKENS = {
101            **tokens.Tokenizer.SINGLE_TOKENS,
102            "$": TokenType.HEREDOC_STRING,
103        }
COMMENTS = ['--', '#', '#!', ('/*', '*/')]
IDENTIFIERS = ['"', '`']
STRING_ESCAPES = ["'", '\\']
BIT_STRINGS = [('0b', '')]
HEX_STRINGS = [('0x', ''), ('0X', '')]
HEREDOC_STRINGS = ['$']
KEYWORDS = {'{%': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{%-': <TokenType.BLOCK_START: 'BLOCK_START'>, '%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '+%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-%}': <TokenType.BLOCK_END: 'BLOCK_END'>, '{{+': <TokenType.BLOCK_START: 'BLOCK_START'>, '{{-': <TokenType.BLOCK_START: 'BLOCK_START'>, '+}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '-}}': <TokenType.BLOCK_END: 'BLOCK_END'>, '/*+': <TokenType.HINT: 'HINT'>, '==': <TokenType.EQ: 'EQ'>, '::': <TokenType.DCOLON: 'DCOLON'>, '||': <TokenType.DPIPE: 'DPIPE'>, '>=': <TokenType.GTE: 'GTE'>, '<=': <TokenType.LTE: 'LTE'>, '<>': <TokenType.NEQ: 'NEQ'>, '!=': <TokenType.NEQ: 'NEQ'>, ':=': <TokenType.COLON_EQ: 'COLON_EQ'>, '<=>': <TokenType.NULLSAFE_EQ: 'NULLSAFE_EQ'>, '->': <TokenType.ARROW: 'ARROW'>, '->>': <TokenType.DARROW: 'DARROW'>, '=>': <TokenType.FARROW: 'FARROW'>, '#>': <TokenType.HASH_ARROW: 'HASH_ARROW'>, '#>>': <TokenType.DHASH_ARROW: 'DHASH_ARROW'>, '<->': <TokenType.LR_ARROW: 'LR_ARROW'>, '&&': <TokenType.DAMP: 'DAMP'>, '??': <TokenType.DQMARK: 'DQMARK'>, 'ALL': <TokenType.ALL: 'ALL'>, 'ALWAYS': <TokenType.ALWAYS: 'ALWAYS'>, 'AND': <TokenType.AND: 'AND'>, 'ANTI': <TokenType.ANTI: 'ANTI'>, 'ANY': <TokenType.ANY: 'ANY'>, 'ASC': <TokenType.ASC: 'ASC'>, 'AS': <TokenType.ALIAS: 'ALIAS'>, 'ASOF': <TokenType.ASOF: 'ASOF'>, 'AUTOINCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'AUTO_INCREMENT': <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, 'BEGIN': <TokenType.BEGIN: 'BEGIN'>, 'BETWEEN': <TokenType.BETWEEN: 'BETWEEN'>, 'CACHE': <TokenType.CACHE: 'CACHE'>, 'UNCACHE': <TokenType.UNCACHE: 'UNCACHE'>, 'CASE': <TokenType.CASE: 'CASE'>, 'CHARACTER SET': <TokenType.CHARACTER_SET: 'CHARACTER_SET'>, 'CLUSTER BY': <TokenType.CLUSTER_BY: 'CLUSTER_BY'>, 'COLLATE': <TokenType.COLLATE: 'COLLATE'>, 'COLUMN': <TokenType.COLUMN: 'COLUMN'>, 'COMMIT': <TokenType.COMMIT: 'COMMIT'>, 'CONNECT BY': <TokenType.CONNECT_BY: 'CONNECT_BY'>, 'CONSTRAINT': <TokenType.CONSTRAINT: 'CONSTRAINT'>, 'CREATE': <TokenType.CREATE: 'CREATE'>, 'CROSS': <TokenType.CROSS: 'CROSS'>, 'CUBE': <TokenType.CUBE: 'CUBE'>, 'CURRENT_DATE': <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, 'CURRENT_TIME': <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, 'CURRENT_TIMESTAMP': <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, 'CURRENT_USER': <TokenType.CURRENT_USER: 'CURRENT_USER'>, 'DATABASE': <TokenType.DATABASE: 'DATABASE'>, 'DEFAULT': <TokenType.DEFAULT: 'DEFAULT'>, 'DELETE': <TokenType.DELETE: 'DELETE'>, 'DESC': <TokenType.DESC: 'DESC'>, 'DESCRIBE': <TokenType.DESCRIBE: 'DESCRIBE'>, 'DISTINCT': <TokenType.DISTINCT: 'DISTINCT'>, 'DISTRIBUTE BY': <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>, 'DIV': <TokenType.DIV: 'DIV'>, 'DROP': <TokenType.DROP: 'DROP'>, 'ELSE': <TokenType.ELSE: 'ELSE'>, 'END': <TokenType.END: 'END'>, 'ENUM': <TokenType.ENUM: 'ENUM'>, 'ESCAPE': <TokenType.ESCAPE: 'ESCAPE'>, 'EXCEPT': <TokenType.EXCEPT: 'EXCEPT'>, 'EXECUTE': <TokenType.EXECUTE: 'EXECUTE'>, 'EXISTS': <TokenType.EXISTS: 'EXISTS'>, 'FALSE': <TokenType.FALSE: 'FALSE'>, 'FETCH': <TokenType.FETCH: 'FETCH'>, 'FILTER': <TokenType.FILTER: 'FILTER'>, 'FIRST': <TokenType.FIRST: 'FIRST'>, 'FULL': <TokenType.FULL: 'FULL'>, 'FUNCTION': <TokenType.FUNCTION: 'FUNCTION'>, 'FOR': <TokenType.FOR: 'FOR'>, 'FOREIGN KEY': <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, 'FORMAT': <TokenType.FORMAT: 'FORMAT'>, 'FROM': <TokenType.FROM: 'FROM'>, 'GEOGRAPHY': <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, 'GEOMETRY': <TokenType.GEOMETRY: 'GEOMETRY'>, 'GLOB': <TokenType.GLOB: 'GLOB'>, 'GROUP BY': <TokenType.GROUP_BY: 'GROUP_BY'>, 'GROUPING SETS': <TokenType.GROUPING_SETS: 'GROUPING_SETS'>, 'HAVING': <TokenType.HAVING: 'HAVING'>, 'ILIKE': <TokenType.ILIKE: 'ILIKE'>, 'IN': <TokenType.IN: 'IN'>, 'INDEX': <TokenType.INDEX: 'INDEX'>, 'INET': <TokenType.INET: 'INET'>, 'INNER': <TokenType.INNER: 'INNER'>, 'INSERT': <TokenType.INSERT: 'INSERT'>, 'INTERVAL': <TokenType.INTERVAL: 'INTERVAL'>, 'INTERSECT': <TokenType.INTERSECT: 'INTERSECT'>, 'INTO': <TokenType.INTO: 'INTO'>, 'IS': <TokenType.IS: 'IS'>, 'ISNULL': <TokenType.ISNULL: 'ISNULL'>, 'JOIN': <TokenType.JOIN: 'JOIN'>, 'KEEP': <TokenType.KEEP: 'KEEP'>, 'KILL': <TokenType.KILL: 'KILL'>, 'LATERAL': <TokenType.LATERAL: 'LATERAL'>, 'LEFT': <TokenType.LEFT: 'LEFT'>, 'LIKE': <TokenType.LIKE: 'LIKE'>, 'LIMIT': <TokenType.LIMIT: 'LIMIT'>, 'LOAD': <TokenType.LOAD: 'LOAD'>, 'LOCK': <TokenType.LOCK: 'LOCK'>, 'MERGE': <TokenType.MERGE: 'MERGE'>, 'NATURAL': <TokenType.NATURAL: 'NATURAL'>, 'NEXT': <TokenType.NEXT: 'NEXT'>, 'NOT': <TokenType.NOT: 'NOT'>, 'NOTNULL': <TokenType.NOTNULL: 'NOTNULL'>, 'NULL': <TokenType.NULL: 'NULL'>, 'OBJECT': <TokenType.OBJECT: 'OBJECT'>, 'OFFSET': <TokenType.OFFSET: 'OFFSET'>, 'ON': <TokenType.ON: 'ON'>, 'OR': <TokenType.OR: 'OR'>, 'XOR': <TokenType.XOR: 'XOR'>, 'ORDER BY': <TokenType.ORDER_BY: 'ORDER_BY'>, 'ORDINALITY': <TokenType.ORDINALITY: 'ORDINALITY'>, 'OUTER': <TokenType.OUTER: 'OUTER'>, 'OVER': <TokenType.OVER: 'OVER'>, 'OVERLAPS': <TokenType.OVERLAPS: 'OVERLAPS'>, 'OVERWRITE': <TokenType.OVERWRITE: 'OVERWRITE'>, 'PARTITION': <TokenType.PARTITION: 'PARTITION'>, 'PARTITION BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PARTITIONED_BY': <TokenType.PARTITION_BY: 'PARTITION_BY'>, 'PERCENT': <TokenType.PERCENT: 'PERCENT'>, 'PIVOT': <TokenType.PIVOT: 'PIVOT'>, 'PRAGMA': <TokenType.PRAGMA: 'PRAGMA'>, 'PRIMARY KEY': <TokenType.PRIMARY_KEY: 'PRIMARY_KEY'>, 'PROCEDURE': <TokenType.PROCEDURE: 'PROCEDURE'>, 'QUALIFY': <TokenType.QUALIFY: 'QUALIFY'>, 'RANGE': <TokenType.RANGE: 'RANGE'>, 'RECURSIVE': <TokenType.RECURSIVE: 'RECURSIVE'>, 'REGEXP': <TokenType.RLIKE: 'RLIKE'>, 'REPLACE': <TokenType.REPLACE: 'REPLACE'>, 'RETURNING': <TokenType.RETURNING: 'RETURNING'>, 'REFERENCES': <TokenType.REFERENCES: 'REFERENCES'>, 'RIGHT': <TokenType.RIGHT: 'RIGHT'>, 'RLIKE': <TokenType.RLIKE: 'RLIKE'>, 'ROLLBACK': <TokenType.ROLLBACK: 'ROLLBACK'>, 'ROLLUP': <TokenType.ROLLUP: 'ROLLUP'>, 'ROW': <TokenType.ROW: 'ROW'>, 'ROWS': <TokenType.ROWS: 'ROWS'>, 'SCHEMA': <TokenType.SCHEMA: 'SCHEMA'>, 'SELECT': <TokenType.SELECT: 'SELECT'>, 'SEMI': <TokenType.SEMI: 'SEMI'>, 'SET': <TokenType.SET: 'SET'>, 'SETTINGS': <TokenType.SETTINGS: 'SETTINGS'>, 'SHOW': <TokenType.SHOW: 'SHOW'>, 'SIMILAR TO': <TokenType.SIMILAR_TO: 'SIMILAR_TO'>, 'SOME': <TokenType.SOME: 'SOME'>, 'SORT BY': <TokenType.SORT_BY: 'SORT_BY'>, 'START WITH': <TokenType.START_WITH: 'START_WITH'>, 'TABLE': <TokenType.TABLE: 'TABLE'>, 'TABLESAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TEMP': <TokenType.TEMPORARY: 'TEMPORARY'>, 'TEMPORARY': <TokenType.TEMPORARY: 'TEMPORARY'>, 'THEN': <TokenType.THEN: 'THEN'>, 'TRUE': <TokenType.TRUE: 'TRUE'>, 'TRUNCATE': <TokenType.TRUNCATE: 'TRUNCATE'>, 'UNION': <TokenType.UNION: 'UNION'>, 'UNKNOWN': <TokenType.UNKNOWN: 'UNKNOWN'>, 'UNNEST': <TokenType.UNNEST: 'UNNEST'>, 'UNPIVOT': <TokenType.UNPIVOT: 'UNPIVOT'>, 'UPDATE': <TokenType.UPDATE: 'UPDATE'>, 'USE': <TokenType.USE: 'USE'>, 'USING': <TokenType.USING: 'USING'>, 'UUID': <TokenType.UUID: 'UUID'>, 'VALUES': <TokenType.VALUES: 'VALUES'>, 'VIEW': <TokenType.VIEW: 'VIEW'>, 'VOLATILE': <TokenType.VOLATILE: 'VOLATILE'>, 'WHEN': <TokenType.WHEN: 'WHEN'>, 'WHERE': <TokenType.WHERE: 'WHERE'>, 'WINDOW': <TokenType.WINDOW: 'WINDOW'>, 'WITH': <TokenType.WITH: 'WITH'>, 'APPLY': <TokenType.APPLY: 'APPLY'>, 'ARRAY': <TokenType.ARRAY: 'ARRAY'>, 'BIT': <TokenType.BIT: 'BIT'>, 'BOOL': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BOOLEAN': <TokenType.BOOLEAN: 'BOOLEAN'>, 'BYTE': <TokenType.TINYINT: 'TINYINT'>, 'MEDIUMINT': <TokenType.MEDIUMINT: 'MEDIUMINT'>, 'INT1': <TokenType.TINYINT: 'TINYINT'>, 'TINYINT': <TokenType.TINYINT: 'TINYINT'>, 'INT16': <TokenType.SMALLINT: 'SMALLINT'>, 'SHORT': <TokenType.SMALLINT: 'SMALLINT'>, 'SMALLINT': <TokenType.SMALLINT: 'SMALLINT'>, 'INT128': <TokenType.INT128: 'INT128'>, 'HUGEINT': <TokenType.INT128: 'INT128'>, 'INT2': <TokenType.SMALLINT: 'SMALLINT'>, 'INTEGER': <TokenType.INT: 'INT'>, 'INT': <TokenType.INT: 'INT'>, 'INT4': <TokenType.INT: 'INT'>, 'INT32': <TokenType.INT: 'INT'>, 'INT64': <TokenType.BIGINT: 'BIGINT'>, 'LONG': <TokenType.BIGINT: 'BIGINT'>, 'BIGINT': <TokenType.BIGINT: 'BIGINT'>, 'INT8': <TokenType.TINYINT: 'TINYINT'>, 'DEC': <TokenType.DECIMAL: 'DECIMAL'>, 'DECIMAL': <TokenType.DECIMAL: 'DECIMAL'>, 'BIGDECIMAL': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'BIGNUMERIC': <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, 'MAP': <TokenType.MAP: 'MAP'>, 'NULLABLE': <TokenType.NULLABLE: 'NULLABLE'>, 'NUMBER': <TokenType.DECIMAL: 'DECIMAL'>, 'NUMERIC': <TokenType.DECIMAL: 'DECIMAL'>, 'FIXED': <TokenType.DECIMAL: 'DECIMAL'>, 'REAL': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT4': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT8': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE': <TokenType.DOUBLE: 'DOUBLE'>, 'DOUBLE PRECISION': <TokenType.DOUBLE: 'DOUBLE'>, 'JSON': <TokenType.JSON: 'JSON'>, 'CHAR': <TokenType.CHAR: 'CHAR'>, 'CHARACTER': <TokenType.CHAR: 'CHAR'>, 'NCHAR': <TokenType.NCHAR: 'NCHAR'>, 'VARCHAR': <TokenType.VARCHAR: 'VARCHAR'>, 'VARCHAR2': <TokenType.VARCHAR: 'VARCHAR'>, 'NVARCHAR': <TokenType.NVARCHAR: 'NVARCHAR'>, 'NVARCHAR2': <TokenType.NVARCHAR: 'NVARCHAR'>, 'BPCHAR': <TokenType.BPCHAR: 'BPCHAR'>, 'STR': <TokenType.TEXT: 'TEXT'>, 'STRING': <TokenType.TEXT: 'TEXT'>, 'TEXT': <TokenType.TEXT: 'TEXT'>, 'LONGTEXT': <TokenType.LONGTEXT: 'LONGTEXT'>, 'MEDIUMTEXT': <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, 'TINYTEXT': <TokenType.TINYTEXT: 'TINYTEXT'>, 'CLOB': <TokenType.TEXT: 'TEXT'>, 'LONGVARCHAR': <TokenType.TEXT: 'TEXT'>, 'BINARY': <TokenType.BINARY: 'BINARY'>, 'BLOB': <TokenType.VARBINARY: 'VARBINARY'>, 'LONGBLOB': <TokenType.LONGBLOB: 'LONGBLOB'>, 'MEDIUMBLOB': <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, 'TINYBLOB': <TokenType.TINYBLOB: 'TINYBLOB'>, 'BYTEA': <TokenType.VARBINARY: 'VARBINARY'>, 'VARBINARY': <TokenType.VARBINARY: 'VARBINARY'>, 'TIME': <TokenType.TIME: 'TIME'>, 'TIMETZ': <TokenType.TIMETZ: 'TIMETZ'>, 'TIMESTAMP': <TokenType.TIMESTAMP: 'TIMESTAMP'>, 'TIMESTAMPTZ': <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, 'TIMESTAMPLTZ': <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, 'DATE': <TokenType.DATE: 'DATE'>, 'DATETIME': <TokenType.DATETIME: 'DATETIME'>, 'INT4RANGE': <TokenType.INT4RANGE: 'INT4RANGE'>, 'INT4MULTIRANGE': <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, 'INT8RANGE': <TokenType.INT8RANGE: 'INT8RANGE'>, 'INT8MULTIRANGE': <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, 'NUMRANGE': <TokenType.NUMRANGE: 'NUMRANGE'>, 'NUMMULTIRANGE': <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, 'TSRANGE': <TokenType.TSRANGE: 'TSRANGE'>, 'TSMULTIRANGE': <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, 'TSTZRANGE': <TokenType.TSTZRANGE: 'TSTZRANGE'>, 'TSTZMULTIRANGE': <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, 'DATERANGE': <TokenType.DATERANGE: 'DATERANGE'>, 'DATEMULTIRANGE': <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, 'UNIQUE': <TokenType.UNIQUE: 'UNIQUE'>, 'STRUCT': <TokenType.STRUCT: 'STRUCT'>, 'SEQUENCE': <TokenType.SEQUENCE: 'SEQUENCE'>, 'VARIANT': <TokenType.VARIANT: 'VARIANT'>, 'ALTER': <TokenType.ALTER: 'ALTER'>, 'ANALYZE': <TokenType.COMMAND: 'COMMAND'>, 'CALL': <TokenType.COMMAND: 'COMMAND'>, 'COMMENT': <TokenType.COMMENT: 'COMMENT'>, 'COPY': <TokenType.COMMAND: 'COMMAND'>, 'EXPLAIN': <TokenType.COMMAND: 'COMMAND'>, 'GRANT': <TokenType.COMMAND: 'COMMAND'>, 'OPTIMIZE': <TokenType.COMMAND: 'COMMAND'>, 'PREPARE': <TokenType.COMMAND: 'COMMAND'>, 'VACUUM': <TokenType.COMMAND: 'COMMAND'>, 'USER-DEFINED': <TokenType.USERDEFINED: 'USERDEFINED'>, 'FOR VERSION': <TokenType.VERSION_SNAPSHOT: 'VERSION_SNAPSHOT'>, 'FOR TIMESTAMP': <TokenType.TIMESTAMP_SNAPSHOT: 'TIMESTAMP_SNAPSHOT'>, 'ATTACH': <TokenType.COMMAND: 'COMMAND'>, 'DATE32': <TokenType.DATE32: 'DATE32'>, 'DATETIME64': <TokenType.DATETIME64: 'DATETIME64'>, 'DICTIONARY': <TokenType.DICTIONARY: 'DICTIONARY'>, 'ENUM8': <TokenType.ENUM8: 'ENUM8'>, 'ENUM16': <TokenType.ENUM16: 'ENUM16'>, 'FINAL': <TokenType.FINAL: 'FINAL'>, 'FIXEDSTRING': <TokenType.FIXEDSTRING: 'FIXEDSTRING'>, 'FLOAT32': <TokenType.FLOAT: 'FLOAT'>, 'FLOAT64': <TokenType.DOUBLE: 'DOUBLE'>, 'GLOBAL': <TokenType.GLOBAL: 'GLOBAL'>, 'INT256': <TokenType.INT256: 'INT256'>, 'LOWCARDINALITY': <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, 'NESTED': <TokenType.NESTED: 'NESTED'>, 'SAMPLE': <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>, 'TUPLE': <TokenType.STRUCT: 'STRUCT'>, 'UINT128': <TokenType.UINT128: 'UINT128'>, 'UINT16': <TokenType.USMALLINT: 'USMALLINT'>, 'UINT256': <TokenType.UINT256: 'UINT256'>, 'UINT32': <TokenType.UINT: 'UINT'>, 'UINT64': <TokenType.UBIGINT: 'UBIGINT'>, 'UINT8': <TokenType.UTINYINT: 'UTINYINT'>, 'IPV4': <TokenType.IPV4: 'IPV4'>, 'IPV6': <TokenType.IPV6: 'IPV6'>, 'AGGREGATEFUNCTION': <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, 'SIMPLEAGGREGATEFUNCTION': <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, 'SYSTEM': <TokenType.COMMAND: 'COMMAND'>, 'PREWHERE': <TokenType.PREWHERE: 'PREWHERE'>}
SINGLE_TOKENS = {'(': <TokenType.L_PAREN: 'L_PAREN'>, ')': <TokenType.R_PAREN: 'R_PAREN'>, '[': <TokenType.L_BRACKET: 'L_BRACKET'>, ']': <TokenType.R_BRACKET: 'R_BRACKET'>, '{': <TokenType.L_BRACE: 'L_BRACE'>, '}': <TokenType.R_BRACE: 'R_BRACE'>, '&': <TokenType.AMP: 'AMP'>, '^': <TokenType.CARET: 'CARET'>, ':': <TokenType.COLON: 'COLON'>, ',': <TokenType.COMMA: 'COMMA'>, '.': <TokenType.DOT: 'DOT'>, '-': <TokenType.DASH: 'DASH'>, '=': <TokenType.EQ: 'EQ'>, '>': <TokenType.GT: 'GT'>, '<': <TokenType.LT: 'LT'>, '%': <TokenType.MOD: 'MOD'>, '!': <TokenType.NOT: 'NOT'>, '|': <TokenType.PIPE: 'PIPE'>, '+': <TokenType.PLUS: 'PLUS'>, ';': <TokenType.SEMICOLON: 'SEMICOLON'>, '/': <TokenType.SLASH: 'SLASH'>, '\\': <TokenType.BACKSLASH: 'BACKSLASH'>, '*': <TokenType.STAR: 'STAR'>, '~': <TokenType.TILDA: 'TILDA'>, '?': <TokenType.PLACEHOLDER: 'PLACEHOLDER'>, '@': <TokenType.PARAMETER: 'PARAMETER'>, "'": <TokenType.QUOTE: 'QUOTE'>, '`': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '"': <TokenType.IDENTIFIER: 'IDENTIFIER'>, '#': <TokenType.HASH: 'HASH'>, '$': <TokenType.HEREDOC_STRING: 'HEREDOC_STRING'>}
class ClickHouse.Parser(sqlglot.parser.Parser):
105    class Parser(parser.Parser):
106        # Tested in ClickHouse's playground, it seems that the following two queries do the same thing
107        # * select x from t1 union all select x from t2 limit 1;
108        # * select x from t1 union all (select x from t2 limit 1);
109        MODIFIERS_ATTACHED_TO_UNION = False
110
111        FUNCTIONS = {
112            **parser.Parser.FUNCTIONS,
113            "ANY": exp.AnyValue.from_arg_list,
114            "ARRAYSUM": exp.ArraySum.from_arg_list,
115            "COUNTIF": _build_count_if,
116            "DATE_ADD": lambda args: exp.DateAdd(
117                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
118            ),
119            "DATEADD": lambda args: exp.DateAdd(
120                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
121            ),
122            "DATE_DIFF": lambda args: exp.DateDiff(
123                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
124            ),
125            "DATEDIFF": lambda args: exp.DateDiff(
126                this=seq_get(args, 2), expression=seq_get(args, 1), unit=seq_get(args, 0)
127            ),
128            "JSONEXTRACTSTRING": build_json_extract_path(
129                exp.JSONExtractScalar, zero_based_indexing=False
130            ),
131            "MAP": parser.build_var_map,
132            "MATCH": exp.RegexpLike.from_arg_list,
133            "RANDCANONICAL": exp.Rand.from_arg_list,
134            "TUPLE": exp.Struct.from_arg_list,
135            "UNIQ": exp.ApproxDistinct.from_arg_list,
136            "XOR": lambda args: exp.Xor(expressions=args),
137        }
138
139        AGG_FUNCTIONS = {
140            "count",
141            "min",
142            "max",
143            "sum",
144            "avg",
145            "any",
146            "stddevPop",
147            "stddevSamp",
148            "varPop",
149            "varSamp",
150            "corr",
151            "covarPop",
152            "covarSamp",
153            "entropy",
154            "exponentialMovingAverage",
155            "intervalLengthSum",
156            "kolmogorovSmirnovTest",
157            "mannWhitneyUTest",
158            "median",
159            "rankCorr",
160            "sumKahan",
161            "studentTTest",
162            "welchTTest",
163            "anyHeavy",
164            "anyLast",
165            "boundingRatio",
166            "first_value",
167            "last_value",
168            "argMin",
169            "argMax",
170            "avgWeighted",
171            "topK",
172            "topKWeighted",
173            "deltaSum",
174            "deltaSumTimestamp",
175            "groupArray",
176            "groupArrayLast",
177            "groupUniqArray",
178            "groupArrayInsertAt",
179            "groupArrayMovingAvg",
180            "groupArrayMovingSum",
181            "groupArraySample",
182            "groupBitAnd",
183            "groupBitOr",
184            "groupBitXor",
185            "groupBitmap",
186            "groupBitmapAnd",
187            "groupBitmapOr",
188            "groupBitmapXor",
189            "sumWithOverflow",
190            "sumMap",
191            "minMap",
192            "maxMap",
193            "skewSamp",
194            "skewPop",
195            "kurtSamp",
196            "kurtPop",
197            "uniq",
198            "uniqExact",
199            "uniqCombined",
200            "uniqCombined64",
201            "uniqHLL12",
202            "uniqTheta",
203            "quantile",
204            "quantiles",
205            "quantileExact",
206            "quantilesExact",
207            "quantileExactLow",
208            "quantilesExactLow",
209            "quantileExactHigh",
210            "quantilesExactHigh",
211            "quantileExactWeighted",
212            "quantilesExactWeighted",
213            "quantileTiming",
214            "quantilesTiming",
215            "quantileTimingWeighted",
216            "quantilesTimingWeighted",
217            "quantileDeterministic",
218            "quantilesDeterministic",
219            "quantileTDigest",
220            "quantilesTDigest",
221            "quantileTDigestWeighted",
222            "quantilesTDigestWeighted",
223            "quantileBFloat16",
224            "quantilesBFloat16",
225            "quantileBFloat16Weighted",
226            "quantilesBFloat16Weighted",
227            "simpleLinearRegression",
228            "stochasticLinearRegression",
229            "stochasticLogisticRegression",
230            "categoricalInformationValue",
231            "contingency",
232            "cramersV",
233            "cramersVBiasCorrected",
234            "theilsU",
235            "maxIntersections",
236            "maxIntersectionsPosition",
237            "meanZTest",
238            "quantileInterpolatedWeighted",
239            "quantilesInterpolatedWeighted",
240            "quantileGK",
241            "quantilesGK",
242            "sparkBar",
243            "sumCount",
244            "largestTriangleThreeBuckets",
245        }
246
247        AGG_FUNCTIONS_SUFFIXES = [
248            "If",
249            "Array",
250            "ArrayIf",
251            "Map",
252            "SimpleState",
253            "State",
254            "Merge",
255            "MergeState",
256            "ForEach",
257            "Distinct",
258            "OrDefault",
259            "OrNull",
260            "Resample",
261            "ArgMin",
262            "ArgMax",
263        ]
264
265        AGG_FUNC_MAPPING = (
266            lambda functions, suffixes: {
267                f"{f}{sfx}": (f, sfx) for sfx in (suffixes + [""]) for f in functions
268            }
269        )(AGG_FUNCTIONS, AGG_FUNCTIONS_SUFFIXES)
270
271        FUNCTIONS_WITH_ALIASED_ARGS = {*parser.Parser.FUNCTIONS_WITH_ALIASED_ARGS, "TUPLE"}
272
273        FUNCTION_PARSERS = {
274            **parser.Parser.FUNCTION_PARSERS,
275            "ARRAYJOIN": lambda self: self.expression(exp.Explode, this=self._parse_expression()),
276            "QUANTILE": lambda self: self._parse_quantile(),
277        }
278
279        FUNCTION_PARSERS.pop("MATCH")
280
281        NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
282        NO_PAREN_FUNCTION_PARSERS.pop("ANY")
283
284        RANGE_PARSERS = {
285            **parser.Parser.RANGE_PARSERS,
286            TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
287            and self._parse_in(this, is_global=True),
288        }
289
290        # The PLACEHOLDER entry is popped because 1) it doesn't affect Clickhouse (it corresponds to
291        # the postgres-specific JSONBContains parser) and 2) it makes parsing the ternary op simpler.
292        COLUMN_OPERATORS = parser.Parser.COLUMN_OPERATORS.copy()
293        COLUMN_OPERATORS.pop(TokenType.PLACEHOLDER)
294
295        JOIN_KINDS = {
296            *parser.Parser.JOIN_KINDS,
297            TokenType.ANY,
298            TokenType.ASOF,
299            TokenType.ARRAY,
300        }
301
302        TABLE_ALIAS_TOKENS = parser.Parser.TABLE_ALIAS_TOKENS - {
303            TokenType.ANY,
304            TokenType.ARRAY,
305            TokenType.FINAL,
306            TokenType.FORMAT,
307            TokenType.SETTINGS,
308        }
309
310        LOG_DEFAULTS_TO_LN = True
311
312        QUERY_MODIFIER_PARSERS = {
313            **parser.Parser.QUERY_MODIFIER_PARSERS,
314            TokenType.SETTINGS: lambda self: (
315                "settings",
316                self._advance() or self._parse_csv(self._parse_conjunction),
317            ),
318            TokenType.FORMAT: lambda self: ("format", self._advance() or self._parse_id_var()),
319        }
320
321        def _parse_conjunction(self) -> t.Optional[exp.Expression]:
322            this = super()._parse_conjunction()
323
324            if self._match(TokenType.PLACEHOLDER):
325                return self.expression(
326                    exp.If,
327                    this=this,
328                    true=self._parse_conjunction(),
329                    false=self._match(TokenType.COLON) and self._parse_conjunction(),
330                )
331
332            return this
333
334        def _parse_placeholder(self) -> t.Optional[exp.Expression]:
335            """
336            Parse a placeholder expression like SELECT {abc: UInt32} or FROM {table: Identifier}
337            https://clickhouse.com/docs/en/sql-reference/syntax#defining-and-using-query-parameters
338            """
339            if not self._match(TokenType.L_BRACE):
340                return None
341
342            this = self._parse_id_var()
343            self._match(TokenType.COLON)
344            kind = self._parse_types(check_func=False, allow_identifiers=False) or (
345                self._match_text_seq("IDENTIFIER") and "Identifier"
346            )
347
348            if not kind:
349                self.raise_error("Expecting a placeholder type or 'Identifier' for tables")
350            elif not self._match(TokenType.R_BRACE):
351                self.raise_error("Expecting }")
352
353            return self.expression(exp.Placeholder, this=this, kind=kind)
354
355        def _parse_in(self, this: t.Optional[exp.Expression], is_global: bool = False) -> exp.In:
356            this = super()._parse_in(this)
357            this.set("is_global", is_global)
358            return this
359
360        def _parse_table(
361            self,
362            schema: bool = False,
363            joins: bool = False,
364            alias_tokens: t.Optional[t.Collection[TokenType]] = None,
365            parse_bracket: bool = False,
366            is_db_reference: bool = False,
367        ) -> t.Optional[exp.Expression]:
368            this = super()._parse_table(
369                schema=schema,
370                joins=joins,
371                alias_tokens=alias_tokens,
372                parse_bracket=parse_bracket,
373                is_db_reference=is_db_reference,
374            )
375
376            if self._match(TokenType.FINAL):
377                this = self.expression(exp.Final, this=this)
378
379            return this
380
381        def _parse_position(self, haystack_first: bool = False) -> exp.StrPosition:
382            return super()._parse_position(haystack_first=True)
383
384        # https://clickhouse.com/docs/en/sql-reference/statements/select/with/
385        def _parse_cte(self) -> exp.CTE:
386            index = self._index
387            try:
388                # WITH <identifier> AS <subquery expression>
389                return super()._parse_cte()
390            except ParseError:
391                # WITH <expression> AS <identifier>
392                self._retreat(index)
393
394                return self.expression(
395                    exp.CTE,
396                    this=self._parse_conjunction(),
397                    alias=self._parse_table_alias(),
398                    scalar=True,
399                )
400
401        def _parse_join_parts(
402            self,
403        ) -> t.Tuple[t.Optional[Token], t.Optional[Token], t.Optional[Token]]:
404            is_global = self._match(TokenType.GLOBAL) and self._prev
405            kind_pre = self._match_set(self.JOIN_KINDS, advance=False) and self._prev
406
407            if kind_pre:
408                kind = self._match_set(self.JOIN_KINDS) and self._prev
409                side = self._match_set(self.JOIN_SIDES) and self._prev
410                return is_global, side, kind
411
412            return (
413                is_global,
414                self._match_set(self.JOIN_SIDES) and self._prev,
415                self._match_set(self.JOIN_KINDS) and self._prev,
416            )
417
418        def _parse_join(
419            self, skip_join_token: bool = False, parse_bracket: bool = False
420        ) -> t.Optional[exp.Join]:
421            join = super()._parse_join(skip_join_token=skip_join_token, parse_bracket=True)
422            if join:
423                join.set("global", join.args.pop("method", None))
424
425            return join
426
427        def _parse_function(
428            self,
429            functions: t.Optional[t.Dict[str, t.Callable]] = None,
430            anonymous: bool = False,
431            optional_parens: bool = True,
432        ) -> t.Optional[exp.Expression]:
433            func = super()._parse_function(
434                functions=functions, anonymous=anonymous, optional_parens=optional_parens
435            )
436
437            if isinstance(func, exp.Anonymous):
438                parts = self.AGG_FUNC_MAPPING.get(func.this)
439                params = self._parse_func_params(func)
440
441                if params:
442                    if parts and parts[1]:
443                        return self.expression(
444                            exp.CombinedParameterizedAgg,
445                            this=func.this,
446                            expressions=func.expressions,
447                            params=params,
448                            parts=parts,
449                        )
450                    return self.expression(
451                        exp.ParameterizedAgg,
452                        this=func.this,
453                        expressions=func.expressions,
454                        params=params,
455                    )
456
457                if parts:
458                    if parts[1]:
459                        return self.expression(
460                            exp.CombinedAggFunc,
461                            this=func.this,
462                            expressions=func.expressions,
463                            parts=parts,
464                        )
465                    return self.expression(
466                        exp.AnonymousAggFunc,
467                        this=func.this,
468                        expressions=func.expressions,
469                    )
470
471            return func
472
473        def _parse_func_params(
474            self, this: t.Optional[exp.Func] = None
475        ) -> t.Optional[t.List[exp.Expression]]:
476            if self._match_pair(TokenType.R_PAREN, TokenType.L_PAREN):
477                return self._parse_csv(self._parse_lambda)
478
479            if self._match(TokenType.L_PAREN):
480                params = self._parse_csv(self._parse_lambda)
481                self._match_r_paren(this)
482                return params
483
484            return None
485
486        def _parse_quantile(self) -> exp.Quantile:
487            this = self._parse_lambda()
488            params = self._parse_func_params()
489            if params:
490                return self.expression(exp.Quantile, this=params[0], quantile=this)
491            return self.expression(exp.Quantile, this=this, quantile=exp.Literal.number(0.5))
492
493        def _parse_wrapped_id_vars(self, optional: bool = False) -> t.List[exp.Expression]:
494            return super()._parse_wrapped_id_vars(optional=True)
495
496        def _parse_primary_key(
497            self, wrapped_optional: bool = False, in_props: bool = False
498        ) -> exp.PrimaryKeyColumnConstraint | exp.PrimaryKey:
499            return super()._parse_primary_key(
500                wrapped_optional=wrapped_optional or in_props, in_props=in_props
501            )
502
503        def _parse_on_property(self) -> t.Optional[exp.Expression]:
504            index = self._index
505            if self._match_text_seq("CLUSTER"):
506                this = self._parse_id_var()
507                if this:
508                    return self.expression(exp.OnCluster, this=this)
509                else:
510                    self._retreat(index)
511            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: 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'>>, 'ADD_MONTHS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AddMonths'>>, 'ANONYMOUS_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnonymousAggFunc'>>, 'ANY_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'APPROX_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_COUNT_DISTINCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>, 'APPROX_QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxQuantile'>>, 'APPROX_TOP_K': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxTopK'>>, 'ARG_MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARGMAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'MAX_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMax'>>, 'ARG_MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARGMIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'MIN_BY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArgMin'>>, 'ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Array'>>, 'ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAgg'>>, 'ARRAY_ALL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAll'>>, 'ARRAY_ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayAny'>>, 'ARRAY_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayConcat'>>, 'ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayContains'>>, 'FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_FILTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayFilter'>>, 'ARRAY_OVERLAPS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayOverlaps'>>, 'ARRAY_SIZE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySize'>>, 'ARRAY_LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySize'>>, 'ARRAY_SORT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySort'>>, 'ARRAY_SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySum'>>, 'ARRAY_TO_STRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayToString'>>, 'ARRAY_JOIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayToString'>>, 'ARRAY_UNION_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayUnionAgg'>>, 'ARRAY_UNIQUE_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArrayUniqueAgg'>>, 'AVG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Avg'>>, 'CASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Case'>>, 'CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Cast'>>, 'CAST_TO_STR_TYPE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CastToStrType'>>, 'CBRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Cbrt'>>, 'CEIL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ceil'>>, 'CEILING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ceil'>>, 'CHR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Chr'>>, 'CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Chr'>>, 'COALESCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'IFNULL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'NVL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Coalesce'>>, 'COLLATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Collate'>>, 'COMBINED_AGG_FUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CombinedAggFunc'>>, 'COMBINED_PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CombinedParameterizedAgg'>>, 'CONCAT': <function Parser.<lambda>>, 'CONCAT_WS': <function Parser.<lambda>>, 'CONNECT_BY_ROOT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ConnectByRoot'>>, 'CONVERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Convert'>>, 'COUNT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Count'>>, 'COUNT_IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CountIf'>>, 'COUNTIF': <function _build_count_if>, 'CURRENT_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentDate'>>, 'CURRENT_DATETIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentDatetime'>>, 'CURRENT_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentTime'>>, 'CURRENT_TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentTimestamp'>>, 'CURRENT_USER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.CurrentUser'>>, 'DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Date'>>, 'DATE_ADD': <function ClickHouse.Parser.<lambda>>, 'DATEDIFF': <function ClickHouse.Parser.<lambda>>, 'DATE_DIFF': <function ClickHouse.Parser.<lambda>>, 'DATE_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateFromParts'>>, 'DATE_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateStrToDate'>>, 'DATE_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateSub'>>, 'DATE_TO_DATE_STR': <function Parser.<lambda>>, 'DATE_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateToDi'>>, 'DATE_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DateTrunc'>>, 'DATETIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeAdd'>>, 'DATETIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeDiff'>>, 'DATETIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeSub'>>, 'DATETIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DatetimeTrunc'>>, 'DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Day'>>, 'DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfMonth'>>, 'DAYOFMONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfMonth'>>, 'DAY_OF_WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeek'>>, 'DAYOFWEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfWeek'>>, 'DAY_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfYear'>>, 'DAYOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DayOfYear'>>, 'DECODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Decode'>>, 'DI_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.DiToDate'>>, 'ENCODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Encode'>>, 'EXP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Exp'>>, 'EXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Explode'>>, 'EXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ExplodeOuter'>>, 'EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Extract'>>, 'FIRST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.First'>>, 'FIRST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FirstValue'>>, 'FLATTEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Flatten'>>, 'FLOOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Floor'>>, 'FROM_BASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase'>>, 'FROM_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.FromBase64'>>, 'GENERATE_SERIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GenerateSeries'>>, 'GREATEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Greatest'>>, 'GROUP_CONCAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.GroupConcat'>>, 'HEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Hex'>>, 'HLL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Hll'>>, 'IF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'IIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.If'>>, 'INITCAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Initcap'>>, 'IS_INF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'ISINF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsInf'>>, 'IS_NAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'ISNAN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.IsNan'>>, 'J_S_O_N_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArray'>>, 'J_S_O_N_ARRAY_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayAgg'>>, 'JSON_ARRAY_CONTAINS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONArrayContains'>>, 'JSONB_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBExtract'>>, 'JSONB_EXTRACT_SCALAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONBExtractScalar'>>, 'JSON_EXTRACT': <function build_extract_json_with_path.<locals>._builder>, 'JSON_EXTRACT_SCALAR': <function build_extract_json_with_path.<locals>._builder>, 'JSON_FORMAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONFormat'>>, 'J_S_O_N_OBJECT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObject'>>, 'J_S_O_N_OBJECT_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONObjectAgg'>>, 'J_S_O_N_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.JSONTable'>>, 'LAG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lag'>>, 'LAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Last'>>, 'LAST_DAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_DAY_OF_MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastDay'>>, 'LAST_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LastValue'>>, 'LEAD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lead'>>, 'LEAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Least'>>, 'LEFT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Left'>>, 'LENGTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Length'>>, 'LEVENSHTEIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Levenshtein'>>, 'LN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Ln'>>, 'LOG': <function build_logarithm>, 'LOGICAL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOL_AND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'BOOLAND_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalAnd'>>, 'LOGICAL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOL_OR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'BOOLOR_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.LogicalOr'>>, 'LOWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'LCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Lower'>>, 'MD5': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5'>>, 'MD5_DIGEST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MD5Digest'>>, 'MAP': <function build_var_map>, 'MAP_FROM_ENTRIES': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MapFromEntries'>>, 'MATCH_AGAINST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MatchAgainst'>>, 'MAX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Max'>>, 'MIN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Min'>>, 'MONTH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Month'>>, 'MONTHS_BETWEEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.MonthsBetween'>>, 'NEXT_VALUE_FOR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NextValueFor'>>, 'NTH_VALUE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NthValue'>>, 'NULLIF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nullif'>>, 'NUMBER_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.NumberToStr'>>, 'NVL2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Nvl2'>>, 'OPEN_J_S_O_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.OpenJSON'>>, 'PARAMETERIZED_AGG': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParameterizedAgg'>>, 'PARSE_JSON': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'JSON_PARSE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ParseJSON'>>, 'PERCENTILE_CONT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileCont'>>, 'PERCENTILE_DISC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PercentileDisc'>>, 'POSEXPLODE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Posexplode'>>, 'POSEXPLODE_OUTER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.PosexplodeOuter'>>, 'POWER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'POW': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Pow'>>, 'PREDICT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Predict'>>, 'QUANTILE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Quantile'>>, 'RAND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDOM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'RANDN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Randn'>>, 'RANGE_N': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RangeN'>>, 'READ_CSV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ReadCSV'>>, 'REDUCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Reduce'>>, 'REGEXP_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpExtract'>>, 'REGEXP_I_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpILike'>>, 'REGEXP_LIKE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'REGEXP_REPLACE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpReplace'>>, 'REGEXP_SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpSplit'>>, 'REPEAT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Repeat'>>, 'RIGHT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Right'>>, 'ROUND': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Round'>>, 'ROW_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RowNumber'>>, 'SHA': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA1': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA'>>, 'SHA2': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SHA2'>>, 'SAFE_DIVIDE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SafeDivide'>>, 'SIGN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SIGNUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sign'>>, 'SORT_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.SortArray'>>, 'SPLIT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Split'>>, 'SQRT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sqrt'>>, 'STANDARD_HASH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StandardHash'>>, 'STAR_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StarMap'>>, 'STARTS_WITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STARTSWITH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StartsWith'>>, 'STDDEV': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stddev'>>, 'STDDEV_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevPop'>>, 'STDDEV_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StddevSamp'>>, 'STR_POSITION': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrPosition'>>, 'STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToDate'>>, 'STR_TO_MAP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToMap'>>, 'STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToTime'>>, 'STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StrToUnix'>>, 'STRUCT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Struct'>>, 'STRUCT_EXTRACT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.StructExtract'>>, 'STUFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stuff'>>, 'INSERT': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Stuff'>>, 'SUBSTRING': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Substring'>>, 'SUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Sum'>>, 'TIME_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeAdd'>>, 'TIME_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeDiff'>>, 'TIME_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIMEFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeFromParts'>>, 'TIME_STR_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToDate'>>, 'TIME_STR_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToTime'>>, 'TIME_STR_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeStrToUnix'>>, 'TIME_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeSub'>>, 'TIME_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToStr'>>, 'TIME_TO_TIME_STR': <function Parser.<lambda>>, 'TIME_TO_UNIX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeToUnix'>>, 'TIME_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimeTrunc'>>, 'TIMESTAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Timestamp'>>, 'TIMESTAMP_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampAdd'>>, 'TIMESTAMPDIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, 'TIMESTAMP_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampDiff'>>, 'TIMESTAMP_FROM_PARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMPFROMPARTS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampFromParts'>>, 'TIMESTAMP_SUB': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampSub'>>, 'TIMESTAMP_TRUNC': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TimestampTrunc'>>, 'TO_ARRAY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToArray'>>, 'TO_BASE64': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToBase64'>>, 'TO_CHAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToChar'>>, 'TO_DAYS': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToDays'>>, 'TO_NUMBER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ToNumber'>>, 'TRANSFORM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Transform'>>, 'TRIM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Trim'>>, 'TRY_CAST': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TryCast'>>, 'TS_OR_DI_TO_DI': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDiToDi'>>, 'TS_OR_DS_ADD': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsAdd'>>, 'TS_OR_DS_DIFF': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsDiff'>>, 'TS_OR_DS_TO_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToDate'>>, 'TS_OR_DS_TO_DATE_STR': <function Parser.<lambda>>, 'TS_OR_DS_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.TsOrDsToTime'>>, 'UNHEX': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Unhex'>>, 'UNIX_DATE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixDate'>>, 'UNIX_TO_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToStr'>>, 'UNIX_TO_TIME': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTime'>>, 'UNIX_TO_TIME_STR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.UnixToTimeStr'>>, 'UPPER': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'UCASE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Upper'>>, 'VAR_MAP': <function build_var_map>, 'VARIANCE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VAR_SAMP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Variance'>>, 'VARIANCE_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'VAR_POP': <bound method Func.from_arg_list of <class 'sqlglot.expressions.VariancePop'>>, 'WEEK': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Week'>>, 'WEEK_OF_YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WEEKOFYEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.WeekOfYear'>>, 'WHEN': <bound method Func.from_arg_list of <class 'sqlglot.expressions.When'>>, 'X_M_L_TABLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.XMLTable'>>, 'XOR': <function ClickHouse.Parser.<lambda>>, 'YEAR': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Year'>>, 'GLOB': <function Parser.<lambda>>, 'JSON_EXTRACT_PATH_TEXT': <function build_extract_json_with_path.<locals>._builder>, 'LIKE': <function build_like>, 'LOG2': <function Parser.<lambda>>, 'LOG10': <function Parser.<lambda>>, 'MOD': <function Parser.<lambda>>, 'ANY': <bound method Func.from_arg_list of <class 'sqlglot.expressions.AnyValue'>>, 'ARRAYSUM': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ArraySum'>>, 'DATEADD': <function ClickHouse.Parser.<lambda>>, 'JSONEXTRACTSTRING': <function build_json_extract_path.<locals>._builder>, 'MATCH': <bound method Func.from_arg_list of <class 'sqlglot.expressions.RegexpLike'>>, 'RANDCANONICAL': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Rand'>>, 'TUPLE': <bound method Func.from_arg_list of <class 'sqlglot.expressions.Struct'>>, 'UNIQ': <bound method Func.from_arg_list of <class 'sqlglot.expressions.ApproxDistinct'>>}
AGG_FUNCTIONS = {'quantileTiming', 'groupBitmapAnd', 'quantilesDeterministic', 'groupArrayInsertAt', 'quantileExactHigh', 'topKWeighted', 'intervalLengthSum', 'anyLast', 'maxIntersectionsPosition', 'varPop', 'last_value', 'quantilesTiming', 'quantileGK', 'studentTTest', 'quantileBFloat16Weighted', 'deltaSum', 'quantilesExactLow', 'kurtPop', 'corr', 'groupArraySample', 'quantileTimingWeighted', 'quantileExact', 'quantilesTDigestWeighted', 'groupArrayMovingSum', 'quantilesExactHigh', 'sumKahan', 'stochasticLogisticRegression', 'kolmogorovSmirnovTest', 'quantiles', 'median', 'welchTTest', 'anyHeavy', 'quantileTDigestWeighted', 'groupUniqArray', 'sumCount', 'skewPop', 'covarSamp', 'max', 'quantileInterpolatedWeighted', 'min', 'groupBitmapOr', 'uniqTheta', 'covarPop', 'boundingRatio', 'groupBitAnd', 'cramersVBiasCorrected', 'maxIntersections', 'meanZTest', 'varSamp', 'quantile', 'stddevPop', 'mannWhitneyUTest', 'kurtSamp', 'cramersV', 'simpleLinearRegression', 'maxMap', 'topK', 'quantileTDigest', 'deltaSumTimestamp', 'quantilesBFloat16Weighted', 'argMin', 'uniq', 'theilsU', 'groupBitmapXor', 'quantilesTDigest', 'uniqHLL12', 'sumWithOverflow', 'stddevSamp', 'quantilesBFloat16', 'sparkBar', 'quantileExactWeighted', 'quantilesGK', 'groupArrayMovingAvg', 'largestTriangleThreeBuckets', 'uniqCombined64', 'exponentialMovingAverage', 'stochasticLinearRegression', 'groupArrayLast', 'sumMap', 'rankCorr', 'contingency', 'groupArray', 'quantilesInterpolatedWeighted', 'avgWeighted', 'quantilesTimingWeighted', 'quantilesExactWeighted', 'groupBitmap', 'categoricalInformationValue', 'quantileDeterministic', 'quantileBFloat16', 'uniqExact', 'count', 'any', 'quantilesExact', 'minMap', 'groupBitXor', 'quantileExactLow', 'sum', 'argMax', 'skewSamp', 'first_value', 'avg', 'entropy', 'uniqCombined', 'groupBitOr'}
AGG_FUNCTIONS_SUFFIXES = ['If', 'Array', 'ArrayIf', 'Map', 'SimpleState', 'State', 'Merge', 'MergeState', 'ForEach', 'Distinct', 'OrDefault', 'OrNull', 'Resample', 'ArgMin', 'ArgMax']
AGG_FUNC_MAPPING = {'quantileTimingIf': ('quantileTiming', 'If'), 'groupBitmapAndIf': ('groupBitmapAnd', 'If'), 'quantilesDeterministicIf': ('quantilesDeterministic', 'If'), 'groupArrayInsertAtIf': ('groupArrayInsertAt', 'If'), 'quantileExactHighIf': ('quantileExactHigh', 'If'), 'topKWeightedIf': ('topKWeighted', 'If'), 'intervalLengthSumIf': ('intervalLengthSum', 'If'), 'anyLastIf': ('anyLast', 'If'), 'maxIntersectionsPositionIf': ('maxIntersectionsPosition', 'If'), 'varPopIf': ('varPop', 'If'), 'last_valueIf': ('last_value', 'If'), 'quantilesTimingIf': ('quantilesTiming', 'If'), 'quantileGKIf': ('quantileGK', 'If'), 'studentTTestIf': ('studentTTest', 'If'), 'quantileBFloat16WeightedIf': ('quantileBFloat16Weighted', 'If'), 'deltaSumIf': ('deltaSum', 'If'), 'quantilesExactLowIf': ('quantilesExactLow', 'If'), 'kurtPopIf': ('kurtPop', 'If'), 'corrIf': ('corr', 'If'), 'groupArraySampleIf': ('groupArraySample', 'If'), 'quantileTimingWeightedIf': ('quantileTimingWeighted', 'If'), 'quantileExactIf': ('quantileExact', 'If'), 'quantilesTDigestWeightedIf': ('quantilesTDigestWeighted', 'If'), 'groupArrayMovingSumIf': ('groupArrayMovingSum', 'If'), 'quantilesExactHighIf': ('quantilesExactHigh', 'If'), 'sumKahanIf': ('sumKahan', 'If'), 'stochasticLogisticRegressionIf': ('stochasticLogisticRegression', 'If'), 'kolmogorovSmirnovTestIf': ('kolmogorovSmirnovTest', 'If'), 'quantilesIf': ('quantiles', 'If'), 'medianIf': ('median', 'If'), 'welchTTestIf': ('welchTTest', 'If'), 'anyHeavyIf': ('anyHeavy', 'If'), 'quantileTDigestWeightedIf': ('quantileTDigestWeighted', 'If'), 'groupUniqArrayIf': ('groupUniqArray', 'If'), 'sumCountIf': ('sumCount', 'If'), 'skewPopIf': ('skewPop', 'If'), 'covarSampIf': ('covarSamp', 'If'), 'maxIf': ('max', 'If'), 'quantileInterpolatedWeightedIf': ('quantileInterpolatedWeighted', 'If'), 'minIf': ('min', 'If'), 'groupBitmapOrIf': ('groupBitmapOr', 'If'), 'uniqThetaIf': ('uniqTheta', 'If'), 'covarPopIf': ('covarPop', 'If'), 'boundingRatioIf': ('boundingRatio', 'If'), 'groupBitAndIf': ('groupBitAnd', 'If'), 'cramersVBiasCorrectedIf': ('cramersVBiasCorrected', 'If'), 'maxIntersectionsIf': ('maxIntersections', 'If'), 'meanZTestIf': ('meanZTest', 'If'), 'varSampIf': ('varSamp', 'If'), 'quantileIf': ('quantile', 'If'), 'stddevPopIf': ('stddevPop', 'If'), 'mannWhitneyUTestIf': ('mannWhitneyUTest', 'If'), 'kurtSampIf': ('kurtSamp', 'If'), 'cramersVIf': ('cramersV', 'If'), 'simpleLinearRegressionIf': ('simpleLinearRegression', 'If'), 'maxMapIf': ('maxMap', 'If'), 'topKIf': ('topK', 'If'), 'quantileTDigestIf': ('quantileTDigest', 'If'), 'deltaSumTimestampIf': ('deltaSumTimestamp', 'If'), 'quantilesBFloat16WeightedIf': ('quantilesBFloat16Weighted', 'If'), 'argMinIf': ('argMin', 'If'), 'uniqIf': ('uniq', 'If'), 'theilsUIf': ('theilsU', 'If'), 'groupBitmapXorIf': ('groupBitmapXor', 'If'), 'quantilesTDigestIf': ('quantilesTDigest', 'If'), 'uniqHLL12If': ('uniqHLL12', 'If'), 'sumWithOverflowIf': ('sumWithOverflow', 'If'), 'stddevSampIf': ('stddevSamp', 'If'), 'quantilesBFloat16If': ('quantilesBFloat16', 'If'), 'sparkBarIf': ('sparkBar', 'If'), 'quantileExactWeightedIf': ('quantileExactWeighted', 'If'), 'quantilesGKIf': ('quantilesGK', 'If'), 'groupArrayMovingAvgIf': ('groupArrayMovingAvg', 'If'), 'largestTriangleThreeBucketsIf': ('largestTriangleThreeBuckets', 'If'), 'uniqCombined64If': ('uniqCombined64', 'If'), 'exponentialMovingAverageIf': ('exponentialMovingAverage', 'If'), 'stochasticLinearRegressionIf': ('stochasticLinearRegression', 'If'), 'groupArrayLastIf': ('groupArrayLast', 'If'), 'sumMapIf': ('sumMap', 'If'), 'rankCorrIf': ('rankCorr', 'If'), 'contingencyIf': ('contingency', 'If'), 'groupArrayIf': ('groupArray', 'If'), 'quantilesInterpolatedWeightedIf': ('quantilesInterpolatedWeighted', 'If'), 'avgWeightedIf': ('avgWeighted', 'If'), 'quantilesTimingWeightedIf': ('quantilesTimingWeighted', 'If'), 'quantilesExactWeightedIf': ('quantilesExactWeighted', 'If'), 'groupBitmapIf': ('groupBitmap', 'If'), 'categoricalInformationValueIf': ('categoricalInformationValue', 'If'), 'quantileDeterministicIf': ('quantileDeterministic', 'If'), 'quantileBFloat16If': ('quantileBFloat16', 'If'), 'uniqExactIf': ('uniqExact', 'If'), 'countIf': ('count', 'If'), 'anyIf': ('any', 'If'), 'quantilesExactIf': ('quantilesExact', 'If'), 'minMapIf': ('minMap', 'If'), 'groupBitXorIf': ('groupBitXor', 'If'), 'quantileExactLowIf': ('quantileExactLow', 'If'), 'sumIf': ('sum', 'If'), 'argMaxIf': ('argMax', 'If'), 'skewSampIf': ('skewSamp', 'If'), 'first_valueIf': ('first_value', 'If'), 'avgIf': ('avg', 'If'), 'entropyIf': ('entropy', 'If'), 'uniqCombinedIf': ('uniqCombined', 'If'), 'groupBitOrIf': ('groupBitOr', 'If'), 'quantileTimingArray': ('quantileTiming', 'Array'), 'groupBitmapAndArray': ('groupBitmapAnd', 'Array'), 'quantilesDeterministicArray': ('quantilesDeterministic', 'Array'), 'groupArrayInsertAtArray': ('groupArrayInsertAt', 'Array'), 'quantileExactHighArray': ('quantileExactHigh', 'Array'), 'topKWeightedArray': ('topKWeighted', 'Array'), 'intervalLengthSumArray': ('intervalLengthSum', 'Array'), 'anyLastArray': ('anyLast', 'Array'), 'maxIntersectionsPositionArray': ('maxIntersectionsPosition', 'Array'), 'varPopArray': ('varPop', 'Array'), 'last_valueArray': ('last_value', 'Array'), 'quantilesTimingArray': ('quantilesTiming', 'Array'), 'quantileGKArray': ('quantileGK', 'Array'), 'studentTTestArray': ('studentTTest', 'Array'), 'quantileBFloat16WeightedArray': ('quantileBFloat16Weighted', 'Array'), 'deltaSumArray': ('deltaSum', 'Array'), 'quantilesExactLowArray': ('quantilesExactLow', 'Array'), 'kurtPopArray': ('kurtPop', 'Array'), 'corrArray': ('corr', 'Array'), 'groupArraySampleArray': ('groupArraySample', 'Array'), 'quantileTimingWeightedArray': ('quantileTimingWeighted', 'Array'), 'quantileExactArray': ('quantileExact', 'Array'), 'quantilesTDigestWeightedArray': ('quantilesTDigestWeighted', 'Array'), 'groupArrayMovingSumArray': ('groupArrayMovingSum', 'Array'), 'quantilesExactHighArray': ('quantilesExactHigh', 'Array'), 'sumKahanArray': ('sumKahan', 'Array'), 'stochasticLogisticRegressionArray': ('stochasticLogisticRegression', 'Array'), 'kolmogorovSmirnovTestArray': ('kolmogorovSmirnovTest', 'Array'), 'quantilesArray': ('quantiles', 'Array'), 'medianArray': ('median', 'Array'), 'welchTTestArray': ('welchTTest', 'Array'), 'anyHeavyArray': ('anyHeavy', 'Array'), 'quantileTDigestWeightedArray': ('quantileTDigestWeighted', 'Array'), 'groupUniqArrayArray': ('groupUniqArray', 'Array'), 'sumCountArray': ('sumCount', 'Array'), 'skewPopArray': ('skewPop', 'Array'), 'covarSampArray': ('covarSamp', 'Array'), 'maxArray': ('max', 'Array'), 'quantileInterpolatedWeightedArray': ('quantileInterpolatedWeighted', 'Array'), 'minArray': ('min', 'Array'), 'groupBitmapOrArray': ('groupBitmapOr', 'Array'), 'uniqThetaArray': ('uniqTheta', 'Array'), 'covarPopArray': ('covarPop', 'Array'), 'boundingRatioArray': ('boundingRatio', 'Array'), 'groupBitAndArray': ('groupBitAnd', 'Array'), 'cramersVBiasCorrectedArray': ('cramersVBiasCorrected', 'Array'), 'maxIntersectionsArray': ('maxIntersections', 'Array'), 'meanZTestArray': ('meanZTest', 'Array'), 'varSampArray': ('varSamp', 'Array'), 'quantileArray': ('quantile', 'Array'), 'stddevPopArray': ('stddevPop', 'Array'), 'mannWhitneyUTestArray': ('mannWhitneyUTest', 'Array'), 'kurtSampArray': ('kurtSamp', 'Array'), 'cramersVArray': ('cramersV', 'Array'), 'simpleLinearRegressionArray': ('simpleLinearRegression', 'Array'), 'maxMapArray': ('maxMap', 'Array'), 'topKArray': ('topK', 'Array'), 'quantileTDigestArray': ('quantileTDigest', 'Array'), 'deltaSumTimestampArray': ('deltaSumTimestamp', 'Array'), 'quantilesBFloat16WeightedArray': ('quantilesBFloat16Weighted', 'Array'), 'argMinArray': ('argMin', 'Array'), 'uniqArray': ('uniq', 'Array'), 'theilsUArray': ('theilsU', 'Array'), 'groupBitmapXorArray': ('groupBitmapXor', 'Array'), 'quantilesTDigestArray': ('quantilesTDigest', 'Array'), 'uniqHLL12Array': ('uniqHLL12', 'Array'), 'sumWithOverflowArray': ('sumWithOverflow', 'Array'), 'stddevSampArray': ('stddevSamp', 'Array'), 'quantilesBFloat16Array': ('quantilesBFloat16', 'Array'), 'sparkBarArray': ('sparkBar', 'Array'), 'quantileExactWeightedArray': ('quantileExactWeighted', 'Array'), 'quantilesGKArray': ('quantilesGK', 'Array'), 'groupArrayMovingAvgArray': ('groupArrayMovingAvg', 'Array'), 'largestTriangleThreeBucketsArray': ('largestTriangleThreeBuckets', 'Array'), 'uniqCombined64Array': ('uniqCombined64', 'Array'), 'exponentialMovingAverageArray': ('exponentialMovingAverage', 'Array'), 'stochasticLinearRegressionArray': ('stochasticLinearRegression', 'Array'), 'groupArrayLastArray': ('groupArrayLast', 'Array'), 'sumMapArray': ('sumMap', 'Array'), 'rankCorrArray': ('rankCorr', 'Array'), 'contingencyArray': ('contingency', 'Array'), 'groupArrayArray': ('groupArray', 'Array'), 'quantilesInterpolatedWeightedArray': ('quantilesInterpolatedWeighted', 'Array'), 'avgWeightedArray': ('avgWeighted', 'Array'), 'quantilesTimingWeightedArray': ('quantilesTimingWeighted', 'Array'), 'quantilesExactWeightedArray': ('quantilesExactWeighted', 'Array'), 'groupBitmapArray': ('groupBitmap', 'Array'), 'categoricalInformationValueArray': ('categoricalInformationValue', 'Array'), 'quantileDeterministicArray': ('quantileDeterministic', 'Array'), 'quantileBFloat16Array': ('quantileBFloat16', 'Array'), 'uniqExactArray': ('uniqExact', 'Array'), 'countArray': ('count', 'Array'), 'anyArray': ('any', 'Array'), 'quantilesExactArray': ('quantilesExact', 'Array'), 'minMapArray': ('minMap', 'Array'), 'groupBitXorArray': ('groupBitXor', 'Array'), 'quantileExactLowArray': ('quantileExactLow', 'Array'), 'sumArray': ('sum', 'Array'), 'argMaxArray': ('argMax', 'Array'), 'skewSampArray': ('skewSamp', 'Array'), 'first_valueArray': ('first_value', 'Array'), 'avgArray': ('avg', 'Array'), 'entropyArray': ('entropy', 'Array'), 'uniqCombinedArray': ('uniqCombined', 'Array'), 'groupBitOrArray': ('groupBitOr', 'Array'), 'quantileTimingArrayIf': ('quantileTiming', 'ArrayIf'), 'groupBitmapAndArrayIf': ('groupBitmapAnd', 'ArrayIf'), 'quantilesDeterministicArrayIf': ('quantilesDeterministic', 'ArrayIf'), 'groupArrayInsertAtArrayIf': ('groupArrayInsertAt', 'ArrayIf'), 'quantileExactHighArrayIf': ('quantileExactHigh', 'ArrayIf'), 'topKWeightedArrayIf': ('topKWeighted', 'ArrayIf'), 'intervalLengthSumArrayIf': ('intervalLengthSum', 'ArrayIf'), 'anyLastArrayIf': ('anyLast', 'ArrayIf'), 'maxIntersectionsPositionArrayIf': ('maxIntersectionsPosition', 'ArrayIf'), 'varPopArrayIf': ('varPop', 'ArrayIf'), 'last_valueArrayIf': ('last_value', 'ArrayIf'), 'quantilesTimingArrayIf': ('quantilesTiming', 'ArrayIf'), 'quantileGKArrayIf': ('quantileGK', 'ArrayIf'), 'studentTTestArrayIf': ('studentTTest', 'ArrayIf'), 'quantileBFloat16WeightedArrayIf': ('quantileBFloat16Weighted', 'ArrayIf'), 'deltaSumArrayIf': ('deltaSum', 'ArrayIf'), 'quantilesExactLowArrayIf': ('quantilesExactLow', 'ArrayIf'), 'kurtPopArrayIf': ('kurtPop', 'ArrayIf'), 'corrArrayIf': ('corr', 'ArrayIf'), 'groupArraySampleArrayIf': ('groupArraySample', 'ArrayIf'), 'quantileTimingWeightedArrayIf': ('quantileTimingWeighted', 'ArrayIf'), 'quantileExactArrayIf': ('quantileExact', 'ArrayIf'), 'quantilesTDigestWeightedArrayIf': ('quantilesTDigestWeighted', 'ArrayIf'), 'groupArrayMovingSumArrayIf': ('groupArrayMovingSum', 'ArrayIf'), 'quantilesExactHighArrayIf': ('quantilesExactHigh', 'ArrayIf'), 'sumKahanArrayIf': ('sumKahan', 'ArrayIf'), 'stochasticLogisticRegressionArrayIf': ('stochasticLogisticRegression', 'ArrayIf'), 'kolmogorovSmirnovTestArrayIf': ('kolmogorovSmirnovTest', 'ArrayIf'), 'quantilesArrayIf': ('quantiles', 'ArrayIf'), 'medianArrayIf': ('median', 'ArrayIf'), 'welchTTestArrayIf': ('welchTTest', 'ArrayIf'), 'anyHeavyArrayIf': ('anyHeavy', 'ArrayIf'), 'quantileTDigestWeightedArrayIf': ('quantileTDigestWeighted', 'ArrayIf'), 'groupUniqArrayArrayIf': ('groupUniqArray', 'ArrayIf'), 'sumCountArrayIf': ('sumCount', 'ArrayIf'), 'skewPopArrayIf': ('skewPop', 'ArrayIf'), 'covarSampArrayIf': ('covarSamp', 'ArrayIf'), 'maxArrayIf': ('max', 'ArrayIf'), 'quantileInterpolatedWeightedArrayIf': ('quantileInterpolatedWeighted', 'ArrayIf'), 'minArrayIf': ('min', 'ArrayIf'), 'groupBitmapOrArrayIf': ('groupBitmapOr', 'ArrayIf'), 'uniqThetaArrayIf': ('uniqTheta', 'ArrayIf'), 'covarPopArrayIf': ('covarPop', 'ArrayIf'), 'boundingRatioArrayIf': ('boundingRatio', 'ArrayIf'), 'groupBitAndArrayIf': ('groupBitAnd', 'ArrayIf'), 'cramersVBiasCorrectedArrayIf': ('cramersVBiasCorrected', 'ArrayIf'), 'maxIntersectionsArrayIf': ('maxIntersections', 'ArrayIf'), 'meanZTestArrayIf': ('meanZTest', 'ArrayIf'), 'varSampArrayIf': ('varSamp', 'ArrayIf'), 'quantileArrayIf': ('quantile', 'ArrayIf'), 'stddevPopArrayIf': ('stddevPop', 'ArrayIf'), 'mannWhitneyUTestArrayIf': ('mannWhitneyUTest', 'ArrayIf'), 'kurtSampArrayIf': ('kurtSamp', 'ArrayIf'), 'cramersVArrayIf': ('cramersV', 'ArrayIf'), 'simpleLinearRegressionArrayIf': ('simpleLinearRegression', 'ArrayIf'), 'maxMapArrayIf': ('maxMap', 'ArrayIf'), 'topKArrayIf': ('topK', 'ArrayIf'), 'quantileTDigestArrayIf': ('quantileTDigest', 'ArrayIf'), 'deltaSumTimestampArrayIf': ('deltaSumTimestamp', 'ArrayIf'), 'quantilesBFloat16WeightedArrayIf': ('quantilesBFloat16Weighted', 'ArrayIf'), 'argMinArrayIf': ('argMin', 'ArrayIf'), 'uniqArrayIf': ('uniq', 'ArrayIf'), 'theilsUArrayIf': ('theilsU', 'ArrayIf'), 'groupBitmapXorArrayIf': ('groupBitmapXor', 'ArrayIf'), 'quantilesTDigestArrayIf': ('quantilesTDigest', 'ArrayIf'), 'uniqHLL12ArrayIf': ('uniqHLL12', 'ArrayIf'), 'sumWithOverflowArrayIf': ('sumWithOverflow', 'ArrayIf'), 'stddevSampArrayIf': ('stddevSamp', 'ArrayIf'), 'quantilesBFloat16ArrayIf': ('quantilesBFloat16', 'ArrayIf'), 'sparkBarArrayIf': ('sparkBar', 'ArrayIf'), 'quantileExactWeightedArrayIf': ('quantileExactWeighted', 'ArrayIf'), 'quantilesGKArrayIf': ('quantilesGK', 'ArrayIf'), 'groupArrayMovingAvgArrayIf': ('groupArrayMovingAvg', 'ArrayIf'), 'largestTriangleThreeBucketsArrayIf': ('largestTriangleThreeBuckets', 'ArrayIf'), 'uniqCombined64ArrayIf': ('uniqCombined64', 'ArrayIf'), 'exponentialMovingAverageArrayIf': ('exponentialMovingAverage', 'ArrayIf'), 'stochasticLinearRegressionArrayIf': ('stochasticLinearRegression', 'ArrayIf'), 'groupArrayLastArrayIf': ('groupArrayLast', 'ArrayIf'), 'sumMapArrayIf': ('sumMap', 'ArrayIf'), 'rankCorrArrayIf': ('rankCorr', 'ArrayIf'), 'contingencyArrayIf': ('contingency', 'ArrayIf'), 'groupArrayArrayIf': ('groupArray', 'ArrayIf'), 'quantilesInterpolatedWeightedArrayIf': ('quantilesInterpolatedWeighted', 'ArrayIf'), 'avgWeightedArrayIf': ('avgWeighted', 'ArrayIf'), 'quantilesTimingWeightedArrayIf': ('quantilesTimingWeighted', 'ArrayIf'), 'quantilesExactWeightedArrayIf': ('quantilesExactWeighted', 'ArrayIf'), 'groupBitmapArrayIf': ('groupBitmap', 'ArrayIf'), 'categoricalInformationValueArrayIf': ('categoricalInformationValue', 'ArrayIf'), 'quantileDeterministicArrayIf': ('quantileDeterministic', 'ArrayIf'), 'quantileBFloat16ArrayIf': ('quantileBFloat16', 'ArrayIf'), 'uniqExactArrayIf': ('uniqExact', 'ArrayIf'), 'countArrayIf': ('count', 'ArrayIf'), 'anyArrayIf': ('any', 'ArrayIf'), 'quantilesExactArrayIf': ('quantilesExact', 'ArrayIf'), 'minMapArrayIf': ('minMap', 'ArrayIf'), 'groupBitXorArrayIf': ('groupBitXor', 'ArrayIf'), 'quantileExactLowArrayIf': ('quantileExactLow', 'ArrayIf'), 'sumArrayIf': ('sum', 'ArrayIf'), 'argMaxArrayIf': ('argMax', 'ArrayIf'), 'skewSampArrayIf': ('skewSamp', 'ArrayIf'), 'first_valueArrayIf': ('first_value', 'ArrayIf'), 'avgArrayIf': ('avg', 'ArrayIf'), 'entropyArrayIf': ('entropy', 'ArrayIf'), 'uniqCombinedArrayIf': ('uniqCombined', 'ArrayIf'), 'groupBitOrArrayIf': ('groupBitOr', 'ArrayIf'), 'quantileTimingMap': ('quantileTiming', 'Map'), 'groupBitmapAndMap': ('groupBitmapAnd', 'Map'), 'quantilesDeterministicMap': ('quantilesDeterministic', 'Map'), 'groupArrayInsertAtMap': ('groupArrayInsertAt', 'Map'), 'quantileExactHighMap': ('quantileExactHigh', 'Map'), 'topKWeightedMap': ('topKWeighted', 'Map'), 'intervalLengthSumMap': ('intervalLengthSum', 'Map'), 'anyLastMap': ('anyLast', 'Map'), 'maxIntersectionsPositionMap': ('maxIntersectionsPosition', 'Map'), 'varPopMap': ('varPop', 'Map'), 'last_valueMap': ('last_value', 'Map'), 'quantilesTimingMap': ('quantilesTiming', 'Map'), 'quantileGKMap': ('quantileGK', 'Map'), 'studentTTestMap': ('studentTTest', 'Map'), 'quantileBFloat16WeightedMap': ('quantileBFloat16Weighted', 'Map'), 'deltaSumMap': ('deltaSum', 'Map'), 'quantilesExactLowMap': ('quantilesExactLow', 'Map'), 'kurtPopMap': ('kurtPop', 'Map'), 'corrMap': ('corr', 'Map'), 'groupArraySampleMap': ('groupArraySample', 'Map'), 'quantileTimingWeightedMap': ('quantileTimingWeighted', 'Map'), 'quantileExactMap': ('quantileExact', 'Map'), 'quantilesTDigestWeightedMap': ('quantilesTDigestWeighted', 'Map'), 'groupArrayMovingSumMap': ('groupArrayMovingSum', 'Map'), 'quantilesExactHighMap': ('quantilesExactHigh', 'Map'), 'sumKahanMap': ('sumKahan', 'Map'), 'stochasticLogisticRegressionMap': ('stochasticLogisticRegression', 'Map'), 'kolmogorovSmirnovTestMap': ('kolmogorovSmirnovTest', 'Map'), 'quantilesMap': ('quantiles', 'Map'), 'medianMap': ('median', 'Map'), 'welchTTestMap': ('welchTTest', 'Map'), 'anyHeavyMap': ('anyHeavy', 'Map'), 'quantileTDigestWeightedMap': ('quantileTDigestWeighted', 'Map'), 'groupUniqArrayMap': ('groupUniqArray', 'Map'), 'sumCountMap': ('sumCount', 'Map'), 'skewPopMap': ('skewPop', 'Map'), 'covarSampMap': ('covarSamp', 'Map'), 'maxMap': ('maxMap', ''), 'quantileInterpolatedWeightedMap': ('quantileInterpolatedWeighted', 'Map'), 'minMap': ('minMap', ''), 'groupBitmapOrMap': ('groupBitmapOr', 'Map'), 'uniqThetaMap': ('uniqTheta', 'Map'), 'covarPopMap': ('covarPop', 'Map'), 'boundingRatioMap': ('boundingRatio', 'Map'), 'groupBitAndMap': ('groupBitAnd', 'Map'), 'cramersVBiasCorrectedMap': ('cramersVBiasCorrected', 'Map'), 'maxIntersectionsMap': ('maxIntersections', 'Map'), 'meanZTestMap': ('meanZTest', 'Map'), 'varSampMap': ('varSamp', 'Map'), 'quantileMap': ('quantile', 'Map'), 'stddevPopMap': ('stddevPop', 'Map'), 'mannWhitneyUTestMap': ('mannWhitneyUTest', 'Map'), 'kurtSampMap': ('kurtSamp', 'Map'), 'cramersVMap': ('cramersV', 'Map'), 'simpleLinearRegressionMap': ('simpleLinearRegression', 'Map'), 'maxMapMap': ('maxMap', 'Map'), 'topKMap': ('topK', 'Map'), 'quantileTDigestMap': ('quantileTDigest', 'Map'), 'deltaSumTimestampMap': ('deltaSumTimestamp', 'Map'), 'quantilesBFloat16WeightedMap': ('quantilesBFloat16Weighted', 'Map'), 'argMinMap': ('argMin', 'Map'), 'uniqMap': ('uniq', 'Map'), 'theilsUMap': ('theilsU', 'Map'), 'groupBitmapXorMap': ('groupBitmapXor', 'Map'), 'quantilesTDigestMap': ('quantilesTDigest', 'Map'), 'uniqHLL12Map': ('uniqHLL12', 'Map'), 'sumWithOverflowMap': ('sumWithOverflow', 'Map'), 'stddevSampMap': ('stddevSamp', 'Map'), 'quantilesBFloat16Map': ('quantilesBFloat16', 'Map'), 'sparkBarMap': ('sparkBar', 'Map'), 'quantileExactWeightedMap': ('quantileExactWeighted', 'Map'), 'quantilesGKMap': ('quantilesGK', 'Map'), 'groupArrayMovingAvgMap': ('groupArrayMovingAvg', 'Map'), 'largestTriangleThreeBucketsMap': ('largestTriangleThreeBuckets', 'Map'), 'uniqCombined64Map': ('uniqCombined64', 'Map'), 'exponentialMovingAverageMap': ('exponentialMovingAverage', 'Map'), 'stochasticLinearRegressionMap': ('stochasticLinearRegression', 'Map'), 'groupArrayLastMap': ('groupArrayLast', 'Map'), 'sumMapMap': ('sumMap', 'Map'), 'rankCorrMap': ('rankCorr', 'Map'), 'contingencyMap': ('contingency', 'Map'), 'groupArrayMap': ('groupArray', 'Map'), 'quantilesInterpolatedWeightedMap': ('quantilesInterpolatedWeighted', 'Map'), 'avgWeightedMap': ('avgWeighted', 'Map'), 'quantilesTimingWeightedMap': ('quantilesTimingWeighted', 'Map'), 'quantilesExactWeightedMap': ('quantilesExactWeighted', 'Map'), 'groupBitmapMap': ('groupBitmap', 'Map'), 'categoricalInformationValueMap': ('categoricalInformationValue', 'Map'), 'quantileDeterministicMap': ('quantileDeterministic', 'Map'), 'quantileBFloat16Map': ('quantileBFloat16', 'Map'), 'uniqExactMap': ('uniqExact', 'Map'), 'countMap': ('count', 'Map'), 'anyMap': ('any', 'Map'), 'quantilesExactMap': ('quantilesExact', 'Map'), 'minMapMap': ('minMap', 'Map'), 'groupBitXorMap': ('groupBitXor', 'Map'), 'quantileExactLowMap': ('quantileExactLow', 'Map'), 'sumMap': ('sumMap', ''), 'argMaxMap': ('argMax', 'Map'), 'skewSampMap': ('skewSamp', 'Map'), 'first_valueMap': ('first_value', 'Map'), 'avgMap': ('avg', 'Map'), 'entropyMap': ('entropy', 'Map'), 'uniqCombinedMap': ('uniqCombined', 'Map'), 'groupBitOrMap': ('groupBitOr', 'Map'), 'quantileTimingSimpleState': ('quantileTiming', 'SimpleState'), 'groupBitmapAndSimpleState': ('groupBitmapAnd', 'SimpleState'), 'quantilesDeterministicSimpleState': ('quantilesDeterministic', 'SimpleState'), 'groupArrayInsertAtSimpleState': ('groupArrayInsertAt', 'SimpleState'), 'quantileExactHighSimpleState': ('quantileExactHigh', 'SimpleState'), 'topKWeightedSimpleState': ('topKWeighted', 'SimpleState'), 'intervalLengthSumSimpleState': ('intervalLengthSum', 'SimpleState'), 'anyLastSimpleState': ('anyLast', 'SimpleState'), 'maxIntersectionsPositionSimpleState': ('maxIntersectionsPosition', 'SimpleState'), 'varPopSimpleState': ('varPop', 'SimpleState'), 'last_valueSimpleState': ('last_value', 'SimpleState'), 'quantilesTimingSimpleState': ('quantilesTiming', 'SimpleState'), 'quantileGKSimpleState': ('quantileGK', 'SimpleState'), 'studentTTestSimpleState': ('studentTTest', 'SimpleState'), 'quantileBFloat16WeightedSimpleState': ('quantileBFloat16Weighted', 'SimpleState'), 'deltaSumSimpleState': ('deltaSum', 'SimpleState'), 'quantilesExactLowSimpleState': ('quantilesExactLow', 'SimpleState'), 'kurtPopSimpleState': ('kurtPop', 'SimpleState'), 'corrSimpleState': ('corr', 'SimpleState'), 'groupArraySampleSimpleState': ('groupArraySample', 'SimpleState'), 'quantileTimingWeightedSimpleState': ('quantileTimingWeighted', 'SimpleState'), 'quantileExactSimpleState': ('quantileExact', 'SimpleState'), 'quantilesTDigestWeightedSimpleState': ('quantilesTDigestWeighted', 'SimpleState'), 'groupArrayMovingSumSimpleState': ('groupArrayMovingSum', 'SimpleState'), 'quantilesExactHighSimpleState': ('quantilesExactHigh', 'SimpleState'), 'sumKahanSimpleState': ('sumKahan', 'SimpleState'), 'stochasticLogisticRegressionSimpleState': ('stochasticLogisticRegression', 'SimpleState'), 'kolmogorovSmirnovTestSimpleState': ('kolmogorovSmirnovTest', 'SimpleState'), 'quantilesSimpleState': ('quantiles', 'SimpleState'), 'medianSimpleState': ('median', 'SimpleState'), 'welchTTestSimpleState': ('welchTTest', 'SimpleState'), 'anyHeavySimpleState': ('anyHeavy', 'SimpleState'), 'quantileTDigestWeightedSimpleState': ('quantileTDigestWeighted', 'SimpleState'), 'groupUniqArraySimpleState': ('groupUniqArray', 'SimpleState'), 'sumCountSimpleState': ('sumCount', 'SimpleState'), 'skewPopSimpleState': ('skewPop', 'SimpleState'), 'covarSampSimpleState': ('covarSamp', 'SimpleState'), 'maxSimpleState': ('max', 'SimpleState'), 'quantileInterpolatedWeightedSimpleState': ('quantileInterpolatedWeighted', 'SimpleState'), 'minSimpleState': ('min', 'SimpleState'), 'groupBitmapOrSimpleState': ('groupBitmapOr', 'SimpleState'), 'uniqThetaSimpleState': ('uniqTheta', 'SimpleState'), 'covarPopSimpleState': ('covarPop', 'SimpleState'), 'boundingRatioSimpleState': ('boundingRatio', 'SimpleState'), 'groupBitAndSimpleState': ('groupBitAnd', 'SimpleState'), 'cramersVBiasCorrectedSimpleState': ('cramersVBiasCorrected', 'SimpleState'), 'maxIntersectionsSimpleState': ('maxIntersections', 'SimpleState'), 'meanZTestSimpleState': ('meanZTest', 'SimpleState'), 'varSampSimpleState': ('varSamp', 'SimpleState'), 'quantileSimpleState': ('quantile', 'SimpleState'), 'stddevPopSimpleState': ('stddevPop', 'SimpleState'), 'mannWhitneyUTestSimpleState': ('mannWhitneyUTest', 'SimpleState'), 'kurtSampSimpleState': ('kurtSamp', 'SimpleState'), 'cramersVSimpleState': ('cramersV', 'SimpleState'), 'simpleLinearRegressionSimpleState': ('simpleLinearRegression', 'SimpleState'), 'maxMapSimpleState': ('maxMap', 'SimpleState'), 'topKSimpleState': ('topK', 'SimpleState'), 'quantileTDigestSimpleState': ('quantileTDigest', 'SimpleState'), 'deltaSumTimestampSimpleState': ('deltaSumTimestamp', 'SimpleState'), 'quantilesBFloat16WeightedSimpleState': ('quantilesBFloat16Weighted', 'SimpleState'), 'argMinSimpleState': ('argMin', 'SimpleState'), 'uniqSimpleState': ('uniq', 'SimpleState'), 'theilsUSimpleState': ('theilsU', 'SimpleState'), 'groupBitmapXorSimpleState': ('groupBitmapXor', 'SimpleState'), 'quantilesTDigestSimpleState': ('quantilesTDigest', 'SimpleState'), 'uniqHLL12SimpleState': ('uniqHLL12', 'SimpleState'), 'sumWithOverflowSimpleState': ('sumWithOverflow', 'SimpleState'), 'stddevSampSimpleState': ('stddevSamp', 'SimpleState'), 'quantilesBFloat16SimpleState': ('quantilesBFloat16', 'SimpleState'), 'sparkBarSimpleState': ('sparkBar', 'SimpleState'), 'quantileExactWeightedSimpleState': ('quantileExactWeighted', 'SimpleState'), 'quantilesGKSimpleState': ('quantilesGK', 'SimpleState'), 'groupArrayMovingAvgSimpleState': ('groupArrayMovingAvg', 'SimpleState'), 'largestTriangleThreeBucketsSimpleState': ('largestTriangleThreeBuckets', 'SimpleState'), 'uniqCombined64SimpleState': ('uniqCombined64', 'SimpleState'), 'exponentialMovingAverageSimpleState': ('exponentialMovingAverage', 'SimpleState'), 'stochasticLinearRegressionSimpleState': ('stochasticLinearRegression', 'SimpleState'), 'groupArrayLastSimpleState': ('groupArrayLast', 'SimpleState'), 'sumMapSimpleState': ('sumMap', 'SimpleState'), 'rankCorrSimpleState': ('rankCorr', 'SimpleState'), 'contingencySimpleState': ('contingency', 'SimpleState'), 'groupArraySimpleState': ('groupArray', 'SimpleState'), 'quantilesInterpolatedWeightedSimpleState': ('quantilesInterpolatedWeighted', 'SimpleState'), 'avgWeightedSimpleState': ('avgWeighted', 'SimpleState'), 'quantilesTimingWeightedSimpleState': ('quantilesTimingWeighted', 'SimpleState'), 'quantilesExactWeightedSimpleState': ('quantilesExactWeighted', 'SimpleState'), 'groupBitmapSimpleState': ('groupBitmap', 'SimpleState'), 'categoricalInformationValueSimpleState': ('categoricalInformationValue', 'SimpleState'), 'quantileDeterministicSimpleState': ('quantileDeterministic', 'SimpleState'), 'quantileBFloat16SimpleState': ('quantileBFloat16', 'SimpleState'), 'uniqExactSimpleState': ('uniqExact', 'SimpleState'), 'countSimpleState': ('count', 'SimpleState'), 'anySimpleState': ('any', 'SimpleState'), 'quantilesExactSimpleState': ('quantilesExact', 'SimpleState'), 'minMapSimpleState': ('minMap', 'SimpleState'), 'groupBitXorSimpleState': ('groupBitXor', 'SimpleState'), 'quantileExactLowSimpleState': ('quantileExactLow', 'SimpleState'), 'sumSimpleState': ('sum', 'SimpleState'), 'argMaxSimpleState': ('argMax', 'SimpleState'), 'skewSampSimpleState': ('skewSamp', 'SimpleState'), 'first_valueSimpleState': ('first_value', 'SimpleState'), 'avgSimpleState': ('avg', 'SimpleState'), 'entropySimpleState': ('entropy', 'SimpleState'), 'uniqCombinedSimpleState': ('uniqCombined', 'SimpleState'), 'groupBitOrSimpleState': ('groupBitOr', 'SimpleState'), 'quantileTimingState': ('quantileTiming', 'State'), 'groupBitmapAndState': ('groupBitmapAnd', 'State'), 'quantilesDeterministicState': ('quantilesDeterministic', 'State'), 'groupArrayInsertAtState': ('groupArrayInsertAt', 'State'), 'quantileExactHighState': ('quantileExactHigh', 'State'), 'topKWeightedState': ('topKWeighted', 'State'), 'intervalLengthSumState': ('intervalLengthSum', 'State'), 'anyLastState': ('anyLast', 'State'), 'maxIntersectionsPositionState': ('maxIntersectionsPosition', 'State'), 'varPopState': ('varPop', 'State'), 'last_valueState': ('last_value', 'State'), 'quantilesTimingState': ('quantilesTiming', 'State'), 'quantileGKState': ('quantileGK', 'State'), 'studentTTestState': ('studentTTest', 'State'), 'quantileBFloat16WeightedState': ('quantileBFloat16Weighted', 'State'), 'deltaSumState': ('deltaSum', 'State'), 'quantilesExactLowState': ('quantilesExactLow', 'State'), 'kurtPopState': ('kurtPop', 'State'), 'corrState': ('corr', 'State'), 'groupArraySampleState': ('groupArraySample', 'State'), 'quantileTimingWeightedState': ('quantileTimingWeighted', 'State'), 'quantileExactState': ('quantileExact', 'State'), 'quantilesTDigestWeightedState': ('quantilesTDigestWeighted', 'State'), 'groupArrayMovingSumState': ('groupArrayMovingSum', 'State'), 'quantilesExactHighState': ('quantilesExactHigh', 'State'), 'sumKahanState': ('sumKahan', 'State'), 'stochasticLogisticRegressionState': ('stochasticLogisticRegression', 'State'), 'kolmogorovSmirnovTestState': ('kolmogorovSmirnovTest', 'State'), 'quantilesState': ('quantiles', 'State'), 'medianState': ('median', 'State'), 'welchTTestState': ('welchTTest', 'State'), 'anyHeavyState': ('anyHeavy', 'State'), 'quantileTDigestWeightedState': ('quantileTDigestWeighted', 'State'), 'groupUniqArrayState': ('groupUniqArray', 'State'), 'sumCountState': ('sumCount', 'State'), 'skewPopState': ('skewPop', 'State'), 'covarSampState': ('covarSamp', 'State'), 'maxState': ('max', 'State'), 'quantileInterpolatedWeightedState': ('quantileInterpolatedWeighted', 'State'), 'minState': ('min', 'State'), 'groupBitmapOrState': ('groupBitmapOr', 'State'), 'uniqThetaState': ('uniqTheta', 'State'), 'covarPopState': ('covarPop', 'State'), 'boundingRatioState': ('boundingRatio', 'State'), 'groupBitAndState': ('groupBitAnd', 'State'), 'cramersVBiasCorrectedState': ('cramersVBiasCorrected', 'State'), 'maxIntersectionsState': ('maxIntersections', 'State'), 'meanZTestState': ('meanZTest', 'State'), 'varSampState': ('varSamp', 'State'), 'quantileState': ('quantile', 'State'), 'stddevPopState': ('stddevPop', 'State'), 'mannWhitneyUTestState': ('mannWhitneyUTest', 'State'), 'kurtSampState': ('kurtSamp', 'State'), 'cramersVState': ('cramersV', 'State'), 'simpleLinearRegressionState': ('simpleLinearRegression', 'State'), 'maxMapState': ('maxMap', 'State'), 'topKState': ('topK', 'State'), 'quantileTDigestState': ('quantileTDigest', 'State'), 'deltaSumTimestampState': ('deltaSumTimestamp', 'State'), 'quantilesBFloat16WeightedState': ('quantilesBFloat16Weighted', 'State'), 'argMinState': ('argMin', 'State'), 'uniqState': ('uniq', 'State'), 'theilsUState': ('theilsU', 'State'), 'groupBitmapXorState': ('groupBitmapXor', 'State'), 'quantilesTDigestState': ('quantilesTDigest', 'State'), 'uniqHLL12State': ('uniqHLL12', 'State'), 'sumWithOverflowState': ('sumWithOverflow', 'State'), 'stddevSampState': ('stddevSamp', 'State'), 'quantilesBFloat16State': ('quantilesBFloat16', 'State'), 'sparkBarState': ('sparkBar', 'State'), 'quantileExactWeightedState': ('quantileExactWeighted', 'State'), 'quantilesGKState': ('quantilesGK', 'State'), 'groupArrayMovingAvgState': ('groupArrayMovingAvg', 'State'), 'largestTriangleThreeBucketsState': ('largestTriangleThreeBuckets', 'State'), 'uniqCombined64State': ('uniqCombined64', 'State'), 'exponentialMovingAverageState': ('exponentialMovingAverage', 'State'), 'stochasticLinearRegressionState': ('stochasticLinearRegression', 'State'), 'groupArrayLastState': ('groupArrayLast', 'State'), 'sumMapState': ('sumMap', 'State'), 'rankCorrState': ('rankCorr', 'State'), 'contingencyState': ('contingency', 'State'), 'groupArrayState': ('groupArray', 'State'), 'quantilesInterpolatedWeightedState': ('quantilesInterpolatedWeighted', 'State'), 'avgWeightedState': ('avgWeighted', 'State'), 'quantilesTimingWeightedState': ('quantilesTimingWeighted', 'State'), 'quantilesExactWeightedState': ('quantilesExactWeighted', 'State'), 'groupBitmapState': ('groupBitmap', 'State'), 'categoricalInformationValueState': ('categoricalInformationValue', 'State'), 'quantileDeterministicState': ('quantileDeterministic', 'State'), 'quantileBFloat16State': ('quantileBFloat16', 'State'), 'uniqExactState': ('uniqExact', 'State'), 'countState': ('count', 'State'), 'anyState': ('any', 'State'), 'quantilesExactState': ('quantilesExact', 'State'), 'minMapState': ('minMap', 'State'), 'groupBitXorState': ('groupBitXor', 'State'), 'quantileExactLowState': ('quantileExactLow', 'State'), 'sumState': ('sum', 'State'), 'argMaxState': ('argMax', 'State'), 'skewSampState': ('skewSamp', 'State'), 'first_valueState': ('first_value', 'State'), 'avgState': ('avg', 'State'), 'entropyState': ('entropy', 'State'), 'uniqCombinedState': ('uniqCombined', 'State'), 'groupBitOrState': ('groupBitOr', 'State'), 'quantileTimingMerge': ('quantileTiming', 'Merge'), 'groupBitmapAndMerge': ('groupBitmapAnd', 'Merge'), 'quantilesDeterministicMerge': ('quantilesDeterministic', 'Merge'), 'groupArrayInsertAtMerge': ('groupArrayInsertAt', 'Merge'), 'quantileExactHighMerge': ('quantileExactHigh', 'Merge'), 'topKWeightedMerge': ('topKWeighted', 'Merge'), 'intervalLengthSumMerge': ('intervalLengthSum', 'Merge'), 'anyLastMerge': ('anyLast', 'Merge'), 'maxIntersectionsPositionMerge': ('maxIntersectionsPosition', 'Merge'), 'varPopMerge': ('varPop', 'Merge'), 'last_valueMerge': ('last_value', 'Merge'), 'quantilesTimingMerge': ('quantilesTiming', 'Merge'), 'quantileGKMerge': ('quantileGK', 'Merge'), 'studentTTestMerge': ('studentTTest', 'Merge'), 'quantileBFloat16WeightedMerge': ('quantileBFloat16Weighted', 'Merge'), 'deltaSumMerge': ('deltaSum', 'Merge'), 'quantilesExactLowMerge': ('quantilesExactLow', 'Merge'), 'kurtPopMerge': ('kurtPop', 'Merge'), 'corrMerge': ('corr', 'Merge'), 'groupArraySampleMerge': ('groupArraySample', 'Merge'), 'quantileTimingWeightedMerge': ('quantileTimingWeighted', 'Merge'), 'quantileExactMerge': ('quantileExact', 'Merge'), 'quantilesTDigestWeightedMerge': ('quantilesTDigestWeighted', 'Merge'), 'groupArrayMovingSumMerge': ('groupArrayMovingSum', 'Merge'), 'quantilesExactHighMerge': ('quantilesExactHigh', 'Merge'), 'sumKahanMerge': ('sumKahan', 'Merge'), 'stochasticLogisticRegressionMerge': ('stochasticLogisticRegression', 'Merge'), 'kolmogorovSmirnovTestMerge': ('kolmogorovSmirnovTest', 'Merge'), 'quantilesMerge': ('quantiles', 'Merge'), 'medianMerge': ('median', 'Merge'), 'welchTTestMerge': ('welchTTest', 'Merge'), 'anyHeavyMerge': ('anyHeavy', 'Merge'), 'quantileTDigestWeightedMerge': ('quantileTDigestWeighted', 'Merge'), 'groupUniqArrayMerge': ('groupUniqArray', 'Merge'), 'sumCountMerge': ('sumCount', 'Merge'), 'skewPopMerge': ('skewPop', 'Merge'), 'covarSampMerge': ('covarSamp', 'Merge'), 'maxMerge': ('max', 'Merge'), 'quantileInterpolatedWeightedMerge': ('quantileInterpolatedWeighted', 'Merge'), 'minMerge': ('min', 'Merge'), 'groupBitmapOrMerge': ('groupBitmapOr', 'Merge'), 'uniqThetaMerge': ('uniqTheta', 'Merge'), 'covarPopMerge': ('covarPop', 'Merge'), 'boundingRatioMerge': ('boundingRatio', 'Merge'), 'groupBitAndMerge': ('groupBitAnd', 'Merge'), 'cramersVBiasCorrectedMerge': ('cramersVBiasCorrected', 'Merge'), 'maxIntersectionsMerge': ('maxIntersections', 'Merge'), 'meanZTestMerge': ('meanZTest', 'Merge'), 'varSampMerge': ('varSamp', 'Merge'), 'quantileMerge': ('quantile', 'Merge'), 'stddevPopMerge': ('stddevPop', 'Merge'), 'mannWhitneyUTestMerge': ('mannWhitneyUTest', 'Merge'), 'kurtSampMerge': ('kurtSamp', 'Merge'), 'cramersVMerge': ('cramersV', 'Merge'), 'simpleLinearRegressionMerge': ('simpleLinearRegression', 'Merge'), 'maxMapMerge': ('maxMap', 'Merge'), 'topKMerge': ('topK', 'Merge'), 'quantileTDigestMerge': ('quantileTDigest', 'Merge'), 'deltaSumTimestampMerge': ('deltaSumTimestamp', 'Merge'), 'quantilesBFloat16WeightedMerge': ('quantilesBFloat16Weighted', 'Merge'), 'argMinMerge': ('argMin', 'Merge'), 'uniqMerge': ('uniq', 'Merge'), 'theilsUMerge': ('theilsU', 'Merge'), 'groupBitmapXorMerge': ('groupBitmapXor', 'Merge'), 'quantilesTDigestMerge': ('quantilesTDigest', 'Merge'), 'uniqHLL12Merge': ('uniqHLL12', 'Merge'), 'sumWithOverflowMerge': ('sumWithOverflow', 'Merge'), 'stddevSampMerge': ('stddevSamp', 'Merge'), 'quantilesBFloat16Merge': ('quantilesBFloat16', 'Merge'), 'sparkBarMerge': ('sparkBar', 'Merge'), 'quantileExactWeightedMerge': ('quantileExactWeighted', 'Merge'), 'quantilesGKMerge': ('quantilesGK', 'Merge'), 'groupArrayMovingAvgMerge': ('groupArrayMovingAvg', 'Merge'), 'largestTriangleThreeBucketsMerge': ('largestTriangleThreeBuckets', 'Merge'), 'uniqCombined64Merge': ('uniqCombined64', 'Merge'), 'exponentialMovingAverageMerge': ('exponentialMovingAverage', 'Merge'), 'stochasticLinearRegressionMerge': ('stochasticLinearRegression', 'Merge'), 'groupArrayLastMerge': ('groupArrayLast', 'Merge'), 'sumMapMerge': ('sumMap', 'Merge'), 'rankCorrMerge': ('rankCorr', 'Merge'), 'contingencyMerge': ('contingency', 'Merge'), 'groupArrayMerge': ('groupArray', 'Merge'), 'quantilesInterpolatedWeightedMerge': ('quantilesInterpolatedWeighted', 'Merge'), 'avgWeightedMerge': ('avgWeighted', 'Merge'), 'quantilesTimingWeightedMerge': ('quantilesTimingWeighted', 'Merge'), 'quantilesExactWeightedMerge': ('quantilesExactWeighted', 'Merge'), 'groupBitmapMerge': ('groupBitmap', 'Merge'), 'categoricalInformationValueMerge': ('categoricalInformationValue', 'Merge'), 'quantileDeterministicMerge': ('quantileDeterministic', 'Merge'), 'quantileBFloat16Merge': ('quantileBFloat16', 'Merge'), 'uniqExactMerge': ('uniqExact', 'Merge'), 'countMerge': ('count', 'Merge'), 'anyMerge': ('any', 'Merge'), 'quantilesExactMerge': ('quantilesExact', 'Merge'), 'minMapMerge': ('minMap', 'Merge'), 'groupBitXorMerge': ('groupBitXor', 'Merge'), 'quantileExactLowMerge': ('quantileExactLow', 'Merge'), 'sumMerge': ('sum', 'Merge'), 'argMaxMerge': ('argMax', 'Merge'), 'skewSampMerge': ('skewSamp', 'Merge'), 'first_valueMerge': ('first_value', 'Merge'), 'avgMerge': ('avg', 'Merge'), 'entropyMerge': ('entropy', 'Merge'), 'uniqCombinedMerge': ('uniqCombined', 'Merge'), 'groupBitOrMerge': ('groupBitOr', 'Merge'), 'quantileTimingMergeState': ('quantileTiming', 'MergeState'), 'groupBitmapAndMergeState': ('groupBitmapAnd', 'MergeState'), 'quantilesDeterministicMergeState': ('quantilesDeterministic', 'MergeState'), 'groupArrayInsertAtMergeState': ('groupArrayInsertAt', 'MergeState'), 'quantileExactHighMergeState': ('quantileExactHigh', 'MergeState'), 'topKWeightedMergeState': ('topKWeighted', 'MergeState'), 'intervalLengthSumMergeState': ('intervalLengthSum', 'MergeState'), 'anyLastMergeState': ('anyLast', 'MergeState'), 'maxIntersectionsPositionMergeState': ('maxIntersectionsPosition', 'MergeState'), 'varPopMergeState': ('varPop', 'MergeState'), 'last_valueMergeState': ('last_value', 'MergeState'), 'quantilesTimingMergeState': ('quantilesTiming', 'MergeState'), 'quantileGKMergeState': ('quantileGK', 'MergeState'), 'studentTTestMergeState': ('studentTTest', 'MergeState'), 'quantileBFloat16WeightedMergeState': ('quantileBFloat16Weighted', 'MergeState'), 'deltaSumMergeState': ('deltaSum', 'MergeState'), 'quantilesExactLowMergeState': ('quantilesExactLow', 'MergeState'), 'kurtPopMergeState': ('kurtPop', 'MergeState'), 'corrMergeState': ('corr', 'MergeState'), 'groupArraySampleMergeState': ('groupArraySample', 'MergeState'), 'quantileTimingWeightedMergeState': ('quantileTimingWeighted', 'MergeState'), 'quantileExactMergeState': ('quantileExact', 'MergeState'), 'quantilesTDigestWeightedMergeState': ('quantilesTDigestWeighted', 'MergeState'), 'groupArrayMovingSumMergeState': ('groupArrayMovingSum', 'MergeState'), 'quantilesExactHighMergeState': ('quantilesExactHigh', 'MergeState'), 'sumKahanMergeState': ('sumKahan', 'MergeState'), 'stochasticLogisticRegressionMergeState': ('stochasticLogisticRegression', 'MergeState'), 'kolmogorovSmirnovTestMergeState': ('kolmogorovSmirnovTest', 'MergeState'), 'quantilesMergeState': ('quantiles', 'MergeState'), 'medianMergeState': ('median', 'MergeState'), 'welchTTestMergeState': ('welchTTest', 'MergeState'), 'anyHeavyMergeState': ('anyHeavy', 'MergeState'), 'quantileTDigestWeightedMergeState': ('quantileTDigestWeighted', 'MergeState'), 'groupUniqArrayMergeState': ('groupUniqArray', 'MergeState'), 'sumCountMergeState': ('sumCount', 'MergeState'), 'skewPopMergeState': ('skewPop', 'MergeState'), 'covarSampMergeState': ('covarSamp', 'MergeState'), 'maxMergeState': ('max', 'MergeState'), 'quantileInterpolatedWeightedMergeState': ('quantileInterpolatedWeighted', 'MergeState'), 'minMergeState': ('min', 'MergeState'), 'groupBitmapOrMergeState': ('groupBitmapOr', 'MergeState'), 'uniqThetaMergeState': ('uniqTheta', 'MergeState'), 'covarPopMergeState': ('covarPop', 'MergeState'), 'boundingRatioMergeState': ('boundingRatio', 'MergeState'), 'groupBitAndMergeState': ('groupBitAnd', 'MergeState'), 'cramersVBiasCorrectedMergeState': ('cramersVBiasCorrected', 'MergeState'), 'maxIntersectionsMergeState': ('maxIntersections', 'MergeState'), 'meanZTestMergeState': ('meanZTest', 'MergeState'), 'varSampMergeState': ('varSamp', 'MergeState'), 'quantileMergeState': ('quantile', 'MergeState'), 'stddevPopMergeState': ('stddevPop', 'MergeState'), 'mannWhitneyUTestMergeState': ('mannWhitneyUTest', 'MergeState'), 'kurtSampMergeState': ('kurtSamp', 'MergeState'), 'cramersVMergeState': ('cramersV', 'MergeState'), 'simpleLinearRegressionMergeState': ('simpleLinearRegression', 'MergeState'), 'maxMapMergeState': ('maxMap', 'MergeState'), 'topKMergeState': ('topK', 'MergeState'), 'quantileTDigestMergeState': ('quantileTDigest', 'MergeState'), 'deltaSumTimestampMergeState': ('deltaSumTimestamp', 'MergeState'), 'quantilesBFloat16WeightedMergeState': ('quantilesBFloat16Weighted', 'MergeState'), 'argMinMergeState': ('argMin', 'MergeState'), 'uniqMergeState': ('uniq', 'MergeState'), 'theilsUMergeState': ('theilsU', 'MergeState'), 'groupBitmapXorMergeState': ('groupBitmapXor', 'MergeState'), 'quantilesTDigestMergeState': ('quantilesTDigest', 'MergeState'), 'uniqHLL12MergeState': ('uniqHLL12', 'MergeState'), 'sumWithOverflowMergeState': ('sumWithOverflow', 'MergeState'), 'stddevSampMergeState': ('stddevSamp', 'MergeState'), 'quantilesBFloat16MergeState': ('quantilesBFloat16', 'MergeState'), 'sparkBarMergeState': ('sparkBar', 'MergeState'), 'quantileExactWeightedMergeState': ('quantileExactWeighted', 'MergeState'), 'quantilesGKMergeState': ('quantilesGK', 'MergeState'), 'groupArrayMovingAvgMergeState': ('groupArrayMovingAvg', 'MergeState'), 'largestTriangleThreeBucketsMergeState': ('largestTriangleThreeBuckets', 'MergeState'), 'uniqCombined64MergeState': ('uniqCombined64', 'MergeState'), 'exponentialMovingAverageMergeState': ('exponentialMovingAverage', 'MergeState'), 'stochasticLinearRegressionMergeState': ('stochasticLinearRegression', 'MergeState'), 'groupArrayLastMergeState': ('groupArrayLast', 'MergeState'), 'sumMapMergeState': ('sumMap', 'MergeState'), 'rankCorrMergeState': ('rankCorr', 'MergeState'), 'contingencyMergeState': ('contingency', 'MergeState'), 'groupArrayMergeState': ('groupArray', 'MergeState'), 'quantilesInterpolatedWeightedMergeState': ('quantilesInterpolatedWeighted', 'MergeState'), 'avgWeightedMergeState': ('avgWeighted', 'MergeState'), 'quantilesTimingWeightedMergeState': ('quantilesTimingWeighted', 'MergeState'), 'quantilesExactWeightedMergeState': ('quantilesExactWeighted', 'MergeState'), 'groupBitmapMergeState': ('groupBitmap', 'MergeState'), 'categoricalInformationValueMergeState': ('categoricalInformationValue', 'MergeState'), 'quantileDeterministicMergeState': ('quantileDeterministic', 'MergeState'), 'quantileBFloat16MergeState': ('quantileBFloat16', 'MergeState'), 'uniqExactMergeState': ('uniqExact', 'MergeState'), 'countMergeState': ('count', 'MergeState'), 'anyMergeState': ('any', 'MergeState'), 'quantilesExactMergeState': ('quantilesExact', 'MergeState'), 'minMapMergeState': ('minMap', 'MergeState'), 'groupBitXorMergeState': ('groupBitXor', 'MergeState'), 'quantileExactLowMergeState': ('quantileExactLow', 'MergeState'), 'sumMergeState': ('sum', 'MergeState'), 'argMaxMergeState': ('argMax', 'MergeState'), 'skewSampMergeState': ('skewSamp', 'MergeState'), 'first_valueMergeState': ('first_value', 'MergeState'), 'avgMergeState': ('avg', 'MergeState'), 'entropyMergeState': ('entropy', 'MergeState'), 'uniqCombinedMergeState': ('uniqCombined', 'MergeState'), 'groupBitOrMergeState': ('groupBitOr', 'MergeState'), 'quantileTimingForEach': ('quantileTiming', 'ForEach'), 'groupBitmapAndForEach': ('groupBitmapAnd', 'ForEach'), 'quantilesDeterministicForEach': ('quantilesDeterministic', 'ForEach'), 'groupArrayInsertAtForEach': ('groupArrayInsertAt', 'ForEach'), 'quantileExactHighForEach': ('quantileExactHigh', 'ForEach'), 'topKWeightedForEach': ('topKWeighted', 'ForEach'), 'intervalLengthSumForEach': ('intervalLengthSum', 'ForEach'), 'anyLastForEach': ('anyLast', 'ForEach'), 'maxIntersectionsPositionForEach': ('maxIntersectionsPosition', 'ForEach'), 'varPopForEach': ('varPop', 'ForEach'), 'last_valueForEach': ('last_value', 'ForEach'), 'quantilesTimingForEach': ('quantilesTiming', 'ForEach'), 'quantileGKForEach': ('quantileGK', 'ForEach'), 'studentTTestForEach': ('studentTTest', 'ForEach'), 'quantileBFloat16WeightedForEach': ('quantileBFloat16Weighted', 'ForEach'), 'deltaSumForEach': ('deltaSum', 'ForEach'), 'quantilesExactLowForEach': ('quantilesExactLow', 'ForEach'), 'kurtPopForEach': ('kurtPop', 'ForEach'), 'corrForEach': ('corr', 'ForEach'), 'groupArraySampleForEach': ('groupArraySample', 'ForEach'), 'quantileTimingWeightedForEach': ('quantileTimingWeighted', 'ForEach'), 'quantileExactForEach': ('quantileExact', 'ForEach'), 'quantilesTDigestWeightedForEach': ('quantilesTDigestWeighted', 'ForEach'), 'groupArrayMovingSumForEach': ('groupArrayMovingSum', 'ForEach'), 'quantilesExactHighForEach': ('quantilesExactHigh', 'ForEach'), 'sumKahanForEach': ('sumKahan', 'ForEach'), 'stochasticLogisticRegressionForEach': ('stochasticLogisticRegression', 'ForEach'), 'kolmogorovSmirnovTestForEach': ('kolmogorovSmirnovTest', 'ForEach'), 'quantilesForEach': ('quantiles', 'ForEach'), 'medianForEach': ('median', 'ForEach'), 'welchTTestForEach': ('welchTTest', 'ForEach'), 'anyHeavyForEach': ('anyHeavy', 'ForEach'), 'quantileTDigestWeightedForEach': ('quantileTDigestWeighted', 'ForEach'), 'groupUniqArrayForEach': ('groupUniqArray', 'ForEach'), 'sumCountForEach': ('sumCount', 'ForEach'), 'skewPopForEach': ('skewPop', 'ForEach'), 'covarSampForEach': ('covarSamp', 'ForEach'), 'maxForEach': ('max', 'ForEach'), 'quantileInterpolatedWeightedForEach': ('quantileInterpolatedWeighted', 'ForEach'), 'minForEach': ('min', 'ForEach'), 'groupBitmapOrForEach': ('groupBitmapOr', 'ForEach'), 'uniqThetaForEach': ('uniqTheta', 'ForEach'), 'covarPopForEach': ('covarPop', 'ForEach'), 'boundingRatioForEach': ('boundingRatio', 'ForEach'), 'groupBitAndForEach': ('groupBitAnd', 'ForEach'), 'cramersVBiasCorrectedForEach': ('cramersVBiasCorrected', 'ForEach'), 'maxIntersectionsForEach': ('maxIntersections', 'ForEach'), 'meanZTestForEach': ('meanZTest', 'ForEach'), 'varSampForEach': ('varSamp', 'ForEach'), 'quantileForEach': ('quantile', 'ForEach'), 'stddevPopForEach': ('stddevPop', 'ForEach'), 'mannWhitneyUTestForEach': ('mannWhitneyUTest', 'ForEach'), 'kurtSampForEach': ('kurtSamp', 'ForEach'), 'cramersVForEach': ('cramersV', 'ForEach'), 'simpleLinearRegressionForEach': ('simpleLinearRegression', 'ForEach'), 'maxMapForEach': ('maxMap', 'ForEach'), 'topKForEach': ('topK', 'ForEach'), 'quantileTDigestForEach': ('quantileTDigest', 'ForEach'), 'deltaSumTimestampForEach': ('deltaSumTimestamp', 'ForEach'), 'quantilesBFloat16WeightedForEach': ('quantilesBFloat16Weighted', 'ForEach'), 'argMinForEach': ('argMin', 'ForEach'), 'uniqForEach': ('uniq', 'ForEach'), 'theilsUForEach': ('theilsU', 'ForEach'), 'groupBitmapXorForEach': ('groupBitmapXor', 'ForEach'), 'quantilesTDigestForEach': ('quantilesTDigest', 'ForEach'), 'uniqHLL12ForEach': ('uniqHLL12', 'ForEach'), 'sumWithOverflowForEach': ('sumWithOverflow', 'ForEach'), 'stddevSampForEach': ('stddevSamp', 'ForEach'), 'quantilesBFloat16ForEach': ('quantilesBFloat16', 'ForEach'), 'sparkBarForEach': ('sparkBar', 'ForEach'), 'quantileExactWeightedForEach': ('quantileExactWeighted', 'ForEach'), 'quantilesGKForEach': ('quantilesGK', 'ForEach'), 'groupArrayMovingAvgForEach': ('groupArrayMovingAvg', 'ForEach'), 'largestTriangleThreeBucketsForEach': ('largestTriangleThreeBuckets', 'ForEach'), 'uniqCombined64ForEach': ('uniqCombined64', 'ForEach'), 'exponentialMovingAverageForEach': ('exponentialMovingAverage', 'ForEach'), 'stochasticLinearRegressionForEach': ('stochasticLinearRegression', 'ForEach'), 'groupArrayLastForEach': ('groupArrayLast', 'ForEach'), 'sumMapForEach': ('sumMap', 'ForEach'), 'rankCorrForEach': ('rankCorr', 'ForEach'), 'contingencyForEach': ('contingency', 'ForEach'), 'groupArrayForEach': ('groupArray', 'ForEach'), 'quantilesInterpolatedWeightedForEach': ('quantilesInterpolatedWeighted', 'ForEach'), 'avgWeightedForEach': ('avgWeighted', 'ForEach'), 'quantilesTimingWeightedForEach': ('quantilesTimingWeighted', 'ForEach'), 'quantilesExactWeightedForEach': ('quantilesExactWeighted', 'ForEach'), 'groupBitmapForEach': ('groupBitmap', 'ForEach'), 'categoricalInformationValueForEach': ('categoricalInformationValue', 'ForEach'), 'quantileDeterministicForEach': ('quantileDeterministic', 'ForEach'), 'quantileBFloat16ForEach': ('quantileBFloat16', 'ForEach'), 'uniqExactForEach': ('uniqExact', 'ForEach'), 'countForEach': ('count', 'ForEach'), 'anyForEach': ('any', 'ForEach'), 'quantilesExactForEach': ('quantilesExact', 'ForEach'), 'minMapForEach': ('minMap', 'ForEach'), 'groupBitXorForEach': ('groupBitXor', 'ForEach'), 'quantileExactLowForEach': ('quantileExactLow', 'ForEach'), 'sumForEach': ('sum', 'ForEach'), 'argMaxForEach': ('argMax', 'ForEach'), 'skewSampForEach': ('skewSamp', 'ForEach'), 'first_valueForEach': ('first_value', 'ForEach'), 'avgForEach': ('avg', 'ForEach'), 'entropyForEach': ('entropy', 'ForEach'), 'uniqCombinedForEach': ('uniqCombined', 'ForEach'), 'groupBitOrForEach': ('groupBitOr', 'ForEach'), 'quantileTimingDistinct': ('quantileTiming', 'Distinct'), 'groupBitmapAndDistinct': ('groupBitmapAnd', 'Distinct'), 'quantilesDeterministicDistinct': ('quantilesDeterministic', 'Distinct'), 'groupArrayInsertAtDistinct': ('groupArrayInsertAt', 'Distinct'), 'quantileExactHighDistinct': ('quantileExactHigh', 'Distinct'), 'topKWeightedDistinct': ('topKWeighted', 'Distinct'), 'intervalLengthSumDistinct': ('intervalLengthSum', 'Distinct'), 'anyLastDistinct': ('anyLast', 'Distinct'), 'maxIntersectionsPositionDistinct': ('maxIntersectionsPosition', 'Distinct'), 'varPopDistinct': ('varPop', 'Distinct'), 'last_valueDistinct': ('last_value', 'Distinct'), 'quantilesTimingDistinct': ('quantilesTiming', 'Distinct'), 'quantileGKDistinct': ('quantileGK', 'Distinct'), 'studentTTestDistinct': ('studentTTest', 'Distinct'), 'quantileBFloat16WeightedDistinct': ('quantileBFloat16Weighted', 'Distinct'), 'deltaSumDistinct': ('deltaSum', 'Distinct'), 'quantilesExactLowDistinct': ('quantilesExactLow', 'Distinct'), 'kurtPopDistinct': ('kurtPop', 'Distinct'), 'corrDistinct': ('corr', 'Distinct'), 'groupArraySampleDistinct': ('groupArraySample', 'Distinct'), 'quantileTimingWeightedDistinct': ('quantileTimingWeighted', 'Distinct'), 'quantileExactDistinct': ('quantileExact', 'Distinct'), 'quantilesTDigestWeightedDistinct': ('quantilesTDigestWeighted', 'Distinct'), 'groupArrayMovingSumDistinct': ('groupArrayMovingSum', 'Distinct'), 'quantilesExactHighDistinct': ('quantilesExactHigh', 'Distinct'), 'sumKahanDistinct': ('sumKahan', 'Distinct'), 'stochasticLogisticRegressionDistinct': ('stochasticLogisticRegression', 'Distinct'), 'kolmogorovSmirnovTestDistinct': ('kolmogorovSmirnovTest', 'Distinct'), 'quantilesDistinct': ('quantiles', 'Distinct'), 'medianDistinct': ('median', 'Distinct'), 'welchTTestDistinct': ('welchTTest', 'Distinct'), 'anyHeavyDistinct': ('anyHeavy', 'Distinct'), 'quantileTDigestWeightedDistinct': ('quantileTDigestWeighted', 'Distinct'), 'groupUniqArrayDistinct': ('groupUniqArray', 'Distinct'), 'sumCountDistinct': ('sumCount', 'Distinct'), 'skewPopDistinct': ('skewPop', 'Distinct'), 'covarSampDistinct': ('covarSamp', 'Distinct'), 'maxDistinct': ('max', 'Distinct'), 'quantileInterpolatedWeightedDistinct': ('quantileInterpolatedWeighted', 'Distinct'), 'minDistinct': ('min', 'Distinct'), 'groupBitmapOrDistinct': ('groupBitmapOr', 'Distinct'), 'uniqThetaDistinct': ('uniqTheta', 'Distinct'), 'covarPopDistinct': ('covarPop', 'Distinct'), 'boundingRatioDistinct': ('boundingRatio', 'Distinct'), 'groupBitAndDistinct': ('groupBitAnd', 'Distinct'), 'cramersVBiasCorrectedDistinct': ('cramersVBiasCorrected', 'Distinct'), 'maxIntersectionsDistinct': ('maxIntersections', 'Distinct'), 'meanZTestDistinct': ('meanZTest', 'Distinct'), 'varSampDistinct': ('varSamp', 'Distinct'), 'quantileDistinct': ('quantile', 'Distinct'), 'stddevPopDistinct': ('stddevPop', 'Distinct'), 'mannWhitneyUTestDistinct': ('mannWhitneyUTest', 'Distinct'), 'kurtSampDistinct': ('kurtSamp', 'Distinct'), 'cramersVDistinct': ('cramersV', 'Distinct'), 'simpleLinearRegressionDistinct': ('simpleLinearRegression', 'Distinct'), 'maxMapDistinct': ('maxMap', 'Distinct'), 'topKDistinct': ('topK', 'Distinct'), 'quantileTDigestDistinct': ('quantileTDigest', 'Distinct'), 'deltaSumTimestampDistinct': ('deltaSumTimestamp', 'Distinct'), 'quantilesBFloat16WeightedDistinct': ('quantilesBFloat16Weighted', 'Distinct'), 'argMinDistinct': ('argMin', 'Distinct'), 'uniqDistinct': ('uniq', 'Distinct'), 'theilsUDistinct': ('theilsU', 'Distinct'), 'groupBitmapXorDistinct': ('groupBitmapXor', 'Distinct'), 'quantilesTDigestDistinct': ('quantilesTDigest', 'Distinct'), 'uniqHLL12Distinct': ('uniqHLL12', 'Distinct'), 'sumWithOverflowDistinct': ('sumWithOverflow', 'Distinct'), 'stddevSampDistinct': ('stddevSamp', 'Distinct'), 'quantilesBFloat16Distinct': ('quantilesBFloat16', 'Distinct'), 'sparkBarDistinct': ('sparkBar', 'Distinct'), 'quantileExactWeightedDistinct': ('quantileExactWeighted', 'Distinct'), 'quantilesGKDistinct': ('quantilesGK', 'Distinct'), 'groupArrayMovingAvgDistinct': ('groupArrayMovingAvg', 'Distinct'), 'largestTriangleThreeBucketsDistinct': ('largestTriangleThreeBuckets', 'Distinct'), 'uniqCombined64Distinct': ('uniqCombined64', 'Distinct'), 'exponentialMovingAverageDistinct': ('exponentialMovingAverage', 'Distinct'), 'stochasticLinearRegressionDistinct': ('stochasticLinearRegression', 'Distinct'), 'groupArrayLastDistinct': ('groupArrayLast', 'Distinct'), 'sumMapDistinct': ('sumMap', 'Distinct'), 'rankCorrDistinct': ('rankCorr', 'Distinct'), 'contingencyDistinct': ('contingency', 'Distinct'), 'groupArrayDistinct': ('groupArray', 'Distinct'), 'quantilesInterpolatedWeightedDistinct': ('quantilesInterpolatedWeighted', 'Distinct'), 'avgWeightedDistinct': ('avgWeighted', 'Distinct'), 'quantilesTimingWeightedDistinct': ('quantilesTimingWeighted', 'Distinct'), 'quantilesExactWeightedDistinct': ('quantilesExactWeighted', 'Distinct'), 'groupBitmapDistinct': ('groupBitmap', 'Distinct'), 'categoricalInformationValueDistinct': ('categoricalInformationValue', 'Distinct'), 'quantileDeterministicDistinct': ('quantileDeterministic', 'Distinct'), 'quantileBFloat16Distinct': ('quantileBFloat16', 'Distinct'), 'uniqExactDistinct': ('uniqExact', 'Distinct'), 'countDistinct': ('count', 'Distinct'), 'anyDistinct': ('any', 'Distinct'), 'quantilesExactDistinct': ('quantilesExact', 'Distinct'), 'minMapDistinct': ('minMap', 'Distinct'), 'groupBitXorDistinct': ('groupBitXor', 'Distinct'), 'quantileExactLowDistinct': ('quantileExactLow', 'Distinct'), 'sumDistinct': ('sum', 'Distinct'), 'argMaxDistinct': ('argMax', 'Distinct'), 'skewSampDistinct': ('skewSamp', 'Distinct'), 'first_valueDistinct': ('first_value', 'Distinct'), 'avgDistinct': ('avg', 'Distinct'), 'entropyDistinct': ('entropy', 'Distinct'), 'uniqCombinedDistinct': ('uniqCombined', 'Distinct'), 'groupBitOrDistinct': ('groupBitOr', 'Distinct'), 'quantileTimingOrDefault': ('quantileTiming', 'OrDefault'), 'groupBitmapAndOrDefault': ('groupBitmapAnd', 'OrDefault'), 'quantilesDeterministicOrDefault': ('quantilesDeterministic', 'OrDefault'), 'groupArrayInsertAtOrDefault': ('groupArrayInsertAt', 'OrDefault'), 'quantileExactHighOrDefault': ('quantileExactHigh', 'OrDefault'), 'topKWeightedOrDefault': ('topKWeighted', 'OrDefault'), 'intervalLengthSumOrDefault': ('intervalLengthSum', 'OrDefault'), 'anyLastOrDefault': ('anyLast', 'OrDefault'), 'maxIntersectionsPositionOrDefault': ('maxIntersectionsPosition', 'OrDefault'), 'varPopOrDefault': ('varPop', 'OrDefault'), 'last_valueOrDefault': ('last_value', 'OrDefault'), 'quantilesTimingOrDefault': ('quantilesTiming', 'OrDefault'), 'quantileGKOrDefault': ('quantileGK', 'OrDefault'), 'studentTTestOrDefault': ('studentTTest', 'OrDefault'), 'quantileBFloat16WeightedOrDefault': ('quantileBFloat16Weighted', 'OrDefault'), 'deltaSumOrDefault': ('deltaSum', 'OrDefault'), 'quantilesExactLowOrDefault': ('quantilesExactLow', 'OrDefault'), 'kurtPopOrDefault': ('kurtPop', 'OrDefault'), 'corrOrDefault': ('corr', 'OrDefault'), 'groupArraySampleOrDefault': ('groupArraySample', 'OrDefault'), 'quantileTimingWeightedOrDefault': ('quantileTimingWeighted', 'OrDefault'), 'quantileExactOrDefault': ('quantileExact', 'OrDefault'), 'quantilesTDigestWeightedOrDefault': ('quantilesTDigestWeighted', 'OrDefault'), 'groupArrayMovingSumOrDefault': ('groupArrayMovingSum', 'OrDefault'), 'quantilesExactHighOrDefault': ('quantilesExactHigh', 'OrDefault'), 'sumKahanOrDefault': ('sumKahan', 'OrDefault'), 'stochasticLogisticRegressionOrDefault': ('stochasticLogisticRegression', 'OrDefault'), 'kolmogorovSmirnovTestOrDefault': ('kolmogorovSmirnovTest', 'OrDefault'), 'quantilesOrDefault': ('quantiles', 'OrDefault'), 'medianOrDefault': ('median', 'OrDefault'), 'welchTTestOrDefault': ('welchTTest', 'OrDefault'), 'anyHeavyOrDefault': ('anyHeavy', 'OrDefault'), 'quantileTDigestWeightedOrDefault': ('quantileTDigestWeighted', 'OrDefault'), 'groupUniqArrayOrDefault': ('groupUniqArray', 'OrDefault'), 'sumCountOrDefault': ('sumCount', 'OrDefault'), 'skewPopOrDefault': ('skewPop', 'OrDefault'), 'covarSampOrDefault': ('covarSamp', 'OrDefault'), 'maxOrDefault': ('max', 'OrDefault'), 'quantileInterpolatedWeightedOrDefault': ('quantileInterpolatedWeighted', 'OrDefault'), 'minOrDefault': ('min', 'OrDefault'), 'groupBitmapOrOrDefault': ('groupBitmapOr', 'OrDefault'), 'uniqThetaOrDefault': ('uniqTheta', 'OrDefault'), 'covarPopOrDefault': ('covarPop', 'OrDefault'), 'boundingRatioOrDefault': ('boundingRatio', 'OrDefault'), 'groupBitAndOrDefault': ('groupBitAnd', 'OrDefault'), 'cramersVBiasCorrectedOrDefault': ('cramersVBiasCorrected', 'OrDefault'), 'maxIntersectionsOrDefault': ('maxIntersections', 'OrDefault'), 'meanZTestOrDefault': ('meanZTest', 'OrDefault'), 'varSampOrDefault': ('varSamp', 'OrDefault'), 'quantileOrDefault': ('quantile', 'OrDefault'), 'stddevPopOrDefault': ('stddevPop', 'OrDefault'), 'mannWhitneyUTestOrDefault': ('mannWhitneyUTest', 'OrDefault'), 'kurtSampOrDefault': ('kurtSamp', 'OrDefault'), 'cramersVOrDefault': ('cramersV', 'OrDefault'), 'simpleLinearRegressionOrDefault': ('simpleLinearRegression', 'OrDefault'), 'maxMapOrDefault': ('maxMap', 'OrDefault'), 'topKOrDefault': ('topK', 'OrDefault'), 'quantileTDigestOrDefault': ('quantileTDigest', 'OrDefault'), 'deltaSumTimestampOrDefault': ('deltaSumTimestamp', 'OrDefault'), 'quantilesBFloat16WeightedOrDefault': ('quantilesBFloat16Weighted', 'OrDefault'), 'argMinOrDefault': ('argMin', 'OrDefault'), 'uniqOrDefault': ('uniq', 'OrDefault'), 'theilsUOrDefault': ('theilsU', 'OrDefault'), 'groupBitmapXorOrDefault': ('groupBitmapXor', 'OrDefault'), 'quantilesTDigestOrDefault': ('quantilesTDigest', 'OrDefault'), 'uniqHLL12OrDefault': ('uniqHLL12', 'OrDefault'), 'sumWithOverflowOrDefault': ('sumWithOverflow', 'OrDefault'), 'stddevSampOrDefault': ('stddevSamp', 'OrDefault'), 'quantilesBFloat16OrDefault': ('quantilesBFloat16', 'OrDefault'), 'sparkBarOrDefault': ('sparkBar', 'OrDefault'), 'quantileExactWeightedOrDefault': ('quantileExactWeighted', 'OrDefault'), 'quantilesGKOrDefault': ('quantilesGK', 'OrDefault'), 'groupArrayMovingAvgOrDefault': ('groupArrayMovingAvg', 'OrDefault'), 'largestTriangleThreeBucketsOrDefault': ('largestTriangleThreeBuckets', 'OrDefault'), 'uniqCombined64OrDefault': ('uniqCombined64', 'OrDefault'), 'exponentialMovingAverageOrDefault': ('exponentialMovingAverage', 'OrDefault'), 'stochasticLinearRegressionOrDefault': ('stochasticLinearRegression', 'OrDefault'), 'groupArrayLastOrDefault': ('groupArrayLast', 'OrDefault'), 'sumMapOrDefault': ('sumMap', 'OrDefault'), 'rankCorrOrDefault': ('rankCorr', 'OrDefault'), 'contingencyOrDefault': ('contingency', 'OrDefault'), 'groupArrayOrDefault': ('groupArray', 'OrDefault'), 'quantilesInterpolatedWeightedOrDefault': ('quantilesInterpolatedWeighted', 'OrDefault'), 'avgWeightedOrDefault': ('avgWeighted', 'OrDefault'), 'quantilesTimingWeightedOrDefault': ('quantilesTimingWeighted', 'OrDefault'), 'quantilesExactWeightedOrDefault': ('quantilesExactWeighted', 'OrDefault'), 'groupBitmapOrDefault': ('groupBitmap', 'OrDefault'), 'categoricalInformationValueOrDefault': ('categoricalInformationValue', 'OrDefault'), 'quantileDeterministicOrDefault': ('quantileDeterministic', 'OrDefault'), 'quantileBFloat16OrDefault': ('quantileBFloat16', 'OrDefault'), 'uniqExactOrDefault': ('uniqExact', 'OrDefault'), 'countOrDefault': ('count', 'OrDefault'), 'anyOrDefault': ('any', 'OrDefault'), 'quantilesExactOrDefault': ('quantilesExact', 'OrDefault'), 'minMapOrDefault': ('minMap', 'OrDefault'), 'groupBitXorOrDefault': ('groupBitXor', 'OrDefault'), 'quantileExactLowOrDefault': ('quantileExactLow', 'OrDefault'), 'sumOrDefault': ('sum', 'OrDefault'), 'argMaxOrDefault': ('argMax', 'OrDefault'), 'skewSampOrDefault': ('skewSamp', 'OrDefault'), 'first_valueOrDefault': ('first_value', 'OrDefault'), 'avgOrDefault': ('avg', 'OrDefault'), 'entropyOrDefault': ('entropy', 'OrDefault'), 'uniqCombinedOrDefault': ('uniqCombined', 'OrDefault'), 'groupBitOrOrDefault': ('groupBitOr', 'OrDefault'), 'quantileTimingOrNull': ('quantileTiming', 'OrNull'), 'groupBitmapAndOrNull': ('groupBitmapAnd', 'OrNull'), 'quantilesDeterministicOrNull': ('quantilesDeterministic', 'OrNull'), 'groupArrayInsertAtOrNull': ('groupArrayInsertAt', 'OrNull'), 'quantileExactHighOrNull': ('quantileExactHigh', 'OrNull'), 'topKWeightedOrNull': ('topKWeighted', 'OrNull'), 'intervalLengthSumOrNull': ('intervalLengthSum', 'OrNull'), 'anyLastOrNull': ('anyLast', 'OrNull'), 'maxIntersectionsPositionOrNull': ('maxIntersectionsPosition', 'OrNull'), 'varPopOrNull': ('varPop', 'OrNull'), 'last_valueOrNull': ('last_value', 'OrNull'), 'quantilesTimingOrNull': ('quantilesTiming', 'OrNull'), 'quantileGKOrNull': ('quantileGK', 'OrNull'), 'studentTTestOrNull': ('studentTTest', 'OrNull'), 'quantileBFloat16WeightedOrNull': ('quantileBFloat16Weighted', 'OrNull'), 'deltaSumOrNull': ('deltaSum', 'OrNull'), 'quantilesExactLowOrNull': ('quantilesExactLow', 'OrNull'), 'kurtPopOrNull': ('kurtPop', 'OrNull'), 'corrOrNull': ('corr', 'OrNull'), 'groupArraySampleOrNull': ('groupArraySample', 'OrNull'), 'quantileTimingWeightedOrNull': ('quantileTimingWeighted', 'OrNull'), 'quantileExactOrNull': ('quantileExact', 'OrNull'), 'quantilesTDigestWeightedOrNull': ('quantilesTDigestWeighted', 'OrNull'), 'groupArrayMovingSumOrNull': ('groupArrayMovingSum', 'OrNull'), 'quantilesExactHighOrNull': ('quantilesExactHigh', 'OrNull'), 'sumKahanOrNull': ('sumKahan', 'OrNull'), 'stochasticLogisticRegressionOrNull': ('stochasticLogisticRegression', 'OrNull'), 'kolmogorovSmirnovTestOrNull': ('kolmogorovSmirnovTest', 'OrNull'), 'quantilesOrNull': ('quantiles', 'OrNull'), 'medianOrNull': ('median', 'OrNull'), 'welchTTestOrNull': ('welchTTest', 'OrNull'), 'anyHeavyOrNull': ('anyHeavy', 'OrNull'), 'quantileTDigestWeightedOrNull': ('quantileTDigestWeighted', 'OrNull'), 'groupUniqArrayOrNull': ('groupUniqArray', 'OrNull'), 'sumCountOrNull': ('sumCount', 'OrNull'), 'skewPopOrNull': ('skewPop', 'OrNull'), 'covarSampOrNull': ('covarSamp', 'OrNull'), 'maxOrNull': ('max', 'OrNull'), 'quantileInterpolatedWeightedOrNull': ('quantileInterpolatedWeighted', 'OrNull'), 'minOrNull': ('min', 'OrNull'), 'groupBitmapOrOrNull': ('groupBitmapOr', 'OrNull'), 'uniqThetaOrNull': ('uniqTheta', 'OrNull'), 'covarPopOrNull': ('covarPop', 'OrNull'), 'boundingRatioOrNull': ('boundingRatio', 'OrNull'), 'groupBitAndOrNull': ('groupBitAnd', 'OrNull'), 'cramersVBiasCorrectedOrNull': ('cramersVBiasCorrected', 'OrNull'), 'maxIntersectionsOrNull': ('maxIntersections', 'OrNull'), 'meanZTestOrNull': ('meanZTest', 'OrNull'), 'varSampOrNull': ('varSamp', 'OrNull'), 'quantileOrNull': ('quantile', 'OrNull'), 'stddevPopOrNull': ('stddevPop', 'OrNull'), 'mannWhitneyUTestOrNull': ('mannWhitneyUTest', 'OrNull'), 'kurtSampOrNull': ('kurtSamp', 'OrNull'), 'cramersVOrNull': ('cramersV', 'OrNull'), 'simpleLinearRegressionOrNull': ('simpleLinearRegression', 'OrNull'), 'maxMapOrNull': ('maxMap', 'OrNull'), 'topKOrNull': ('topK', 'OrNull'), 'quantileTDigestOrNull': ('quantileTDigest', 'OrNull'), 'deltaSumTimestampOrNull': ('deltaSumTimestamp', 'OrNull'), 'quantilesBFloat16WeightedOrNull': ('quantilesBFloat16Weighted', 'OrNull'), 'argMinOrNull': ('argMin', 'OrNull'), 'uniqOrNull': ('uniq', 'OrNull'), 'theilsUOrNull': ('theilsU', 'OrNull'), 'groupBitmapXorOrNull': ('groupBitmapXor', 'OrNull'), 'quantilesTDigestOrNull': ('quantilesTDigest', 'OrNull'), 'uniqHLL12OrNull': ('uniqHLL12', 'OrNull'), 'sumWithOverflowOrNull': ('sumWithOverflow', 'OrNull'), 'stddevSampOrNull': ('stddevSamp', 'OrNull'), 'quantilesBFloat16OrNull': ('quantilesBFloat16', 'OrNull'), 'sparkBarOrNull': ('sparkBar', 'OrNull'), 'quantileExactWeightedOrNull': ('quantileExactWeighted', 'OrNull'), 'quantilesGKOrNull': ('quantilesGK', 'OrNull'), 'groupArrayMovingAvgOrNull': ('groupArrayMovingAvg', 'OrNull'), 'largestTriangleThreeBucketsOrNull': ('largestTriangleThreeBuckets', 'OrNull'), 'uniqCombined64OrNull': ('uniqCombined64', 'OrNull'), 'exponentialMovingAverageOrNull': ('exponentialMovingAverage', 'OrNull'), 'stochasticLinearRegressionOrNull': ('stochasticLinearRegression', 'OrNull'), 'groupArrayLastOrNull': ('groupArrayLast', 'OrNull'), 'sumMapOrNull': ('sumMap', 'OrNull'), 'rankCorrOrNull': ('rankCorr', 'OrNull'), 'contingencyOrNull': ('contingency', 'OrNull'), 'groupArrayOrNull': ('groupArray', 'OrNull'), 'quantilesInterpolatedWeightedOrNull': ('quantilesInterpolatedWeighted', 'OrNull'), 'avgWeightedOrNull': ('avgWeighted', 'OrNull'), 'quantilesTimingWeightedOrNull': ('quantilesTimingWeighted', 'OrNull'), 'quantilesExactWeightedOrNull': ('quantilesExactWeighted', 'OrNull'), 'groupBitmapOrNull': ('groupBitmap', 'OrNull'), 'categoricalInformationValueOrNull': ('categoricalInformationValue', 'OrNull'), 'quantileDeterministicOrNull': ('quantileDeterministic', 'OrNull'), 'quantileBFloat16OrNull': ('quantileBFloat16', 'OrNull'), 'uniqExactOrNull': ('uniqExact', 'OrNull'), 'countOrNull': ('count', 'OrNull'), 'anyOrNull': ('any', 'OrNull'), 'quantilesExactOrNull': ('quantilesExact', 'OrNull'), 'minMapOrNull': ('minMap', 'OrNull'), 'groupBitXorOrNull': ('groupBitXor', 'OrNull'), 'quantileExactLowOrNull': ('quantileExactLow', 'OrNull'), 'sumOrNull': ('sum', 'OrNull'), 'argMaxOrNull': ('argMax', 'OrNull'), 'skewSampOrNull': ('skewSamp', 'OrNull'), 'first_valueOrNull': ('first_value', 'OrNull'), 'avgOrNull': ('avg', 'OrNull'), 'entropyOrNull': ('entropy', 'OrNull'), 'uniqCombinedOrNull': ('uniqCombined', 'OrNull'), 'groupBitOrOrNull': ('groupBitOr', 'OrNull'), 'quantileTimingResample': ('quantileTiming', 'Resample'), 'groupBitmapAndResample': ('groupBitmapAnd', 'Resample'), 'quantilesDeterministicResample': ('quantilesDeterministic', 'Resample'), 'groupArrayInsertAtResample': ('groupArrayInsertAt', 'Resample'), 'quantileExactHighResample': ('quantileExactHigh', 'Resample'), 'topKWeightedResample': ('topKWeighted', 'Resample'), 'intervalLengthSumResample': ('intervalLengthSum', 'Resample'), 'anyLastResample': ('anyLast', 'Resample'), 'maxIntersectionsPositionResample': ('maxIntersectionsPosition', 'Resample'), 'varPopResample': ('varPop', 'Resample'), 'last_valueResample': ('last_value', 'Resample'), 'quantilesTimingResample': ('quantilesTiming', 'Resample'), 'quantileGKResample': ('quantileGK', 'Resample'), 'studentTTestResample': ('studentTTest', 'Resample'), 'quantileBFloat16WeightedResample': ('quantileBFloat16Weighted', 'Resample'), 'deltaSumResample': ('deltaSum', 'Resample'), 'quantilesExactLowResample': ('quantilesExactLow', 'Resample'), 'kurtPopResample': ('kurtPop', 'Resample'), 'corrResample': ('corr', 'Resample'), 'groupArraySampleResample': ('groupArraySample', 'Resample'), 'quantileTimingWeightedResample': ('quantileTimingWeighted', 'Resample'), 'quantileExactResample': ('quantileExact', 'Resample'), 'quantilesTDigestWeightedResample': ('quantilesTDigestWeighted', 'Resample'), 'groupArrayMovingSumResample': ('groupArrayMovingSum', 'Resample'), 'quantilesExactHighResample': ('quantilesExactHigh', 'Resample'), 'sumKahanResample': ('sumKahan', 'Resample'), 'stochasticLogisticRegressionResample': ('stochasticLogisticRegression', 'Resample'), 'kolmogorovSmirnovTestResample': ('kolmogorovSmirnovTest', 'Resample'), 'quantilesResample': ('quantiles', 'Resample'), 'medianResample': ('median', 'Resample'), 'welchTTestResample': ('welchTTest', 'Resample'), 'anyHeavyResample': ('anyHeavy', 'Resample'), 'quantileTDigestWeightedResample': ('quantileTDigestWeighted', 'Resample'), 'groupUniqArrayResample': ('groupUniqArray', 'Resample'), 'sumCountResample': ('sumCount', 'Resample'), 'skewPopResample': ('skewPop', 'Resample'), 'covarSampResample': ('covarSamp', 'Resample'), 'maxResample': ('max', 'Resample'), 'quantileInterpolatedWeightedResample': ('quantileInterpolatedWeighted', 'Resample'), 'minResample': ('min', 'Resample'), 'groupBitmapOrResample': ('groupBitmapOr', 'Resample'), 'uniqThetaResample': ('uniqTheta', 'Resample'), 'covarPopResample': ('covarPop', 'Resample'), 'boundingRatioResample': ('boundingRatio', 'Resample'), 'groupBitAndResample': ('groupBitAnd', 'Resample'), 'cramersVBiasCorrectedResample': ('cramersVBiasCorrected', 'Resample'), 'maxIntersectionsResample': ('maxIntersections', 'Resample'), 'meanZTestResample': ('meanZTest', 'Resample'), 'varSampResample': ('varSamp', 'Resample'), 'quantileResample': ('quantile', 'Resample'), 'stddevPopResample': ('stddevPop', 'Resample'), 'mannWhitneyUTestResample': ('mannWhitneyUTest', 'Resample'), 'kurtSampResample': ('kurtSamp', 'Resample'), 'cramersVResample': ('cramersV', 'Resample'), 'simpleLinearRegressionResample': ('simpleLinearRegression', 'Resample'), 'maxMapResample': ('maxMap', 'Resample'), 'topKResample': ('topK', 'Resample'), 'quantileTDigestResample': ('quantileTDigest', 'Resample'), 'deltaSumTimestampResample': ('deltaSumTimestamp', 'Resample'), 'quantilesBFloat16WeightedResample': ('quantilesBFloat16Weighted', 'Resample'), 'argMinResample': ('argMin', 'Resample'), 'uniqResample': ('uniq', 'Resample'), 'theilsUResample': ('theilsU', 'Resample'), 'groupBitmapXorResample': ('groupBitmapXor', 'Resample'), 'quantilesTDigestResample': ('quantilesTDigest', 'Resample'), 'uniqHLL12Resample': ('uniqHLL12', 'Resample'), 'sumWithOverflowResample': ('sumWithOverflow', 'Resample'), 'stddevSampResample': ('stddevSamp', 'Resample'), 'quantilesBFloat16Resample': ('quantilesBFloat16', 'Resample'), 'sparkBarResample': ('sparkBar', 'Resample'), 'quantileExactWeightedResample': ('quantileExactWeighted', 'Resample'), 'quantilesGKResample': ('quantilesGK', 'Resample'), 'groupArrayMovingAvgResample': ('groupArrayMovingAvg', 'Resample'), 'largestTriangleThreeBucketsResample': ('largestTriangleThreeBuckets', 'Resample'), 'uniqCombined64Resample': ('uniqCombined64', 'Resample'), 'exponentialMovingAverageResample': ('exponentialMovingAverage', 'Resample'), 'stochasticLinearRegressionResample': ('stochasticLinearRegression', 'Resample'), 'groupArrayLastResample': ('groupArrayLast', 'Resample'), 'sumMapResample': ('sumMap', 'Resample'), 'rankCorrResample': ('rankCorr', 'Resample'), 'contingencyResample': ('contingency', 'Resample'), 'groupArrayResample': ('groupArray', 'Resample'), 'quantilesInterpolatedWeightedResample': ('quantilesInterpolatedWeighted', 'Resample'), 'avgWeightedResample': ('avgWeighted', 'Resample'), 'quantilesTimingWeightedResample': ('quantilesTimingWeighted', 'Resample'), 'quantilesExactWeightedResample': ('quantilesExactWeighted', 'Resample'), 'groupBitmapResample': ('groupBitmap', 'Resample'), 'categoricalInformationValueResample': ('categoricalInformationValue', 'Resample'), 'quantileDeterministicResample': ('quantileDeterministic', 'Resample'), 'quantileBFloat16Resample': ('quantileBFloat16', 'Resample'), 'uniqExactResample': ('uniqExact', 'Resample'), 'countResample': ('count', 'Resample'), 'anyResample': ('any', 'Resample'), 'quantilesExactResample': ('quantilesExact', 'Resample'), 'minMapResample': ('minMap', 'Resample'), 'groupBitXorResample': ('groupBitXor', 'Resample'), 'quantileExactLowResample': ('quantileExactLow', 'Resample'), 'sumResample': ('sum', 'Resample'), 'argMaxResample': ('argMax', 'Resample'), 'skewSampResample': ('skewSamp', 'Resample'), 'first_valueResample': ('first_value', 'Resample'), 'avgResample': ('avg', 'Resample'), 'entropyResample': ('entropy', 'Resample'), 'uniqCombinedResample': ('uniqCombined', 'Resample'), 'groupBitOrResample': ('groupBitOr', 'Resample'), 'quantileTimingArgMin': ('quantileTiming', 'ArgMin'), 'groupBitmapAndArgMin': ('groupBitmapAnd', 'ArgMin'), 'quantilesDeterministicArgMin': ('quantilesDeterministic', 'ArgMin'), 'groupArrayInsertAtArgMin': ('groupArrayInsertAt', 'ArgMin'), 'quantileExactHighArgMin': ('quantileExactHigh', 'ArgMin'), 'topKWeightedArgMin': ('topKWeighted', 'ArgMin'), 'intervalLengthSumArgMin': ('intervalLengthSum', 'ArgMin'), 'anyLastArgMin': ('anyLast', 'ArgMin'), 'maxIntersectionsPositionArgMin': ('maxIntersectionsPosition', 'ArgMin'), 'varPopArgMin': ('varPop', 'ArgMin'), 'last_valueArgMin': ('last_value', 'ArgMin'), 'quantilesTimingArgMin': ('quantilesTiming', 'ArgMin'), 'quantileGKArgMin': ('quantileGK', 'ArgMin'), 'studentTTestArgMin': ('studentTTest', 'ArgMin'), 'quantileBFloat16WeightedArgMin': ('quantileBFloat16Weighted', 'ArgMin'), 'deltaSumArgMin': ('deltaSum', 'ArgMin'), 'quantilesExactLowArgMin': ('quantilesExactLow', 'ArgMin'), 'kurtPopArgMin': ('kurtPop', 'ArgMin'), 'corrArgMin': ('corr', 'ArgMin'), 'groupArraySampleArgMin': ('groupArraySample', 'ArgMin'), 'quantileTimingWeightedArgMin': ('quantileTimingWeighted', 'ArgMin'), 'quantileExactArgMin': ('quantileExact', 'ArgMin'), 'quantilesTDigestWeightedArgMin': ('quantilesTDigestWeighted', 'ArgMin'), 'groupArrayMovingSumArgMin': ('groupArrayMovingSum', 'ArgMin'), 'quantilesExactHighArgMin': ('quantilesExactHigh', 'ArgMin'), 'sumKahanArgMin': ('sumKahan', 'ArgMin'), 'stochasticLogisticRegressionArgMin': ('stochasticLogisticRegression', 'ArgMin'), 'kolmogorovSmirnovTestArgMin': ('kolmogorovSmirnovTest', 'ArgMin'), 'quantilesArgMin': ('quantiles', 'ArgMin'), 'medianArgMin': ('median', 'ArgMin'), 'welchTTestArgMin': ('welchTTest', 'ArgMin'), 'anyHeavyArgMin': ('anyHeavy', 'ArgMin'), 'quantileTDigestWeightedArgMin': ('quantileTDigestWeighted', 'ArgMin'), 'groupUniqArrayArgMin': ('groupUniqArray', 'ArgMin'), 'sumCountArgMin': ('sumCount', 'ArgMin'), 'skewPopArgMin': ('skewPop', 'ArgMin'), 'covarSampArgMin': ('covarSamp', 'ArgMin'), 'maxArgMin': ('max', 'ArgMin'), 'quantileInterpolatedWeightedArgMin': ('quantileInterpolatedWeighted', 'ArgMin'), 'minArgMin': ('min', 'ArgMin'), 'groupBitmapOrArgMin': ('groupBitmapOr', 'ArgMin'), 'uniqThetaArgMin': ('uniqTheta', 'ArgMin'), 'covarPopArgMin': ('covarPop', 'ArgMin'), 'boundingRatioArgMin': ('boundingRatio', 'ArgMin'), 'groupBitAndArgMin': ('groupBitAnd', 'ArgMin'), 'cramersVBiasCorrectedArgMin': ('cramersVBiasCorrected', 'ArgMin'), 'maxIntersectionsArgMin': ('maxIntersections', 'ArgMin'), 'meanZTestArgMin': ('meanZTest', 'ArgMin'), 'varSampArgMin': ('varSamp', 'ArgMin'), 'quantileArgMin': ('quantile', 'ArgMin'), 'stddevPopArgMin': ('stddevPop', 'ArgMin'), 'mannWhitneyUTestArgMin': ('mannWhitneyUTest', 'ArgMin'), 'kurtSampArgMin': ('kurtSamp', 'ArgMin'), 'cramersVArgMin': ('cramersV', 'ArgMin'), 'simpleLinearRegressionArgMin': ('simpleLinearRegression', 'ArgMin'), 'maxMapArgMin': ('maxMap', 'ArgMin'), 'topKArgMin': ('topK', 'ArgMin'), 'quantileTDigestArgMin': ('quantileTDigest', 'ArgMin'), 'deltaSumTimestampArgMin': ('deltaSumTimestamp', 'ArgMin'), 'quantilesBFloat16WeightedArgMin': ('quantilesBFloat16Weighted', 'ArgMin'), 'argMinArgMin': ('argMin', 'ArgMin'), 'uniqArgMin': ('uniq', 'ArgMin'), 'theilsUArgMin': ('theilsU', 'ArgMin'), 'groupBitmapXorArgMin': ('groupBitmapXor', 'ArgMin'), 'quantilesTDigestArgMin': ('quantilesTDigest', 'ArgMin'), 'uniqHLL12ArgMin': ('uniqHLL12', 'ArgMin'), 'sumWithOverflowArgMin': ('sumWithOverflow', 'ArgMin'), 'stddevSampArgMin': ('stddevSamp', 'ArgMin'), 'quantilesBFloat16ArgMin': ('quantilesBFloat16', 'ArgMin'), 'sparkBarArgMin': ('sparkBar', 'ArgMin'), 'quantileExactWeightedArgMin': ('quantileExactWeighted', 'ArgMin'), 'quantilesGKArgMin': ('quantilesGK', 'ArgMin'), 'groupArrayMovingAvgArgMin': ('groupArrayMovingAvg', 'ArgMin'), 'largestTriangleThreeBucketsArgMin': ('largestTriangleThreeBuckets', 'ArgMin'), 'uniqCombined64ArgMin': ('uniqCombined64', 'ArgMin'), 'exponentialMovingAverageArgMin': ('exponentialMovingAverage', 'ArgMin'), 'stochasticLinearRegressionArgMin': ('stochasticLinearRegression', 'ArgMin'), 'groupArrayLastArgMin': ('groupArrayLast', 'ArgMin'), 'sumMapArgMin': ('sumMap', 'ArgMin'), 'rankCorrArgMin': ('rankCorr', 'ArgMin'), 'contingencyArgMin': ('contingency', 'ArgMin'), 'groupArrayArgMin': ('groupArray', 'ArgMin'), 'quantilesInterpolatedWeightedArgMin': ('quantilesInterpolatedWeighted', 'ArgMin'), 'avgWeightedArgMin': ('avgWeighted', 'ArgMin'), 'quantilesTimingWeightedArgMin': ('quantilesTimingWeighted', 'ArgMin'), 'quantilesExactWeightedArgMin': ('quantilesExactWeighted', 'ArgMin'), 'groupBitmapArgMin': ('groupBitmap', 'ArgMin'), 'categoricalInformationValueArgMin': ('categoricalInformationValue', 'ArgMin'), 'quantileDeterministicArgMin': ('quantileDeterministic', 'ArgMin'), 'quantileBFloat16ArgMin': ('quantileBFloat16', 'ArgMin'), 'uniqExactArgMin': ('uniqExact', 'ArgMin'), 'countArgMin': ('count', 'ArgMin'), 'anyArgMin': ('any', 'ArgMin'), 'quantilesExactArgMin': ('quantilesExact', 'ArgMin'), 'minMapArgMin': ('minMap', 'ArgMin'), 'groupBitXorArgMin': ('groupBitXor', 'ArgMin'), 'quantileExactLowArgMin': ('quantileExactLow', 'ArgMin'), 'sumArgMin': ('sum', 'ArgMin'), 'argMaxArgMin': ('argMax', 'ArgMin'), 'skewSampArgMin': ('skewSamp', 'ArgMin'), 'first_valueArgMin': ('first_value', 'ArgMin'), 'avgArgMin': ('avg', 'ArgMin'), 'entropyArgMin': ('entropy', 'ArgMin'), 'uniqCombinedArgMin': ('uniqCombined', 'ArgMin'), 'groupBitOrArgMin': ('groupBitOr', 'ArgMin'), 'quantileTimingArgMax': ('quantileTiming', 'ArgMax'), 'groupBitmapAndArgMax': ('groupBitmapAnd', 'ArgMax'), 'quantilesDeterministicArgMax': ('quantilesDeterministic', 'ArgMax'), 'groupArrayInsertAtArgMax': ('groupArrayInsertAt', 'ArgMax'), 'quantileExactHighArgMax': ('quantileExactHigh', 'ArgMax'), 'topKWeightedArgMax': ('topKWeighted', 'ArgMax'), 'intervalLengthSumArgMax': ('intervalLengthSum', 'ArgMax'), 'anyLastArgMax': ('anyLast', 'ArgMax'), 'maxIntersectionsPositionArgMax': ('maxIntersectionsPosition', 'ArgMax'), 'varPopArgMax': ('varPop', 'ArgMax'), 'last_valueArgMax': ('last_value', 'ArgMax'), 'quantilesTimingArgMax': ('quantilesTiming', 'ArgMax'), 'quantileGKArgMax': ('quantileGK', 'ArgMax'), 'studentTTestArgMax': ('studentTTest', 'ArgMax'), 'quantileBFloat16WeightedArgMax': ('quantileBFloat16Weighted', 'ArgMax'), 'deltaSumArgMax': ('deltaSum', 'ArgMax'), 'quantilesExactLowArgMax': ('quantilesExactLow', 'ArgMax'), 'kurtPopArgMax': ('kurtPop', 'ArgMax'), 'corrArgMax': ('corr', 'ArgMax'), 'groupArraySampleArgMax': ('groupArraySample', 'ArgMax'), 'quantileTimingWeightedArgMax': ('quantileTimingWeighted', 'ArgMax'), 'quantileExactArgMax': ('quantileExact', 'ArgMax'), 'quantilesTDigestWeightedArgMax': ('quantilesTDigestWeighted', 'ArgMax'), 'groupArrayMovingSumArgMax': ('groupArrayMovingSum', 'ArgMax'), 'quantilesExactHighArgMax': ('quantilesExactHigh', 'ArgMax'), 'sumKahanArgMax': ('sumKahan', 'ArgMax'), 'stochasticLogisticRegressionArgMax': ('stochasticLogisticRegression', 'ArgMax'), 'kolmogorovSmirnovTestArgMax': ('kolmogorovSmirnovTest', 'ArgMax'), 'quantilesArgMax': ('quantiles', 'ArgMax'), 'medianArgMax': ('median', 'ArgMax'), 'welchTTestArgMax': ('welchTTest', 'ArgMax'), 'anyHeavyArgMax': ('anyHeavy', 'ArgMax'), 'quantileTDigestWeightedArgMax': ('quantileTDigestWeighted', 'ArgMax'), 'groupUniqArrayArgMax': ('groupUniqArray', 'ArgMax'), 'sumCountArgMax': ('sumCount', 'ArgMax'), 'skewPopArgMax': ('skewPop', 'ArgMax'), 'covarSampArgMax': ('covarSamp', 'ArgMax'), 'maxArgMax': ('max', 'ArgMax'), 'quantileInterpolatedWeightedArgMax': ('quantileInterpolatedWeighted', 'ArgMax'), 'minArgMax': ('min', 'ArgMax'), 'groupBitmapOrArgMax': ('groupBitmapOr', 'ArgMax'), 'uniqThetaArgMax': ('uniqTheta', 'ArgMax'), 'covarPopArgMax': ('covarPop', 'ArgMax'), 'boundingRatioArgMax': ('boundingRatio', 'ArgMax'), 'groupBitAndArgMax': ('groupBitAnd', 'ArgMax'), 'cramersVBiasCorrectedArgMax': ('cramersVBiasCorrected', 'ArgMax'), 'maxIntersectionsArgMax': ('maxIntersections', 'ArgMax'), 'meanZTestArgMax': ('meanZTest', 'ArgMax'), 'varSampArgMax': ('varSamp', 'ArgMax'), 'quantileArgMax': ('quantile', 'ArgMax'), 'stddevPopArgMax': ('stddevPop', 'ArgMax'), 'mannWhitneyUTestArgMax': ('mannWhitneyUTest', 'ArgMax'), 'kurtSampArgMax': ('kurtSamp', 'ArgMax'), 'cramersVArgMax': ('cramersV', 'ArgMax'), 'simpleLinearRegressionArgMax': ('simpleLinearRegression', 'ArgMax'), 'maxMapArgMax': ('maxMap', 'ArgMax'), 'topKArgMax': ('topK', 'ArgMax'), 'quantileTDigestArgMax': ('quantileTDigest', 'ArgMax'), 'deltaSumTimestampArgMax': ('deltaSumTimestamp', 'ArgMax'), 'quantilesBFloat16WeightedArgMax': ('quantilesBFloat16Weighted', 'ArgMax'), 'argMinArgMax': ('argMin', 'ArgMax'), 'uniqArgMax': ('uniq', 'ArgMax'), 'theilsUArgMax': ('theilsU', 'ArgMax'), 'groupBitmapXorArgMax': ('groupBitmapXor', 'ArgMax'), 'quantilesTDigestArgMax': ('quantilesTDigest', 'ArgMax'), 'uniqHLL12ArgMax': ('uniqHLL12', 'ArgMax'), 'sumWithOverflowArgMax': ('sumWithOverflow', 'ArgMax'), 'stddevSampArgMax': ('stddevSamp', 'ArgMax'), 'quantilesBFloat16ArgMax': ('quantilesBFloat16', 'ArgMax'), 'sparkBarArgMax': ('sparkBar', 'ArgMax'), 'quantileExactWeightedArgMax': ('quantileExactWeighted', 'ArgMax'), 'quantilesGKArgMax': ('quantilesGK', 'ArgMax'), 'groupArrayMovingAvgArgMax': ('groupArrayMovingAvg', 'ArgMax'), 'largestTriangleThreeBucketsArgMax': ('largestTriangleThreeBuckets', 'ArgMax'), 'uniqCombined64ArgMax': ('uniqCombined64', 'ArgMax'), 'exponentialMovingAverageArgMax': ('exponentialMovingAverage', 'ArgMax'), 'stochasticLinearRegressionArgMax': ('stochasticLinearRegression', 'ArgMax'), 'groupArrayLastArgMax': ('groupArrayLast', 'ArgMax'), 'sumMapArgMax': ('sumMap', 'ArgMax'), 'rankCorrArgMax': ('rankCorr', 'ArgMax'), 'contingencyArgMax': ('contingency', 'ArgMax'), 'groupArrayArgMax': ('groupArray', 'ArgMax'), 'quantilesInterpolatedWeightedArgMax': ('quantilesInterpolatedWeighted', 'ArgMax'), 'avgWeightedArgMax': ('avgWeighted', 'ArgMax'), 'quantilesTimingWeightedArgMax': ('quantilesTimingWeighted', 'ArgMax'), 'quantilesExactWeightedArgMax': ('quantilesExactWeighted', 'ArgMax'), 'groupBitmapArgMax': ('groupBitmap', 'ArgMax'), 'categoricalInformationValueArgMax': ('categoricalInformationValue', 'ArgMax'), 'quantileDeterministicArgMax': ('quantileDeterministic', 'ArgMax'), 'quantileBFloat16ArgMax': ('quantileBFloat16', 'ArgMax'), 'uniqExactArgMax': ('uniqExact', 'ArgMax'), 'countArgMax': ('count', 'ArgMax'), 'anyArgMax': ('any', 'ArgMax'), 'quantilesExactArgMax': ('quantilesExact', 'ArgMax'), 'minMapArgMax': ('minMap', 'ArgMax'), 'groupBitXorArgMax': ('groupBitXor', 'ArgMax'), 'quantileExactLowArgMax': ('quantileExactLow', 'ArgMax'), 'sumArgMax': ('sum', 'ArgMax'), 'argMaxArgMax': ('argMax', 'ArgMax'), 'skewSampArgMax': ('skewSamp', 'ArgMax'), 'first_valueArgMax': ('first_value', 'ArgMax'), 'avgArgMax': ('avg', 'ArgMax'), 'entropyArgMax': ('entropy', 'ArgMax'), 'uniqCombinedArgMax': ('uniqCombined', 'ArgMax'), 'groupBitOrArgMax': ('groupBitOr', 'ArgMax'), 'quantileTiming': ('quantileTiming', ''), 'groupBitmapAnd': ('groupBitmapAnd', ''), 'quantilesDeterministic': ('quantilesDeterministic', ''), 'groupArrayInsertAt': ('groupArrayInsertAt', ''), 'quantileExactHigh': ('quantileExactHigh', ''), 'topKWeighted': ('topKWeighted', ''), 'intervalLengthSum': ('intervalLengthSum', ''), 'anyLast': ('anyLast', ''), 'maxIntersectionsPosition': ('maxIntersectionsPosition', ''), 'varPop': ('varPop', ''), 'last_value': ('last_value', ''), 'quantilesTiming': ('quantilesTiming', ''), 'quantileGK': ('quantileGK', ''), 'studentTTest': ('studentTTest', ''), 'quantileBFloat16Weighted': ('quantileBFloat16Weighted', ''), 'deltaSum': ('deltaSum', ''), 'quantilesExactLow': ('quantilesExactLow', ''), 'kurtPop': ('kurtPop', ''), 'corr': ('corr', ''), 'groupArraySample': ('groupArraySample', ''), 'quantileTimingWeighted': ('quantileTimingWeighted', ''), 'quantileExact': ('quantileExact', ''), 'quantilesTDigestWeighted': ('quantilesTDigestWeighted', ''), 'groupArrayMovingSum': ('groupArrayMovingSum', ''), 'quantilesExactHigh': ('quantilesExactHigh', ''), 'sumKahan': ('sumKahan', ''), 'stochasticLogisticRegression': ('stochasticLogisticRegression', ''), 'kolmogorovSmirnovTest': ('kolmogorovSmirnovTest', ''), 'quantiles': ('quantiles', ''), 'median': ('median', ''), 'welchTTest': ('welchTTest', ''), 'anyHeavy': ('anyHeavy', ''), 'quantileTDigestWeighted': ('quantileTDigestWeighted', ''), 'groupUniqArray': ('groupUniqArray', ''), 'sumCount': ('sumCount', ''), 'skewPop': ('skewPop', ''), 'covarSamp': ('covarSamp', ''), 'max': ('max', ''), 'quantileInterpolatedWeighted': ('quantileInterpolatedWeighted', ''), 'min': ('min', ''), 'groupBitmapOr': ('groupBitmapOr', ''), 'uniqTheta': ('uniqTheta', ''), 'covarPop': ('covarPop', ''), 'boundingRatio': ('boundingRatio', ''), 'groupBitAnd': ('groupBitAnd', ''), 'cramersVBiasCorrected': ('cramersVBiasCorrected', ''), 'maxIntersections': ('maxIntersections', ''), 'meanZTest': ('meanZTest', ''), 'varSamp': ('varSamp', ''), 'quantile': ('quantile', ''), 'stddevPop': ('stddevPop', ''), 'mannWhitneyUTest': ('mannWhitneyUTest', ''), 'kurtSamp': ('kurtSamp', ''), 'cramersV': ('cramersV', ''), 'simpleLinearRegression': ('simpleLinearRegression', ''), 'topK': ('topK', ''), 'quantileTDigest': ('quantileTDigest', ''), 'deltaSumTimestamp': ('deltaSumTimestamp', ''), 'quantilesBFloat16Weighted': ('quantilesBFloat16Weighted', ''), 'argMin': ('argMin', ''), 'uniq': ('uniq', ''), 'theilsU': ('theilsU', ''), 'groupBitmapXor': ('groupBitmapXor', ''), 'quantilesTDigest': ('quantilesTDigest', ''), 'uniqHLL12': ('uniqHLL12', ''), 'sumWithOverflow': ('sumWithOverflow', ''), 'stddevSamp': ('stddevSamp', ''), 'quantilesBFloat16': ('quantilesBFloat16', ''), 'sparkBar': ('sparkBar', ''), 'quantileExactWeighted': ('quantileExactWeighted', ''), 'quantilesGK': ('quantilesGK', ''), 'groupArrayMovingAvg': ('groupArrayMovingAvg', ''), 'largestTriangleThreeBuckets': ('largestTriangleThreeBuckets', ''), 'uniqCombined64': ('uniqCombined64', ''), 'exponentialMovingAverage': ('exponentialMovingAverage', ''), 'stochasticLinearRegression': ('stochasticLinearRegression', ''), 'groupArrayLast': ('groupArrayLast', ''), 'rankCorr': ('rankCorr', ''), 'contingency': ('contingency', ''), 'groupArray': ('groupArray', ''), 'quantilesInterpolatedWeighted': ('quantilesInterpolatedWeighted', ''), 'avgWeighted': ('avgWeighted', ''), 'quantilesTimingWeighted': ('quantilesTimingWeighted', ''), 'quantilesExactWeighted': ('quantilesExactWeighted', ''), 'groupBitmap': ('groupBitmap', ''), 'categoricalInformationValue': ('categoricalInformationValue', ''), 'quantileDeterministic': ('quantileDeterministic', ''), 'quantileBFloat16': ('quantileBFloat16', ''), 'uniqExact': ('uniqExact', ''), 'count': ('count', ''), 'any': ('any', ''), 'quantilesExact': ('quantilesExact', ''), 'groupBitXor': ('groupBitXor', ''), 'quantileExactLow': ('quantileExactLow', ''), 'sum': ('sum', ''), 'argMax': ('argMax', ''), 'skewSamp': ('skewSamp', ''), 'first_value': ('first_value', ''), 'avg': ('avg', ''), 'entropy': ('entropy', ''), 'uniqCombined': ('uniqCombined', ''), 'groupBitOr': ('groupBitOr', '')}
FUNCTIONS_WITH_ALIASED_ARGS = {'STRUCT', 'TUPLE'}
FUNCTION_PARSERS = {'CAST': <function Parser.<lambda>>, 'CONVERT': <function Parser.<lambda>>, 'DECODE': <function Parser.<lambda>>, 'EXTRACT': <function Parser.<lambda>>, 'JSON_OBJECT': <function Parser.<lambda>>, 'JSON_OBJECTAGG': <function Parser.<lambda>>, 'JSON_TABLE': <function Parser.<lambda>>, 'OPENJSON': <function Parser.<lambda>>, 'POSITION': <function Parser.<lambda>>, 'PREDICT': <function Parser.<lambda>>, 'SAFE_CAST': <function Parser.<lambda>>, 'STRING_AGG': <function Parser.<lambda>>, 'SUBSTRING': <function Parser.<lambda>>, 'TRIM': <function Parser.<lambda>>, 'TRY_CAST': <function Parser.<lambda>>, 'TRY_CONVERT': <function Parser.<lambda>>, 'ARRAYJOIN': <function ClickHouse.Parser.<lambda>>, 'QUANTILE': <function ClickHouse.Parser.<lambda>>}
NO_PAREN_FUNCTION_PARSERS = {'CASE': <function Parser.<lambda>>, 'IF': <function Parser.<lambda>>, 'NEXT': <function Parser.<lambda>>}
RANGE_PARSERS = {<TokenType.BETWEEN: 'BETWEEN'>: <function Parser.<lambda>>, <TokenType.GLOB: 'GLOB'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.ILIKE: 'ILIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.IN: 'IN'>: <function Parser.<lambda>>, <TokenType.IRLIKE: 'IRLIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.IS: 'IS'>: <function Parser.<lambda>>, <TokenType.LIKE: 'LIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.OVERLAPS: 'OVERLAPS'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.RLIKE: 'RLIKE'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.SIMILAR_TO: 'SIMILAR_TO'>: <function binary_range_parser.<locals>.<lambda>>, <TokenType.FOR: 'FOR'>: <function Parser.<lambda>>, <TokenType.GLOBAL: 'GLOBAL'>: <function ClickHouse.Parser.<lambda>>}
COLUMN_OPERATORS = {<TokenType.DOT: 'DOT'>: None, <TokenType.DCOLON: 'DCOLON'>: <function Parser.<lambda>>, <TokenType.ARROW: 'ARROW'>: <function Parser.<lambda>>, <TokenType.DARROW: 'DARROW'>: <function Parser.<lambda>>, <TokenType.HASH_ARROW: 'HASH_ARROW'>: <function Parser.<lambda>>, <TokenType.DHASH_ARROW: 'DHASH_ARROW'>: <function Parser.<lambda>>}
JOIN_KINDS = {<TokenType.OUTER: 'OUTER'>, <TokenType.ANY: 'ANY'>, <TokenType.ASOF: 'ASOF'>, <TokenType.ARRAY: 'ARRAY'>, <TokenType.ANTI: 'ANTI'>, <TokenType.CROSS: 'CROSS'>, <TokenType.SEMI: 'SEMI'>, <TokenType.INNER: 'INNER'>}
TABLE_ALIAS_TOKENS = {<TokenType.FIXEDSTRING: 'FIXEDSTRING'>, <TokenType.TIMESTAMP: 'TIMESTAMP'>, <TokenType.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>, <TokenType.ISNULL: 'ISNULL'>, <TokenType.RECURSIVE: 'RECURSIVE'>, <TokenType.IPV6: 'IPV6'>, <TokenType.TOP: 'TOP'>, <TokenType.EXECUTE: 'EXECUTE'>, <TokenType.VIEW: 'VIEW'>, <TokenType.NUMRANGE: 'NUMRANGE'>, <TokenType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <TokenType.OBJECT_IDENTIFIER: 'OBJECT_IDENTIFIER'>, <TokenType.INT8MULTIRANGE: 'INT8MULTIRANGE'>, <TokenType.FILTER: 'FILTER'>, <TokenType.SOME: 'SOME'>, <TokenType.NVARCHAR: 'NVARCHAR'>, <TokenType.ROW: 'ROW'>, <TokenType.TIMETZ: 'TIMETZ'>, <TokenType.OVERWRITE: 'OVERWRITE'>, <TokenType.BINARY: 'BINARY'>, <TokenType.TEMPORARY: 'TEMPORARY'>, <TokenType.BIT: 'BIT'>, <TokenType.USMALLINT: 'USMALLINT'>, <TokenType.TABLE: 'TABLE'>, <TokenType.INDEX: 'INDEX'>, <TokenType.KILL: 'KILL'>, <TokenType.CURRENT_DATE: 'CURRENT_DATE'>, <TokenType.EXISTS: 'EXISTS'>, <TokenType.SET: 'SET'>, <TokenType.CASE: 'CASE'>, <TokenType.STRUCT: 'STRUCT'>, <TokenType.SHOW: 'SHOW'>, <TokenType.JSON: 'JSON'>, <TokenType.SEQUENCE: 'SEQUENCE'>, <TokenType.VARIANT: 'VARIANT'>, <TokenType.UNIQUE: 'UNIQUE'>, <TokenType.REPLACE: 'REPLACE'>, <TokenType.ENUM: 'ENUM'>, <TokenType.USERDEFINED: 'USERDEFINED'>, <TokenType.NESTED: 'NESTED'>, <TokenType.COLUMN: 'COLUMN'>, <TokenType.DATE32: 'DATE32'>, <TokenType.CHAR: 'CHAR'>, <TokenType.FOREIGN_KEY: 'FOREIGN_KEY'>, <TokenType.INT: 'INT'>, <TokenType.SERIAL: 'SERIAL'>, <TokenType.CURRENT_TIME: 'CURRENT_TIME'>, <TokenType.DIV: 'DIV'>, <TokenType.IMAGE: 'IMAGE'>, <TokenType.REFRESH: 'REFRESH'>, <TokenType.MERGE: 'MERGE'>, <TokenType.BEGIN: 'BEGIN'>, <TokenType.OPERATOR: 'OPERATOR'>, <TokenType.GEOMETRY: 'GEOMETRY'>, <TokenType.MEDIUMTEXT: 'MEDIUMTEXT'>, <TokenType.TRUNCATE: 'TRUNCATE'>, <TokenType.BIGSERIAL: 'BIGSERIAL'>, <TokenType.TINYINT: 'TINYINT'>, <TokenType.ASC: 'ASC'>, <TokenType.INT128: 'INT128'>, <TokenType.TEXT: 'TEXT'>, <TokenType.MEDIUMBLOB: 'MEDIUMBLOB'>, <TokenType.UUID: 'UUID'>, <TokenType.UNKNOWN: 'UNKNOWN'>, <TokenType.PIVOT: 'PIVOT'>, <TokenType.TSTZRANGE: 'TSTZRANGE'>, <TokenType.MEDIUMINT: 'MEDIUMINT'>, <TokenType.VOLATILE: 'VOLATILE'>, <TokenType.YEAR: 'YEAR'>, <TokenType.ROWVERSION: 'ROWVERSION'>, <TokenType.DELETE: 'DELETE'>, <TokenType.DESCRIBE: 'DESCRIBE'>, <TokenType.AUTO_INCREMENT: 'AUTO_INCREMENT'>, <TokenType.DATE: 'DATE'>, <TokenType.PERCENT: 'PERCENT'>, <TokenType.DATETIME: 'DATETIME'>, <TokenType.DATABASE: 'DATABASE'>, <TokenType.MAP: 'MAP'>, <TokenType.FLOAT: 'FLOAT'>, <TokenType.INT4RANGE: 'INT4RANGE'>, <TokenType.FUNCTION: 'FUNCTION'>, <TokenType.LOAD: 'LOAD'>, <TokenType.FIRST: 'FIRST'>, <TokenType.TSMULTIRANGE: 'TSMULTIRANGE'>, <TokenType.DATETIME64: 'DATETIME64'>, <TokenType.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <TokenType.UINT: 'UINT'>, <TokenType.CURRENT_TIMESTAMP: 'CURRENT_TIMESTAMP'>, <TokenType.VARCHAR: 'VARCHAR'>, <TokenType.CURRENT_DATETIME: 'CURRENT_DATETIME'>, <TokenType.COMMENT: 'COMMENT'>, <TokenType.UNPIVOT: 'UNPIVOT'>, <TokenType.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <TokenType.USE: 'USE'>, <TokenType.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>, <TokenType.UDECIMAL: 'UDECIMAL'>, <TokenType.IPADDRESS: 'IPADDRESS'>, <TokenType.VAR: 'VAR'>, <TokenType.INT8RANGE: 'INT8RANGE'>, <TokenType.ENUM16: 'ENUM16'>, <TokenType.OVERLAPS: 'OVERLAPS'>, <TokenType.ORDINALITY: 'ORDINALITY'>, <TokenType.SUPER: 'SUPER'>, <TokenType.DECIMAL: 'DECIMAL'>, <TokenType.UINT256: 'UINT256'>, <TokenType.XML: 'XML'>, <TokenType.HLLSKETCH: 'HLLSKETCH'>, <TokenType.KEEP: 'KEEP'>, <TokenType.CONSTRAINT: 'CONSTRAINT'>, <TokenType.DATERANGE: 'DATERANGE'>, <TokenType.SMALLSERIAL: 'SMALLSERIAL'>, <TokenType.BOOLEAN: 'BOOLEAN'>, <TokenType.TIMESTAMP_S: 'TIMESTAMP_S'>, <TokenType.IPPREFIX: 'IPPREFIX'>, <TokenType.STORAGE_INTEGRATION: 'STORAGE_INTEGRATION'>, <TokenType.NULLABLE: 'NULLABLE'>, <TokenType.LOWCARDINALITY: 'LOWCARDINALITY'>, <TokenType.INT4MULTIRANGE: 'INT4MULTIRANGE'>, <TokenType.DEFAULT: 'DEFAULT'>, <TokenType.CACHE: 'CACHE'>, <TokenType.TSRANGE: 'TSRANGE'>, <TokenType.OBJECT: 'OBJECT'>, <TokenType.TINYBLOB: 'TINYBLOB'>, <TokenType.PSEUDO_TYPE: 'PSEUDO_TYPE'>, <TokenType.DICTIONARY: 'DICTIONARY'>, <TokenType.COMMIT: 'COMMIT'>, <TokenType.MONEY: 'MONEY'>, <TokenType.FALSE: 'FALSE'>, <TokenType.IS: 'IS'>, <TokenType.ESCAPE: 'ESCAPE'>, <TokenType.INTERVAL: 'INTERVAL'>, <TokenType.TINYTEXT: 'TINYTEXT'>, <TokenType.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'>, <TokenType.SMALLMONEY: 'SMALLMONEY'>, <TokenType.ROWS: 'ROWS'>, <TokenType.BIGDECIMAL: 'BIGDECIMAL'>, <TokenType.REFERENCES: 'REFERENCES'>, <TokenType.DATEMULTIRANGE: 'DATEMULTIRANGE'>, <TokenType.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <TokenType.DESC: 'DESC'>, <TokenType.PARTITION: 'PARTITION'>, <TokenType.BPCHAR: 'BPCHAR'>, <TokenType.UMEDIUMINT: 'UMEDIUMINT'>, <TokenType.BIGINT: 'BIGINT'>, <TokenType.GEOGRAPHY: 'GEOGRAPHY'>, <TokenType.NUMMULTIRANGE: 'NUMMULTIRANGE'>, <TokenType.IPV4: 'IPV4'>, <TokenType.ALL: 'ALL'>, <TokenType.DOUBLE: 'DOUBLE'>, <TokenType.PROCEDURE: 'PROCEDURE'>, <TokenType.NULL: 'NULL'>, <TokenType.UPDATE: 'UPDATE'>, <TokenType.ENUM8: 'ENUM8'>, <TokenType.UTINYINT: 'UTINYINT'>, <TokenType.HSTORE: 'HSTORE'>, <TokenType.PRAGMA: 'PRAGMA'>, <TokenType.SMALLINT: 'SMALLINT'>, <TokenType.COLLATE: 'COLLATE'>, <TokenType.MODEL: 'MODEL'>, <TokenType.LONGBLOB: 'LONGBLOB'>, <TokenType.COMMAND: 'COMMAND'>, <TokenType.END: 'END'>, <TokenType.RANGE: 'RANGE'>, <TokenType.NCHAR: 'NCHAR'>, <TokenType.INT256: 'INT256'>, <TokenType.CURRENT_USER: 'CURRENT_USER'>, <TokenType.UBIGINT: 'UBIGINT'>, <TokenType.TRUE: 'TRUE'>, <TokenType.INET: 'INET'>, <TokenType.NEXT: 'NEXT'>, <TokenType.LONGTEXT: 'LONGTEXT'>, <TokenType.NAME: 'NAME'>, <TokenType.SCHEMA: 'SCHEMA'>, <TokenType.TIME: 'TIME'>, <TokenType.UINT128: 'UINT128'>, <TokenType.VARBINARY: 'VARBINARY'>, <TokenType.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>, <TokenType.JSONB: 'JSONB'>}
LOG_DEFAULTS_TO_LN = True
QUERY_MODIFIER_PARSERS = {<TokenType.MATCH_RECOGNIZE: 'MATCH_RECOGNIZE'>: <function Parser.<lambda>>, <TokenType.PREWHERE: 'PREWHERE'>: <function Parser.<lambda>>, <TokenType.WHERE: 'WHERE'>: <function Parser.<lambda>>, <TokenType.GROUP_BY: 'GROUP_BY'>: <function Parser.<lambda>>, <TokenType.HAVING: 'HAVING'>: <function Parser.<lambda>>, <TokenType.QUALIFY: 'QUALIFY'>: <function Parser.<lambda>>, <TokenType.WINDOW: 'WINDOW'>: <function Parser.<lambda>>, <TokenType.ORDER_BY: 'ORDER_BY'>: <function Parser.<lambda>>, <TokenType.LIMIT: 'LIMIT'>: <function Parser.<lambda>>, <TokenType.FETCH: 'FETCH'>: <function Parser.<lambda>>, <TokenType.OFFSET: 'OFFSET'>: <function Parser.<lambda>>, <TokenType.FOR: 'FOR'>: <function Parser.<lambda>>, <TokenType.LOCK: 'LOCK'>: <function Parser.<lambda>>, <TokenType.TABLE_SAMPLE: 'TABLE_SAMPLE'>: <function Parser.<lambda>>, <TokenType.USING: 'USING'>: <function Parser.<lambda>>, <TokenType.CLUSTER_BY: 'CLUSTER_BY'>: <function Parser.<lambda>>, <TokenType.DISTRIBUTE_BY: 'DISTRIBUTE_BY'>: <function Parser.<lambda>>, <TokenType.SORT_BY: 'SORT_BY'>: <function Parser.<lambda>>, <TokenType.CONNECT_BY: 'CONNECT_BY'>: <function Parser.<lambda>>, <TokenType.START_WITH: 'START_WITH'>: <function Parser.<lambda>>, <TokenType.SETTINGS: 'SETTINGS'>: <function ClickHouse.Parser.<lambda>>, <TokenType.FORMAT: 'FORMAT'>: <function ClickHouse.Parser.<lambda>>}
SHOW_TRIE: Dict = {}
SET_TRIE: Dict = {'GLOBAL': {0: True}, 'LOCAL': {0: True}, 'SESSION': {0: True}, 'TRANSACTION': {0: True}}
Inherited Members
sqlglot.parser.Parser
Parser
NO_PAREN_FUNCTIONS
STRUCT_TYPE_TOKENS
NESTED_TYPE_TOKENS
ENUM_TYPE_TOKENS
AGGREGATE_TYPE_TOKENS
TYPE_TOKENS
SIGNED_TO_UNSIGNED_TYPE_TOKEN
SUBQUERY_PREDICATES
RESERVED_TOKENS
DB_CREATABLES
CREATABLES
ID_VAR_TOKENS
INTERVAL_VARS
COMMENT_TABLE_ALIAS_TOKENS
UPDATE_ALIAS_TOKENS
TRIM_TYPES
FUNC_TOKENS
CONJUNCTION
EQUALITY
COMPARISON
BITWISE
TERM
FACTOR
EXPONENT
TIMES
TIMESTAMPS
SET_OPERATIONS
JOIN_METHODS
JOIN_SIDES
JOIN_HINTS
LAMBDAS
EXPRESSION_PARSERS
STATEMENT_PARSERS
UNARY_PARSERS
STRING_PARSERS
NUMERIC_PARSERS
PRIMARY_PARSERS
PLACEHOLDER_PARSERS
PROPERTY_PARSERS
CONSTRAINT_PARSERS
ALTER_PARSERS
SCHEMA_UNNAMED_CONSTRAINTS
INVALID_FUNC_NAME_TOKENS
KEY_VALUE_DEFINITIONS
SET_PARSERS
SHOW_PARSERS
TYPE_LITERAL_PARSERS
DDL_SELECT_TOKENS
PRE_VOLATILE_TOKENS
TRANSACTION_KIND
TRANSACTION_CHARACTERISTICS
CONFLICT_ACTIONS
CREATE_SEQUENCE
USABLES
CAST_ACTIONS
INSERT_ALTERNATIVES
CLONE_KEYWORDS
HISTORICAL_DATA_KIND
OPCLASS_FOLLOW_KEYWORDS
OPTYPE_FOLLOW_TOKENS
TABLE_INDEX_HINT_TOKENS
WINDOW_ALIAS_TOKENS
WINDOW_BEFORE_PAREN_TOKENS
WINDOW_SIDES
JSON_KEY_VALUE_SEPARATOR_TOKENS
FETCH_TOKENS
ADD_CONSTRAINT_TOKENS
DISTINCT_TOKENS
NULL_TOKENS
UNNEST_OFFSET_ALIAS_TOKENS
STRICT_CAST
PREFIXED_PIVOT_COLUMNS
IDENTIFY_PIVOT_STRINGS
ALTER_TABLE_ADD_REQUIRED_FOR_EACH_COLUMN
TABLESAMPLE_CSV
SET_REQUIRES_ASSIGNMENT_DELIMITER
TRIM_PATTERN_FIRST
STRING_ALIASES
UNION_MODIFIERS
NO_PAREN_IF_COMMANDS
JSON_ARROWS_REQUIRE_JSON_TYPE
VALUES_FOLLOWED_BY_PAREN
SUPPORTS_IMPLICIT_UNNEST
error_level
error_message_context
max_errors
dialect
reset
parse
parse_into
check_errors
raise_error
expression
validate_expression
errors
sql
class ClickHouse.Generator(sqlglot.generator.Generator):
513    class Generator(generator.Generator):
514        QUERY_HINTS = False
515        STRUCT_DELIMITER = ("(", ")")
516        NVL2_SUPPORTED = False
517        TABLESAMPLE_REQUIRES_PARENS = False
518        TABLESAMPLE_SIZE_IS_ROWS = False
519        TABLESAMPLE_KEYWORDS = "SAMPLE"
520        LAST_DAY_SUPPORTS_DATE_PART = False
521        CAN_IMPLEMENT_ARRAY_ANY = True
522        SUPPORTS_TO_NUMBER = False
523
524        STRING_TYPE_MAPPING = {
525            exp.DataType.Type.CHAR: "String",
526            exp.DataType.Type.LONGBLOB: "String",
527            exp.DataType.Type.LONGTEXT: "String",
528            exp.DataType.Type.MEDIUMBLOB: "String",
529            exp.DataType.Type.MEDIUMTEXT: "String",
530            exp.DataType.Type.TINYBLOB: "String",
531            exp.DataType.Type.TINYTEXT: "String",
532            exp.DataType.Type.TEXT: "String",
533            exp.DataType.Type.VARBINARY: "String",
534            exp.DataType.Type.VARCHAR: "String",
535        }
536
537        SUPPORTED_JSON_PATH_PARTS = {
538            exp.JSONPathKey,
539            exp.JSONPathRoot,
540            exp.JSONPathSubscript,
541        }
542
543        TYPE_MAPPING = {
544            **generator.Generator.TYPE_MAPPING,
545            **STRING_TYPE_MAPPING,
546            exp.DataType.Type.ARRAY: "Array",
547            exp.DataType.Type.BIGINT: "Int64",
548            exp.DataType.Type.DATE32: "Date32",
549            exp.DataType.Type.DATETIME64: "DateTime64",
550            exp.DataType.Type.DOUBLE: "Float64",
551            exp.DataType.Type.ENUM: "Enum",
552            exp.DataType.Type.ENUM8: "Enum8",
553            exp.DataType.Type.ENUM16: "Enum16",
554            exp.DataType.Type.FIXEDSTRING: "FixedString",
555            exp.DataType.Type.FLOAT: "Float32",
556            exp.DataType.Type.INT: "Int32",
557            exp.DataType.Type.MEDIUMINT: "Int32",
558            exp.DataType.Type.INT128: "Int128",
559            exp.DataType.Type.INT256: "Int256",
560            exp.DataType.Type.LOWCARDINALITY: "LowCardinality",
561            exp.DataType.Type.MAP: "Map",
562            exp.DataType.Type.NESTED: "Nested",
563            exp.DataType.Type.NULLABLE: "Nullable",
564            exp.DataType.Type.SMALLINT: "Int16",
565            exp.DataType.Type.STRUCT: "Tuple",
566            exp.DataType.Type.TINYINT: "Int8",
567            exp.DataType.Type.UBIGINT: "UInt64",
568            exp.DataType.Type.UINT: "UInt32",
569            exp.DataType.Type.UINT128: "UInt128",
570            exp.DataType.Type.UINT256: "UInt256",
571            exp.DataType.Type.USMALLINT: "UInt16",
572            exp.DataType.Type.UTINYINT: "UInt8",
573            exp.DataType.Type.IPV4: "IPv4",
574            exp.DataType.Type.IPV6: "IPv6",
575            exp.DataType.Type.AGGREGATEFUNCTION: "AggregateFunction",
576            exp.DataType.Type.SIMPLEAGGREGATEFUNCTION: "SimpleAggregateFunction",
577        }
578
579        TRANSFORMS = {
580            **generator.Generator.TRANSFORMS,
581            exp.AnyValue: rename_func("any"),
582            exp.ApproxDistinct: rename_func("uniq"),
583            exp.ArrayFilter: lambda self, e: self.func("arrayFilter", e.expression, e.this),
584            exp.ArraySize: rename_func("LENGTH"),
585            exp.ArraySum: rename_func("arraySum"),
586            exp.ArgMax: arg_max_or_min_no_count("argMax"),
587            exp.ArgMin: arg_max_or_min_no_count("argMin"),
588            exp.Array: inline_array_sql,
589            exp.CastToStrType: rename_func("CAST"),
590            exp.CountIf: rename_func("countIf"),
591            exp.CurrentDate: lambda self, e: self.func("CURRENT_DATE"),
592            exp.DateAdd: date_delta_sql("DATE_ADD"),
593            exp.DateDiff: date_delta_sql("DATE_DIFF"),
594            exp.Explode: rename_func("arrayJoin"),
595            exp.Final: lambda self, e: f"{self.sql(e, 'this')} FINAL",
596            exp.IsNan: rename_func("isNaN"),
597            exp.JSONExtract: json_extract_segments("JSONExtractString", quoted_index=False),
598            exp.JSONExtractScalar: json_extract_segments("JSONExtractString", quoted_index=False),
599            exp.JSONPathKey: json_path_key_only_name,
600            exp.JSONPathRoot: lambda *_: "",
601            exp.Map: lambda self, e: _lower_func(var_map_sql(self, e)),
602            exp.Nullif: rename_func("nullIf"),
603            exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
604            exp.Pivot: no_pivot_sql,
605            exp.Quantile: _quantile_sql,
606            exp.RegexpLike: lambda self, e: self.func("match", e.this, e.expression),
607            exp.Rand: rename_func("randCanonical"),
608            exp.Select: transforms.preprocess([transforms.eliminate_qualify]),
609            exp.StartsWith: rename_func("startsWith"),
610            exp.StrPosition: lambda self, e: self.func(
611                "position", e.this, e.args.get("substr"), e.args.get("position")
612            ),
613            exp.VarMap: lambda self, e: _lower_func(var_map_sql(self, e)),
614            exp.Xor: lambda self, e: self.func("xor", e.this, e.expression, *e.expressions),
615        }
616
617        PROPERTIES_LOCATION = {
618            **generator.Generator.PROPERTIES_LOCATION,
619            exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
620            exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
621            exp.OnCluster: exp.Properties.Location.POST_NAME,
622        }
623
624        JOIN_HINTS = False
625        TABLE_HINTS = False
626        EXPLICIT_UNION = True
627        GROUPINGS_SEP = ""
628
629        # there's no list in docs, but it can be found in Clickhouse code
630        # see `ClickHouse/src/Parsers/ParserCreate*.cpp`
631        ON_CLUSTER_TARGETS = {
632            "DATABASE",
633            "TABLE",
634            "VIEW",
635            "DICTIONARY",
636            "INDEX",
637            "FUNCTION",
638            "NAMED COLLECTION",
639        }
640
641        def _jsonpathsubscript_sql(self, expression: exp.JSONPathSubscript) -> str:
642            this = self.json_path_part(expression.this)
643            return str(int(this) + 1) if is_int(this) else this
644
645        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
646            return f"AS {self.sql(expression, 'this')}"
647
648        def _any_to_has(
649            self,
650            expression: exp.EQ | exp.NEQ,
651            default: t.Callable[[t.Any], str],
652            prefix: str = "",
653        ) -> str:
654            if isinstance(expression.left, exp.Any):
655                arr = expression.left
656                this = expression.right
657            elif isinstance(expression.right, exp.Any):
658                arr = expression.right
659                this = expression.left
660            else:
661                return default(expression)
662
663            return prefix + self.func("has", arr.this.unnest(), this)
664
665        def eq_sql(self, expression: exp.EQ) -> str:
666            return self._any_to_has(expression, super().eq_sql)
667
668        def neq_sql(self, expression: exp.NEQ) -> str:
669            return self._any_to_has(expression, super().neq_sql, "NOT ")
670
671        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
672            # Manually add a flag to make the search case-insensitive
673            regex = self.func("CONCAT", "'(?i)'", expression.expression)
674            return self.func("match", expression.this, regex)
675
676        def datatype_sql(self, expression: exp.DataType) -> str:
677            # String is the standard ClickHouse type, every other variant is just an alias.
678            # Additionally, any supplied length parameter will be ignored.
679            #
680            # https://clickhouse.com/docs/en/sql-reference/data-types/string
681            if expression.this in self.STRING_TYPE_MAPPING:
682                return "String"
683
684            return super().datatype_sql(expression)
685
686        def cte_sql(self, expression: exp.CTE) -> str:
687            if expression.args.get("scalar"):
688                this = self.sql(expression, "this")
689                alias = self.sql(expression, "alias")
690                return f"{this} AS {alias}"
691
692            return super().cte_sql(expression)
693
694        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
695            return super().after_limit_modifiers(expression) + [
696                (
697                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
698                    if expression.args.get("settings")
699                    else ""
700                ),
701                (
702                    self.seg("FORMAT ") + self.sql(expression, "format")
703                    if expression.args.get("format")
704                    else ""
705                ),
706            ]
707
708        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
709            params = self.expressions(expression, key="params", flat=True)
710            return self.func(expression.name, *expression.expressions) + f"({params})"
711
712        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
713            return self.func(expression.name, *expression.expressions)
714
715        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
716            return self.anonymousaggfunc_sql(expression)
717
718        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
719            return self.parameterizedagg_sql(expression)
720
721        def placeholder_sql(self, expression: exp.Placeholder) -> str:
722            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
723
724        def oncluster_sql(self, expression: exp.OnCluster) -> str:
725            return f"ON CLUSTER {self.sql(expression, 'this')}"
726
727        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
728            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
729                exp.Properties.Location.POST_NAME
730            ):
731                this_name = self.sql(expression.this, "this")
732                this_properties = " ".join(
733                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
734                )
735                this_schema = self.schema_columns_sql(expression.this)
736                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
737
738            return super().createable_sql(expression, locations)
739
740        def prewhere_sql(self, expression: exp.PreWhere) -> str:
741            this = self.indent(self.sql(expression, "this"))
742            return f"{self.seg('PREWHERE')}{self.sep()}{this}"

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

Arguments:
  • pretty: Whether to format the produced SQL string. Default: False.
  • identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True or 'always': Always quote. 'safe': Only quote identifiers that are case insensitive.
  • normalize: Whether to normalize identifiers to lowercase. Default: False.
  • pad: The pad size in a formatted string. Default: 2.
  • indent: The indentation size in a formatted string. Default: 2.
  • normalize_functions: How to normalize function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
  • unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
  • max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
  • leading_comma: Whether the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
  • max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
  • comments: Whether to preserve comments in the output SQL code. Default: True
QUERY_HINTS = False
STRUCT_DELIMITER = ('(', ')')
NVL2_SUPPORTED = False
TABLESAMPLE_REQUIRES_PARENS = False
TABLESAMPLE_SIZE_IS_ROWS = False
TABLESAMPLE_KEYWORDS = 'SAMPLE'
LAST_DAY_SUPPORTS_DATE_PART = False
CAN_IMPLEMENT_ARRAY_ANY = True
SUPPORTS_TO_NUMBER = False
STRING_TYPE_MAPPING = {<Type.CHAR: 'CHAR'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String'}
TYPE_MAPPING = {<Type.NCHAR: 'NCHAR'>: 'CHAR', <Type.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <Type.MEDIUMTEXT: 'MEDIUMTEXT'>: 'String', <Type.LONGTEXT: 'LONGTEXT'>: 'String', <Type.TINYTEXT: 'TINYTEXT'>: 'String', <Type.MEDIUMBLOB: 'MEDIUMBLOB'>: 'String', <Type.LONGBLOB: 'LONGBLOB'>: 'String', <Type.TINYBLOB: 'TINYBLOB'>: 'String', <Type.INET: 'INET'>: 'INET', <Type.CHAR: 'CHAR'>: 'String', <Type.TEXT: 'TEXT'>: 'String', <Type.VARBINARY: 'VARBINARY'>: 'String', <Type.VARCHAR: 'VARCHAR'>: 'String', <Type.ARRAY: 'ARRAY'>: 'Array', <Type.BIGINT: 'BIGINT'>: 'Int64', <Type.DATE32: 'DATE32'>: 'Date32', <Type.DATETIME64: 'DATETIME64'>: 'DateTime64', <Type.DOUBLE: 'DOUBLE'>: 'Float64', <Type.ENUM: 'ENUM'>: 'Enum', <Type.ENUM8: 'ENUM8'>: 'Enum8', <Type.ENUM16: 'ENUM16'>: 'Enum16', <Type.FIXEDSTRING: 'FIXEDSTRING'>: 'FixedString', <Type.FLOAT: 'FLOAT'>: 'Float32', <Type.INT: 'INT'>: 'Int32', <Type.MEDIUMINT: 'MEDIUMINT'>: 'Int32', <Type.INT128: 'INT128'>: 'Int128', <Type.INT256: 'INT256'>: 'Int256', <Type.LOWCARDINALITY: 'LOWCARDINALITY'>: 'LowCardinality', <Type.MAP: 'MAP'>: 'Map', <Type.NESTED: 'NESTED'>: 'Nested', <Type.NULLABLE: 'NULLABLE'>: 'Nullable', <Type.SMALLINT: 'SMALLINT'>: 'Int16', <Type.STRUCT: 'STRUCT'>: 'Tuple', <Type.TINYINT: 'TINYINT'>: 'Int8', <Type.UBIGINT: 'UBIGINT'>: 'UInt64', <Type.UINT: 'UINT'>: 'UInt32', <Type.UINT128: 'UINT128'>: 'UInt128', <Type.UINT256: 'UINT256'>: 'UInt256', <Type.USMALLINT: 'USMALLINT'>: 'UInt16', <Type.UTINYINT: 'UTINYINT'>: 'UInt8', <Type.IPV4: 'IPV4'>: 'IPv4', <Type.IPV6: 'IPV6'>: 'IPv6', <Type.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>: 'AggregateFunction', <Type.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>: 'SimpleAggregateFunction'}
TRANSFORMS = {<class 'sqlglot.expressions.JSONPathKey'>: <function json_path_key_only_name>, <class 'sqlglot.expressions.JSONPathRoot'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.BackupProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CommentColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DateAdd'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.DateFormatColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.DefaultColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.EncodeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExcludeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ExternalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.GlobalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.HeapProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IcebergProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InheritsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InlineLengthColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.InputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.JSONExtract'>: <function json_extract_segments.<locals>._json_extract_segments>, <class 'sqlglot.expressions.JSONExtractScalar'>: <function json_extract_segments.<locals>._json_extract_segments>, <class 'sqlglot.expressions.LanguageProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LocationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.LogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.MaterializedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NonClusteredColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.NotForReplicationColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnCommitProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OnUpdateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.OutputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.PathColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ReturnsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SampleProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetConfigProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SettingsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SharingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.StabilityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.Timestamp'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ToTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransformModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.TransientProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.UnloggedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.VarMap'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.WithOperator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.AnyValue'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ApproxDistinct'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArrayFilter'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.ArraySize'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArraySum'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.ArgMax'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.ArgMin'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.Array'>: <function inline_array_sql>, <class 'sqlglot.expressions.CastToStrType'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CountIf'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.CurrentDate'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.DateDiff'>: <function date_delta_sql.<locals>._delta_sql>, <class 'sqlglot.expressions.Explode'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Final'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.IsNan'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Map'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Nullif'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.PartitionedByProperty'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Pivot'>: <function no_pivot_sql>, <class 'sqlglot.expressions.Quantile'>: <function _quantile_sql>, <class 'sqlglot.expressions.RegexpLike'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Rand'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.StartsWith'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.StrPosition'>: <function ClickHouse.Generator.<lambda>>, <class 'sqlglot.expressions.Xor'>: <function ClickHouse.Generator.<lambda>>}
PROPERTIES_LOCATION = {<class 'sqlglot.expressions.AlgorithmProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.AutoIncrementProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.AutoRefreshProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BackupProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.BlockCompressionProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CharacterSetProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ChecksumProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.CollateProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.CopyGrantsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Cluster'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ClusteredByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DataBlocksizeProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.DefinerProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.DictRange'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DictProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.DistStyleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.EngineProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExecuteAsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ExternalProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.FallbackProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.FileFormatProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.FreespaceProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.GlobalProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.HeapProperty'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.InheritsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.IcebergProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.InputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.IsolatedLoadingProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.JournalProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.LanguageProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LikeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LocationProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LockProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.LockingProperty'>: <Location.POST_ALIAS: 'POST_ALIAS'>, <class 'sqlglot.expressions.LogProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.MaterializedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.MergeBlockRatioProperty'>: <Location.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.NoPrimaryIndexProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.OnProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OnCommitProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.Order'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.OutputModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedByProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PartitionedOfProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.PrimaryKey'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Property'>: <Location.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.RemoteWithConnectionModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ReturnsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatDelimitedProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.RowFormatSerdeProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SampleProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SchemaCommentProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SerdeProperties'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.Set'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SettingsProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SetProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.SetConfigProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SharingProperty'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SequenceProperties'>: <Location.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.SortKeyProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlReadWriteProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.SqlSecurityProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.StabilityProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TemporaryProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.ToTableProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.TransientProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.TransformModelProperty'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.MergeTreeTTL'>: <Location.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.UnloggedProperty'>: <Location.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.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 = {'NAMED COLLECTION', 'VIEW', 'TABLE', 'INDEX', 'FUNCTION', 'DICTIONARY', 'DATABASE'}
def likeproperty_sql(self, expression: sqlglot.expressions.LikeProperty) -> str:
645        def likeproperty_sql(self, expression: exp.LikeProperty) -> str:
646            return f"AS {self.sql(expression, 'this')}"
def eq_sql(self, expression: sqlglot.expressions.EQ) -> str:
665        def eq_sql(self, expression: exp.EQ) -> str:
666            return self._any_to_has(expression, super().eq_sql)
def neq_sql(self, expression: sqlglot.expressions.NEQ) -> str:
668        def neq_sql(self, expression: exp.NEQ) -> str:
669            return self._any_to_has(expression, super().neq_sql, "NOT ")
def regexpilike_sql(self, expression: sqlglot.expressions.RegexpILike) -> str:
671        def regexpilike_sql(self, expression: exp.RegexpILike) -> str:
672            # Manually add a flag to make the search case-insensitive
673            regex = self.func("CONCAT", "'(?i)'", expression.expression)
674            return self.func("match", expression.this, regex)
def datatype_sql(self, expression: sqlglot.expressions.DataType) -> str:
676        def datatype_sql(self, expression: exp.DataType) -> str:
677            # String is the standard ClickHouse type, every other variant is just an alias.
678            # Additionally, any supplied length parameter will be ignored.
679            #
680            # https://clickhouse.com/docs/en/sql-reference/data-types/string
681            if expression.this in self.STRING_TYPE_MAPPING:
682                return "String"
683
684            return super().datatype_sql(expression)
def cte_sql(self, expression: sqlglot.expressions.CTE) -> str:
686        def cte_sql(self, expression: exp.CTE) -> str:
687            if expression.args.get("scalar"):
688                this = self.sql(expression, "this")
689                alias = self.sql(expression, "alias")
690                return f"{this} AS {alias}"
691
692            return super().cte_sql(expression)
def after_limit_modifiers(self, expression: sqlglot.expressions.Expression) -> List[str]:
694        def after_limit_modifiers(self, expression: exp.Expression) -> t.List[str]:
695            return super().after_limit_modifiers(expression) + [
696                (
697                    self.seg("SETTINGS ") + self.expressions(expression, key="settings", flat=True)
698                    if expression.args.get("settings")
699                    else ""
700                ),
701                (
702                    self.seg("FORMAT ") + self.sql(expression, "format")
703                    if expression.args.get("format")
704                    else ""
705                ),
706            ]
def parameterizedagg_sql(self, expression: sqlglot.expressions.ParameterizedAgg) -> str:
708        def parameterizedagg_sql(self, expression: exp.ParameterizedAgg) -> str:
709            params = self.expressions(expression, key="params", flat=True)
710            return self.func(expression.name, *expression.expressions) + f"({params})"
def anonymousaggfunc_sql(self, expression: sqlglot.expressions.AnonymousAggFunc) -> str:
712        def anonymousaggfunc_sql(self, expression: exp.AnonymousAggFunc) -> str:
713            return self.func(expression.name, *expression.expressions)
def combinedaggfunc_sql(self, expression: sqlglot.expressions.CombinedAggFunc) -> str:
715        def combinedaggfunc_sql(self, expression: exp.CombinedAggFunc) -> str:
716            return self.anonymousaggfunc_sql(expression)
def combinedparameterizedagg_sql(self, expression: sqlglot.expressions.CombinedParameterizedAgg) -> str:
718        def combinedparameterizedagg_sql(self, expression: exp.CombinedParameterizedAgg) -> str:
719            return self.parameterizedagg_sql(expression)
def placeholder_sql(self, expression: sqlglot.expressions.Placeholder) -> str:
721        def placeholder_sql(self, expression: exp.Placeholder) -> str:
722            return f"{{{expression.name}: {self.sql(expression, 'kind')}}}"
def oncluster_sql(self, expression: sqlglot.expressions.OnCluster) -> str:
724        def oncluster_sql(self, expression: exp.OnCluster) -> str:
725            return f"ON CLUSTER {self.sql(expression, 'this')}"
def createable_sql( self, expression: sqlglot.expressions.Create, locations: DefaultDict) -> str:
727        def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
728            if expression.kind in self.ON_CLUSTER_TARGETS and locations.get(
729                exp.Properties.Location.POST_NAME
730            ):
731                this_name = self.sql(expression.this, "this")
732                this_properties = " ".join(
733                    [self.sql(prop) for prop in locations[exp.Properties.Location.POST_NAME]]
734                )
735                this_schema = self.schema_columns_sql(expression.this)
736                return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
737
738            return super().createable_sql(expression, locations)
def prewhere_sql(self, expression: sqlglot.expressions.PreWhere) -> str:
740        def prewhere_sql(self, expression: exp.PreWhere) -> str:
741            this = self.indent(self.sql(expression, "this"))
742            return f"{self.seg('PREWHERE')}{self.sep()}{this}"
SELECT_KINDS: Tuple[str, ...] = ()
AFTER_HAVING_MODIFIER_TRANSFORMS = {'qualify': <function Generator.<lambda>>, 'windows': <function Generator.<lambda>>}
Inherited Members
sqlglot.generator.Generator
Generator
NULL_ORDERING_SUPPORTED
IGNORE_NULLS_IN_FUNC
LOCKING_READS_SUPPORTED
WRAP_DERIVED_VALUES
CREATE_FUNCTION_RETURN_AS
MATCHED_BY_SOURCE
SINGLE_STRING_INTERVAL
INTERVAL_ALLOWS_PLURAL_FORM
LIMIT_FETCH
LIMIT_ONLY_LITERALS
RENAME_TABLE_WITH_DB
INDEX_ON
QUERY_HINT_SEP
IS_BOOL_ALLOWED
DUPLICATE_KEY_UPDATE_WITH_SET
LIMIT_IS_TOP
RETURNING_END
COLUMN_JOIN_MARKS_SUPPORTED
EXTRACT_ALLOWS_QUOTES
TZ_TO_WITH_TIME_ZONE
VALUES_AS_TABLE
ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
UNNEST_WITH_ORDINALITY
AGGREGATE_FILTER_SUPPORTED
SEMI_ANTI_JOIN_WITH_SIDE
COMPUTED_COLUMN_WITH_TYPE
SUPPORTS_TABLE_COPY
TABLESAMPLE_WITH_METHOD
TABLESAMPLE_SEED_KEYWORD
COLLATE_IS_FUNC
DATA_TYPE_SPECIFIERS_ALLOWED
ENSURE_BOOLS
CTE_RECURSIVE_KEYWORD_REQUIRED
SUPPORTS_SINGLE_ARG_CONCAT
SUPPORTS_TABLE_ALIAS_COLUMNS
UNPIVOT_ALIASES_ARE_IDENTIFIERS
JSON_KEY_VALUE_PAIR_SEP
INSERT_OVERWRITE
SUPPORTS_SELECT_INTO
SUPPORTS_UNLOGGED_TABLES
SUPPORTS_CREATE_TABLE_LIKE
LIKE_PROPERTY_INSIDE_SCHEMA
MULTI_ARG_DISTINCT
JSON_TYPE_REQUIRED_FOR_EXTRACTION
JSON_PATH_BRACKETED_KEY_SUPPORTED
JSON_PATH_SINGLE_QUOTE_ESCAPE
STAR_MAPPING
TIME_PART_SINGULARS
TOKEN_MAPPING
PARAMETER_TOKEN
NAMED_PLACEHOLDER_TOKEN
RESERVED_KEYWORDS
WITH_SEPARATED_COMMENTS
EXCLUDE_COMMENTS
UNWRAPPED_INTERVAL_VALUES
PARAMETERIZABLE_TEXT_TYPES
EXPRESSIONS_WITHOUT_NESTED_CTES
SENTINEL_LINE_BREAK
pretty
identify
normalize
pad
unsupported_level
max_unsupported
leading_comma
max_text_width
comments
dialect
normalize_functions
unsupported_messages
generate
preprocess
unsupported
sep
seg
pad_comment
maybe_comment
wrap
no_identify
normalize_func
indent
sql
uncache_sql
cache_sql
characterset_sql
column_sql
columnposition_sql
columndef_sql
columnconstraint_sql
computedcolumnconstraint_sql
autoincrementcolumnconstraint_sql
compresscolumnconstraint_sql
generatedasidentitycolumnconstraint_sql
generatedasrowcolumnconstraint_sql
periodforsystemtimeconstraint_sql
notnullcolumnconstraint_sql
transformcolumnconstraint_sql
primarykeycolumnconstraint_sql
uniquecolumnconstraint_sql
create_sql
sequenceproperties_sql
clone_sql
describe_sql
heredoc_sql
prepend_ctes
with_sql
tablealias_sql
bitstring_sql
hexstring_sql
bytestring_sql
unicodestring_sql
rawstring_sql
datatypeparam_sql
directory_sql
delete_sql
drop_sql
except_sql
except_op
fetch_sql
filter_sql
hint_sql
indexparameters_sql
index_sql
identifier_sql
inputoutputformat_sql
national_sql
partition_sql
properties_sql
root_properties
properties
with_properties
locate_properties
property_name
property_sql
fallbackproperty_sql
journalproperty_sql
freespaceproperty_sql
checksumproperty_sql
mergeblockratioproperty_sql
datablocksizeproperty_sql
blockcompressionproperty_sql
isolatedloadingproperty_sql
partitionboundspec_sql
partitionedofproperty_sql
lockingproperty_sql
withdataproperty_sql
withsystemversioningproperty_sql
insert_sql
intersect_sql
intersect_op
introducer_sql
kill_sql
pseudotype_sql
objectidentifier_sql
onconflict_sql
returning_sql
rowformatdelimitedproperty_sql
withtablehint_sql
indextablehint_sql
historicaldata_sql
table_parts
table_sql
tablesample_sql
pivot_sql
version_sql
tuple_sql
update_sql
values_sql
var_sql
into_sql
from_sql
group_sql
having_sql
connect_sql
prior_sql
join_sql
lambda_sql
lateral_op
lateral_sql
limit_sql
offset_sql
setitem_sql
set_sql
pragma_sql
lock_sql
literal_sql
escape_str
loaddata_sql
null_sql
boolean_sql
order_sql
withfill_sql
cluster_sql
distribute_sql
sort_sql
ordered_sql
matchrecognize_sql
query_modifiers
queryoption_sql
offset_limit_modifiers
select_sql
schema_sql
schema_columns_sql
star_sql
parameter_sql
sessionparameter_sql
subquery_sql
qualify_sql
set_operations
union_sql
union_op
unnest_sql
where_sql
window_sql
partition_by_sql
windowspec_sql
withingroup_sql
between_sql
bracket_sql
all_sql
any_sql
exists_sql
case_sql
constraint_sql
nextvaluefor_sql
extract_sql
trim_sql
convert_concat_args
concat_sql
concatws_sql
check_sql
foreignkey_sql
primarykey_sql
if_sql
matchagainst_sql
jsonkeyvalue_sql
jsonpath_sql
json_path_part
formatjson_sql
jsonobject_sql
jsonobjectagg_sql
jsonarray_sql
jsonarrayagg_sql
jsoncolumndef_sql
jsonschema_sql
jsontable_sql
openjsoncolumndef_sql
openjson_sql
in_sql
in_unnest_op
interval_sql
return_sql
reference_sql
anonymous_sql
paren_sql
neg_sql
not_sql
alias_sql
pivotalias_sql
aliases_sql
atindex_sql
attimezone_sql
fromtimezone_sql
add_sql
and_sql
xor_sql
connector_sql
bitwiseand_sql
bitwiseleftshift_sql
bitwisenot_sql
bitwiseor_sql
bitwiserightshift_sql
bitwisexor_sql
cast_sql
currentdate_sql
currenttimestamp_sql
collate_sql
command_sql
comment_sql
mergetreettlaction_sql
mergetreettl_sql
transaction_sql
commit_sql
rollback_sql
altercolumn_sql
renametable_sql
renamecolumn_sql
altertable_sql
add_column_sql
droppartition_sql
addconstraint_sql
distinct_sql
ignorenulls_sql
respectnulls_sql
havingmax_sql
intdiv_sql
dpipe_sql
div_sql
overlaps_sql
distance_sql
dot_sql
propertyeq_sql
escape_sql
glob_sql
gt_sql
gte_sql
ilike_sql
ilikeany_sql
is_sql
like_sql
likeany_sql
similarto_sql
lt_sql
lte_sql
mod_sql
mul_sql
nullsafeeq_sql
nullsafeneq_sql
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
tag_sql
token_sql
userdefinedfunction_sql
joinhint_sql
kwarg_sql
when_sql
merge_sql
tochar_sql
tonumber_sql
dictproperty_sql
dictrange_sql
dictsubproperty_sql
clusteredbyproperty_sql
anyvalue_sql
querytransform_sql
indexconstraintoption_sql
checkcolumnconstraint_sql
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
arrayany_sql
generateseries_sql
struct_sql
partitionrange_sql
truncatetable_sql
convert_sql