Edit on GitHub

sqlglot.dialects.clickhouse

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

Determines how function names are going to be normalized.

Possible values:

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

NULL_ORDERING = 'nulls_are_last'

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

SUPPORTS_USER_DEFINED_TYPES = False

Whether user-defined data types are supported.

SAFE_DIVISION = True

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

LOG_BASE_FIRST: Optional[bool] = None

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

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

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

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

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

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

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

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