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