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