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