sqlglot.typing
1from __future__ import annotations 2 3import typing as t 4from decimal import Decimal 5 6from sqlglot import exp 7from sqlglot.helper import subclasses 8from builtins import type as Type 9 10if t.TYPE_CHECKING: 11 from sqlglot.optimizer.annotate_types import TypeAnnotator 12 13ExprMetadataType = dict[Type[exp.Expr], dict[str, t.Any]] 14 15 16def annotate_signed_integer_literal( 17 self: TypeAnnotator, 18 expression: exp.Literal | exp.Neg, 19 *, 20 negated_operand: exp.Expr | None = None, 21) -> exp.Expr: 22 # Fold nested negations before checking the dialect's bounds. For example, 23 # -9223372036854775808 fits in BIGINT and 9223372036854775808 exceeds its maximum. 24 operand: exp.Expr = expression if negated_operand is None else negated_operand 25 negated = negated_operand is not None 26 while isinstance(operand, exp.Neg): 27 negated = not negated 28 operand = operand.this.unnest() 29 if isinstance(operand, exp.Literal) and not operand.is_string: 30 text = operand.this 31 digits = text[1:] if text.startswith(("+", "-")) else text 32 if digits.isdecimal(): 33 value = t.cast("int | Decimal", operand.to_py()) 34 if negated: 35 # Decimal's unary minus can round very long integers across a type boundary. 36 value = value.copy_negate() if isinstance(value, Decimal) else -value 37 expression.meta["nonnull"] = True 38 return self._set_type(expression, self.dialect.integer_type_for_value(value)) 39 40 if isinstance(expression, exp.Literal): 41 return self._annotate_literal(expression) 42 return self._annotate_unary(expression) 43 44 45def annotate_negated_literal( 46 self: TypeAnnotator, expression: exp.Neg, *promote_to_bigint: exp.DType 47) -> exp.Expr: 48 if isinstance(expression.this, exp.Literal): 49 return annotate_signed_integer_literal(self, expression) 50 self._annotate_unary(expression) 51 if promote_to_bigint and expression.is_type(*promote_to_bigint): 52 return self._set_type(expression, exp.DType.BIGINT) 53 return expression 54 55 56def annotate_by_numeric_arg(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr: 57 """ 58 Annotates math functions (e.g. FLOOR) that preserve numeric and unknown types, and return INT 59 otherwise. 60 61 Assumes `this` is set, which holds for valid ASTs because it's a required argument. 62 """ 63 this: exp.Expr = expression.this 64 65 self._set_type( 66 expression, 67 this.type 68 if this.is_type(exp.DType.UNKNOWN, *exp.DataType.NUMERIC_TYPES) 69 else exp.DType.INT, 70 ) 71 return expression 72 73 74def annotate_int_as_double(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr: 75 """ 76 Annotates math functions (e.g. FLOOR) that return DOUBLE for integers and strings, and the input 77 type otherwise. 78 79 Assumes `this` is set, which holds for valid ASTs because it's a required argument. 80 """ 81 this: exp.Expr = expression.this 82 83 self._set_type( 84 expression, 85 exp.DType.DOUBLE 86 if this.is_type(*exp.DataType.INTEGER_TYPES, *exp.DataType.TEXT_TYPES) 87 else this.type, 88 ) 89 return expression 90 91 92TIMESTAMP_EXPRESSIONS = { 93 exp.CurrentTimestamp, 94 exp.StrToTime, 95 exp.TimeStrToTime, 96 exp.TimestampAdd, 97 exp.TimestampSub, 98 exp.UnixToTime, 99} 100 101EXPRESSION_METADATA: ExprMetadataType = { 102 **{ 103 expr_type: {"annotator": lambda self, e: self._annotate_binary(e)} 104 for expr_type in subclasses(exp.__name__, exp.Binary) 105 }, 106 **{ 107 expr_type: {"annotator": lambda self, e: self._annotate_unary(e)} 108 for expr_type in subclasses( 109 exp.__name__, 110 ( 111 exp.Unary, 112 exp.Alias, 113 exp.IgnoreNulls, 114 exp.RespectNulls, 115 exp.FormatPhrase, 116 exp.TeradataTitle, 117 ), 118 ) 119 }, 120 **{ 121 expr_type: {"returns": exp.DType.BIGINT} 122 for expr_type in { 123 exp.ApproxDistinct, 124 exp.ArraySize, 125 exp.CountIf, 126 exp.DenseRank, 127 exp.Int64, 128 exp.Ntile, 129 exp.Rank, 130 exp.RowNumber, 131 exp.UnixSeconds, 132 exp.UnixMicros, 133 exp.UnixMillis, 134 } 135 }, 136 **{ 137 expr_type: {"returns": exp.DType.BINARY} 138 for expr_type in { 139 exp.FromBase32, 140 exp.FromBase64, 141 } 142 }, 143 **{ 144 expr_type: {"returns": exp.DType.BOOLEAN} 145 for expr_type in { 146 exp.All, 147 exp.Any, 148 exp.Between, 149 exp.Boolean, 150 exp.Contains, 151 exp.EndsWith, 152 exp.Exists, 153 exp.In, 154 exp.IsArray, 155 exp.IsInf, 156 exp.IsNan, 157 exp.LogicalAnd, 158 exp.LogicalOr, 159 exp.StartsWith, 160 } 161 }, 162 **{ 163 expr_type: {"returns": exp.DType.DATE} 164 for expr_type in { 165 exp.CurrentDate, 166 exp.Date, 167 exp.DateFromParts, 168 exp.DateStrToDate, 169 exp.DiToDate, 170 exp.LastDay, 171 exp.StrToDate, 172 exp.TimeStrToDate, 173 exp.TsOrDsToDate, 174 } 175 }, 176 **{ 177 expr_type: {"returns": exp.DType.DATETIME} 178 for expr_type in { 179 exp.CurrentDatetime, 180 exp.Datetime, 181 exp.DatetimeAdd, 182 exp.DatetimeSub, 183 exp.TsOrDsToDatetime, 184 } 185 }, 186 **{ 187 expr_type: {"returns": exp.DType.DOUBLE} 188 for expr_type in { 189 exp.Asin, 190 exp.Asinh, 191 exp.Acos, 192 exp.CovarPop, 193 exp.CovarSamp, 194 exp.Acosh, 195 exp.ApproxQuantile, 196 exp.Atan, 197 exp.Atanh, 198 exp.Avg, 199 exp.Cbrt, 200 exp.Cos, 201 exp.Cosh, 202 exp.Cot, 203 exp.Degrees, 204 exp.Exp, 205 exp.Kurtosis, 206 exp.Ln, 207 exp.Log, 208 exp.Pi, 209 exp.Pow, 210 exp.PercentileCont, 211 exp.Quantile, 212 exp.Radians, 213 exp.Round, 214 exp.SafeDivide, 215 exp.Sin, 216 exp.Sinh, 217 exp.Sqrt, 218 exp.Stddev, 219 exp.StddevPop, 220 exp.StddevSamp, 221 exp.Rand, 222 exp.Tan, 223 exp.Tanh, 224 exp.ToDouble, 225 exp.CumeDist, 226 exp.PercentRank, 227 exp.Variance, 228 exp.VariancePop, 229 exp.Skewness, 230 } 231 }, 232 **{ 233 expr_type: {"returns": exp.DType.INT} 234 for expr_type in { 235 exp.Ascii, 236 exp.BitLength, 237 exp.DatetimeDiff, 238 exp.DayOfMonth, 239 exp.DayOfWeek, 240 exp.DayOfYear, 241 exp.Getbit, 242 exp.Hour, 243 exp.TimestampDiff, 244 exp.TimeDiff, 245 exp.Unicode, 246 exp.DateToDi, 247 exp.Levenshtein, 248 exp.Length, 249 exp.Sign, 250 exp.StrPosition, 251 exp.TsOrDiToDi, 252 exp.Quarter, 253 exp.UnixDate, 254 } 255 }, 256 **{ 257 expr_type: {"returns": exp.DType.INTERVAL} 258 for expr_type in { 259 exp.Interval, 260 exp.JustifyDays, 261 exp.JustifyHours, 262 exp.JustifyInterval, 263 exp.MakeInterval, 264 } 265 }, 266 **{ 267 expr_type: {"returns": exp.DType.JSON} 268 for expr_type in { 269 exp.ParseJSON, 270 } 271 }, 272 **{ 273 expr_type: {"returns": exp.DType.TIME} 274 for expr_type in { 275 exp.CurrentTime, 276 exp.Localtime, 277 exp.Time, 278 exp.TimeAdd, 279 exp.TimeSub, 280 } 281 }, 282 **{ 283 expr_type: {"returns": exp.DType.TIMESTAMPLTZ} 284 for expr_type in { 285 exp.TimestampLtzFromParts, 286 } 287 }, 288 **{ 289 expr_type: {"returns": exp.DType.TIMESTAMPTZ} 290 for expr_type in { 291 exp.CurrentTimestampLTZ, 292 exp.TimestampTzFromParts, 293 } 294 }, 295 **{expr_type: {"returns": exp.DType.TIMESTAMP} for expr_type in TIMESTAMP_EXPRESSIONS}, 296 **{ 297 expr_type: {"returns": exp.DType.TINYINT} 298 for expr_type in { 299 exp.Day, 300 exp.DayOfWeekIso, 301 exp.Month, 302 exp.Week, 303 exp.WeekOfYear, 304 exp.Year, 305 exp.YearOfWeek, 306 exp.YearOfWeekIso, 307 } 308 }, 309 **{ 310 expr_type: {"returns": exp.DType.VARCHAR} 311 for expr_type in { 312 exp.ArrayToString, 313 exp.Concat, 314 exp.ConcatWs, 315 exp.Chr, 316 exp.CurrentCatalog, 317 exp.CurrentPath, 318 exp.CurrentRole, 319 exp.CurrentSchema, 320 exp.CurrentVersion, 321 exp.CurrentUser, 322 exp.Dayname, 323 exp.DateToDateStr, 324 exp.DPipe, 325 exp.GroupConcat, 326 exp.Initcap, 327 exp.Lower, 328 exp.MD5, 329 exp.Monthname, 330 exp.RawString, 331 exp.Repeat, 332 exp.SHA, 333 exp.SHA2, 334 exp.SessionUser, 335 exp.Space, 336 exp.String, 337 exp.Substring, 338 exp.TimeToStr, 339 exp.TimeToTimeStr, 340 exp.Trim, 341 exp.ToBase32, 342 exp.ToBase64, 343 exp.ToChar, 344 exp.Translate, 345 exp.TsOrDsToDateStr, 346 exp.Typeof, 347 exp.UnixToStr, 348 exp.UnixToTimeStr, 349 exp.Upper, 350 } 351 }, 352 **{ 353 expr_type: {"returns": exp.DType.VARIANT} 354 for expr_type in { 355 exp.ToVariant, 356 } 357 }, 358 **{ 359 expr_type: {"annotator": annotate_by_numeric_arg} 360 for expr_type in { 361 exp.Ceil, 362 exp.Floor, 363 } 364 }, 365 **{ 366 expr_type: {"annotator": lambda self, e: self._annotate_by_args(e, "this")} 367 for expr_type in { 368 exp.Abs, 369 exp.AnyValue, 370 exp.ArrayConcatAgg, 371 exp.ArrayReverse, 372 exp.ArraySlice, 373 exp.Filter, 374 exp.FirstValue, 375 exp.HavingMax, 376 exp.LastValue, 377 exp.Limit, 378 exp.NthValue, 379 exp.Order, 380 exp.ArraySort, 381 exp.Window, 382 } 383 }, 384 **{ 385 expr_type: {"annotator": lambda self, e: self._annotate_by_args(e, "this", "expressions")} 386 for expr_type in { 387 exp.ArrayConcat, 388 exp.Coalesce, 389 exp.Greatest, 390 exp.Least, 391 } 392 }, 393 **{ 394 expr_type: { 395 "annotator": lambda self, e: self._annotate_by_args( 396 e, "this", "expressions", array=e.args.get("count") is not None 397 ) 398 } 399 for expr_type in {exp.Max, exp.Min} 400 }, 401 **{ 402 expr_type: {"annotator": lambda self, e: self._annotate_by_array_element(e)} 403 for expr_type in { 404 exp.ArrayFirst, 405 exp.ArrayLast, 406 } 407 }, 408 exp.Anonymous: {"annotator": lambda self, e: self._set_type(e, self.schema.get_udf_type(e))}, 409 **{ 410 expr_type: {"annotator": lambda self, e: self._annotate_timeunit(e)} 411 for expr_type in { 412 exp.DateAdd, 413 exp.DateSub, 414 exp.DateTrunc, 415 } 416 }, 417 **{ 418 expr_type: {"annotator": lambda self, e: self._set_type(e, e.args["to"])} 419 for expr_type in { 420 exp.Cast, 421 exp.TeradataConversion, 422 exp.TryCast, 423 } 424 }, 425 **{ 426 expr_type: {"annotator": lambda self, e: self._annotate_map(e)} 427 for expr_type in { 428 exp.Map, 429 exp.VarMap, 430 } 431 }, 432 exp.Array: {"annotator": lambda self, e: self._annotate_by_args(e, "expressions", array=True)}, 433 exp.ArrayAgg: {"annotator": lambda self, e: self._annotate_by_args(e, "this", array=True)}, 434 exp.Bracket: {"annotator": lambda self, e: self._annotate_bracket(e)}, 435 exp.Case: { 436 "annotator": lambda self, e: self._annotate_by_args( 437 e, *[if_expr.args["true"] for if_expr in e.args["ifs"]], "default" 438 ) 439 }, 440 exp.Count: { 441 "annotator": lambda self, e: self._set_type( 442 e, exp.DType.BIGINT if e.args.get("big_int") else exp.DType.INT 443 ) 444 }, 445 exp.DateDiff: { 446 "annotator": lambda self, e: self._set_type( 447 e, exp.DType.BIGINT if e.args.get("big_int") else exp.DType.INT 448 ) 449 }, 450 exp.DataType: {"annotator": lambda _, e: e}, 451 exp.Div: {"annotator": lambda self, e: self._annotate_div(e)}, 452 exp.Distinct: {"annotator": lambda self, e: self._annotate_by_args(e, "expressions")}, 453 exp.Dot: {"annotator": lambda self, e: self._annotate_dot(e)}, 454 exp.Explode: {"annotator": lambda self, e: self._annotate_explode(e)}, 455 exp.Extract: {"annotator": lambda self, e: self._annotate_extract(e)}, 456 exp.HexString: { 457 "annotator": lambda self, e: self._set_type( 458 e, 459 exp.DType.VARCHAR 460 if e.args.get("is_character") 461 else (exp.DType.BIGINT if e.args.get("is_integer") else exp.DType.BINARY), 462 ) 463 }, 464 exp.GenerateSeries: { 465 "annotator": lambda self, e: self._annotate_by_args(e, "start", "end", "step", array=True) 466 }, 467 exp.GenerateDateArray: { 468 "annotator": lambda self, e: self._set_type(e, exp.DataType.from_str("ARRAY<DATE>")) 469 }, 470 exp.GenerateTimestampArray: { 471 "annotator": lambda self, e: self._set_type(e, exp.DataType.from_str("ARRAY<TIMESTAMP>")) 472 }, 473 exp.If: {"annotator": lambda self, e: self._annotate_by_args(e, "true", "false")}, 474 exp.Lag: {"annotator": lambda self, e: self._annotate_by_args(e, "this", "default")}, 475 exp.Lead: {"annotator": lambda self, e: self._annotate_by_args(e, "this", "default")}, 476 exp.Literal: {"annotator": lambda self, e: self._annotate_literal(e)}, 477 exp.Null: {"returns": exp.DType.NULL}, 478 exp.Nullif: {"annotator": lambda self, e: self._annotate_by_args(e, "this", "expression")}, 479 exp.PropertyEQ: {"annotator": lambda self, e: self._annotate_by_args(e, "expression")}, 480 exp.Struct: {"annotator": lambda self, e: self._annotate_struct(e)}, 481 exp.Sum: { 482 "annotator": lambda self, e: self._annotate_by_args(e, "this", "expressions", promote=True) 483 }, 484 exp.Timestamp: { 485 "annotator": lambda self, e: self._set_type( 486 e, 487 exp.DType.TIMESTAMPTZ if e.args.get("with_tz") else exp.DType.TIMESTAMP, 488 ) 489 }, 490 exp.ToMap: {"annotator": lambda self, e: self._annotate_to_map(e)}, 491 exp.Unnest: {"annotator": lambda self, e: self._annotate_unnest(e)}, 492 exp.WithinGroup: {"annotator": lambda self, e: self._annotate_within_group(e)}, 493 exp.Subquery: {"annotator": lambda self, e: self._annotate_subquery(e)}, 494}
ExprMetadataType =
dict[type[sqlglot.expressions.core.Expr], dict[str, typing.Any]]
def
annotate_signed_integer_literal( self: sqlglot.optimizer.annotate_types.TypeAnnotator, expression: sqlglot.expressions.core.Literal | sqlglot.expressions.core.Neg, *, negated_operand: sqlglot.expressions.core.Expr | None = None) -> sqlglot.expressions.core.Expr:
17def annotate_signed_integer_literal( 18 self: TypeAnnotator, 19 expression: exp.Literal | exp.Neg, 20 *, 21 negated_operand: exp.Expr | None = None, 22) -> exp.Expr: 23 # Fold nested negations before checking the dialect's bounds. For example, 24 # -9223372036854775808 fits in BIGINT and 9223372036854775808 exceeds its maximum. 25 operand: exp.Expr = expression if negated_operand is None else negated_operand 26 negated = negated_operand is not None 27 while isinstance(operand, exp.Neg): 28 negated = not negated 29 operand = operand.this.unnest() 30 if isinstance(operand, exp.Literal) and not operand.is_string: 31 text = operand.this 32 digits = text[1:] if text.startswith(("+", "-")) else text 33 if digits.isdecimal(): 34 value = t.cast("int | Decimal", operand.to_py()) 35 if negated: 36 # Decimal's unary minus can round very long integers across a type boundary. 37 value = value.copy_negate() if isinstance(value, Decimal) else -value 38 expression.meta["nonnull"] = True 39 return self._set_type(expression, self.dialect.integer_type_for_value(value)) 40 41 if isinstance(expression, exp.Literal): 42 return self._annotate_literal(expression) 43 return self._annotate_unary(expression)
def
annotate_negated_literal( self: sqlglot.optimizer.annotate_types.TypeAnnotator, expression: sqlglot.expressions.core.Neg, *promote_to_bigint: sqlglot.expressions.datatypes.DType) -> sqlglot.expressions.core.Expr:
46def annotate_negated_literal( 47 self: TypeAnnotator, expression: exp.Neg, *promote_to_bigint: exp.DType 48) -> exp.Expr: 49 if isinstance(expression.this, exp.Literal): 50 return annotate_signed_integer_literal(self, expression) 51 self._annotate_unary(expression) 52 if promote_to_bigint and expression.is_type(*promote_to_bigint): 53 return self._set_type(expression, exp.DType.BIGINT) 54 return expression
def
annotate_by_numeric_arg( self: sqlglot.optimizer.annotate_types.TypeAnnotator, expression: sqlglot.expressions.core.Expr) -> sqlglot.expressions.core.Expr:
57def annotate_by_numeric_arg(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr: 58 """ 59 Annotates math functions (e.g. FLOOR) that preserve numeric and unknown types, and return INT 60 otherwise. 61 62 Assumes `this` is set, which holds for valid ASTs because it's a required argument. 63 """ 64 this: exp.Expr = expression.this 65 66 self._set_type( 67 expression, 68 this.type 69 if this.is_type(exp.DType.UNKNOWN, *exp.DataType.NUMERIC_TYPES) 70 else exp.DType.INT, 71 ) 72 return expression
Annotates math functions (e.g. FLOOR) that preserve numeric and unknown types, and return INT otherwise.
Assumes this is set, which holds for valid ASTs because it's a required argument.
def
annotate_int_as_double( self: sqlglot.optimizer.annotate_types.TypeAnnotator, expression: sqlglot.expressions.core.Expr) -> sqlglot.expressions.core.Expr:
75def annotate_int_as_double(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr: 76 """ 77 Annotates math functions (e.g. FLOOR) that return DOUBLE for integers and strings, and the input 78 type otherwise. 79 80 Assumes `this` is set, which holds for valid ASTs because it's a required argument. 81 """ 82 this: exp.Expr = expression.this 83 84 self._set_type( 85 expression, 86 exp.DType.DOUBLE 87 if this.is_type(*exp.DataType.INTEGER_TYPES, *exp.DataType.TEXT_TYPES) 88 else this.type, 89 ) 90 return expression
Annotates math functions (e.g. FLOOR) that return DOUBLE for integers and strings, and the input type otherwise.
Assumes this is set, which holds for valid ASTs because it's a required argument.
TIMESTAMP_EXPRESSIONS =
{<class 'sqlglot.expressions.temporal.StrToTime'>, <class 'sqlglot.expressions.temporal.TimestampSub'>, <class 'sqlglot.expressions.temporal.TimestampAdd'>, <class 'sqlglot.expressions.temporal.TimeStrToTime'>, <class 'sqlglot.expressions.temporal.UnixToTime'>, <class 'sqlglot.expressions.temporal.CurrentTimestamp'>}
EXPRESSION_METADATA: dict[type[sqlglot.expressions.core.Expr], dict[str, typing.Any]] =
{<class 'sqlglot.expressions.core.Add'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Adjacent'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.And'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayContainedBy'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayContains'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayContainsAll'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayOverlaps'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayPosition'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Binary'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseAnd'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseLeftShift'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseOr'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseRightShift'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseXor'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Collate'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Connector'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.Corr'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.DPipe'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.core.Distance'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.DistanceNd'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Div'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.Dot'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.EQ'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Escape'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.ExtendsLeft'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.ExtendsRight'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.GT'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.GTE'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Glob'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.ILike'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.IntDiv'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Is'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONArrayContains'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBContains'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBContainsAllTopKeys'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBContainsAnyTopKeys'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBContainsTopKey'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBDeleteAtPath'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBExtract'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBExtractScalar'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONBPathExists'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONExtract'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.json.JSONExtractScalar'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Kwarg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.LT'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.LTE'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Like'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Match'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Mod'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Mul'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.NEQ'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.NestedJSONSelect'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.NullSafeEQ'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.NullSafeNEQ'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Operator'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Or'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Overlaps'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Pow'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.core.PropertyEQ'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.string.RegexpFullMatch'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.RegexpILike'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.RegexpLike'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.SimilarTo'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Sub'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Xor'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Alias'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.BitwiseNot'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.FormatPhrase'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.IgnoreNulls'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Neg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Not'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Paren'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.PivotAlias'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Pos'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.RespectNulls'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.TeradataNamed'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.TeradataTitle'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Unary'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.UnixMillis'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.DenseRank'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.core.ApproxDistinct'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.temporal.UnixMicros'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.array.ArraySize'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.Rank'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.RowNumber'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.CountIf'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.Ntile'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.functions.Int64'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.temporal.UnixSeconds'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.string.FromBase32'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.FromBase64'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.EndsWith'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.Exists'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.Contains'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Any'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.In'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.IsInf'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.StartsWith'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.All'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.aggregate.LogicalOr'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.IsNan'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Between'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.aggregate.LogicalAnd'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.IsArray'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Boolean'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.temporal.StrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.DateStrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.LastDay'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.DateFromParts'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.Date'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.CurrentDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.TimeStrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.TsOrDsToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.DiToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.Datetime'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.temporal.TsOrDsToDatetime'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.temporal.DatetimeSub'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.temporal.CurrentDatetime'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.temporal.DatetimeAdd'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.math.Pi'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.PercentRank'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Stddev'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Avg'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.CumeDist'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.PercentileCont'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.CovarPop'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Ln'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Asin'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cosh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.SafeDivide'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.string.ToDouble'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Atan'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.functions.Rand'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Tanh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.ApproxQuantile'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Sinh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.VariancePop'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Radians'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Quantile'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.StddevPop'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Exp'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Skewness'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.CovarSamp'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Log'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cbrt'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cot'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cos'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Acosh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Atanh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Asinh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Sin'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Sqrt'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Tan'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Acos'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Variance'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Round'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Kurtosis'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Degrees'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.StddevSamp'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.temporal.Hour'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.TimeDiff'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.TimestampDiff'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.UnixDate'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DayOfYear'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Length'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.math.Getbit'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DayOfWeek'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.TsOrDiToDi'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.math.Sign'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.BitLength'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DatetimeDiff'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Ascii'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Unicode'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Levenshtein'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DayOfMonth'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DateToDi'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.StrPosition'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.Quarter'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.datatypes.Interval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.MakeInterval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.JustifyInterval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.JustifyHours'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.JustifyDays'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.json.ParseJSON'>: {'returns': <DType.JSON: 'JSON'>}, <class 'sqlglot.expressions.temporal.TimeSub'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TimeAdd'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.Localtime'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.CurrentTime'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.Time'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TimestampLtzFromParts'>: {'returns': <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}, <class 'sqlglot.expressions.temporal.CurrentTimestampLTZ'>: {'returns': <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>}, <class 'sqlglot.expressions.temporal.TimestampTzFromParts'>: {'returns': <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>}, <class 'sqlglot.expressions.temporal.StrToTime'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.TimestampSub'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.TimestampAdd'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.TimeStrToTime'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.UnixToTime'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.CurrentTimestamp'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.Year'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Day'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.WeekOfYear'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Week'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.DayOfWeekIso'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.YearOfWeekIso'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.YearOfWeek'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Month'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.functions.CurrentSchema'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ToBase32'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.core.Typeof'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Upper'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Lower'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Trim'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Concat'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.UnixToTimeStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Repeat'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TsOrDsToDateStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.DateToDateStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TimeToTimeStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.query.RawString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.Monthname'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Space'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ToBase64'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ConcatWs'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentRole'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.Dayname'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Translate'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Chr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentPath'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SHA2'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.SessionUser'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Substring'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.array.ArrayToString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Initcap'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SHA'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentVersion'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.String'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.aggregate.GroupConcat'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentUser'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TimeToStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentCatalog'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.MD5'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ToChar'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.UnixToStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.ToVariant'>: {'returns': <DType.VARIANT: 'VARIANT'>}, <class 'sqlglot.expressions.math.Floor'>: {'annotator': <function annotate_by_numeric_arg>}, <class 'sqlglot.expressions.math.Ceil'>: {'annotator': <function annotate_by_numeric_arg>}, <class 'sqlglot.expressions.array.ArraySort'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.HavingMax'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Window'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArraySlice'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Filter'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.NthValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.Abs'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayReverse'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.ArrayConcatAgg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Order'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.FirstValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Limit'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.LastValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.AnyValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Least'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Coalesce'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayConcat'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Greatest'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.Min'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.Max'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayFirst'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayLast'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Anonymous'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.DateSub'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.DateTrunc'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.DateAdd'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.TeradataConversion'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.TryCast'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Cast'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.Map'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.VarMap'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.Array'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.ArrayAgg'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.Bracket'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.functions.Case'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.Count'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.DateDiff'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.datatypes.DataType'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.Distinct'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.Explode'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.Extract'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.query.HexString'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.GenerateSeries'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.GenerateDateArray'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.GenerateTimestampArray'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.functions.If'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.Lag'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.Lead'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.Literal'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.Null'>: {'returns': <DType.NULL: 'NULL'>}, <class 'sqlglot.expressions.functions.Nullif'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.Struct'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.Sum'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.Timestamp'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.ToMap'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.Unnest'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.core.WithinGroup'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.query.Subquery'>: {'annotator': <function <lambda>>}}