Edit on GitHub

sqlglot.typing.snowflake

  1from __future__ import annotations
  2
  3import typing as t
  4
  5from sqlglot import exp
  6from sqlglot.helper import seq_get
  7from sqlglot.typing import EXPRESSION_METADATA
  8
  9if t.TYPE_CHECKING:
 10    from sqlglot.optimizer.annotate_types import TypeAnnotator
 11
 12DATE_PARTS = {"DAY", "WEEK", "MONTH", "QUARTER", "YEAR"}
 13
 14MAX_PRECISION = 38
 15
 16MAX_SCALE = 37
 17
 18
 19def _annotate_reverse(self: TypeAnnotator, expression: exp.Reverse) -> exp.Reverse:
 20    expression = self._annotate_by_args(expression, "this")
 21    if expression.is_type(exp.DType.NULL):
 22        # Snowflake treats REVERSE(NULL) as a VARCHAR
 23        self._set_type(expression, exp.DType.VARCHAR)
 24
 25    return expression
 26
 27
 28def _annotate_timestamp_from_parts(
 29    self: TypeAnnotator, expression: exp.TimestampFromParts
 30) -> exp.TimestampFromParts:
 31    """Annotate TimestampFromParts with correct type based on arguments.
 32    TIMESTAMP_FROM_PARTS with time_zone -> TIMESTAMPTZ
 33    TIMESTAMP_FROM_PARTS without time_zone -> TIMESTAMP (defaults to TIMESTAMP_NTZ)
 34    """
 35    if expression.args.get("zone"):
 36        self._set_type(expression, exp.DType.TIMESTAMPTZ)
 37    else:
 38        self._set_type(expression, exp.DType.TIMESTAMP)
 39
 40    return expression
 41
 42
 43def _annotate_date_or_time_add(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr:
 44    if (
 45        expression.this.is_type(exp.DType.DATE)
 46        and expression.text("unit").upper() not in DATE_PARTS
 47    ):
 48        self._set_type(expression, exp.DType.TIMESTAMPNTZ)
 49    else:
 50        self._annotate_by_args(expression, "this")
 51    return expression
 52
 53
 54def _annotate_decode_case(self: TypeAnnotator, expression: exp.DecodeCase) -> exp.DecodeCase:
 55    """Annotate DecodeCase with the type inferred from return values only.
 56
 57    DECODE uses the format: DECODE(expr, val1, ret1, val2, ret2, ..., default)
 58    We only look at the return values (ret1, ret2, ..., default) to determine the type,
 59    not the comparison values (val1, val2, ...) or the expression being compared.
 60    """
 61    expressions = expression.expressions
 62
 63    # Return values are at indices 2, 4, 6, ... and the last element (if even length)
 64    # DECODE(expr, val1, ret1, val2, ret2, ..., default)
 65    return_types = [expressions[i].type for i in range(2, len(expressions), 2)]
 66
 67    # If the total number of expressions is even, the last one is the default
 68    # Example:
 69    #   DECODE(x, 1, 'a', 2, 'b')             -> len=5 (odd), no default
 70    #   DECODE(x, 1, 'a', 2, 'b', 'default')  -> len=6 (even), has default
 71    if len(expressions) % 2 == 0:
 72        return_types.append(expressions[-1].type)
 73
 74    # Determine the common type from all return values
 75    last_type = None
 76    for ret_type in return_types:
 77        last_type = self._maybe_coerce(last_type or ret_type, ret_type)
 78
 79    self._set_type(expression, last_type)
 80    return expression
 81
 82
 83def _annotate_arg_max_min(self, expression):
 84    self._set_type(
 85        expression,
 86        exp.DType.ARRAY if expression.args.get("count") else expression.this.type,
 87    )
 88    return expression
 89
 90
 91def _annotate_within_group(self: TypeAnnotator, expression: exp.WithinGroup) -> exp.WithinGroup:
 92    """Annotate WithinGroup with correct type based on the inner function.
 93
 94    1) Annotate args first
 95    2) Check if this is PercentileDisc/PercentileCont and if so, re-annotate its type to match the ordered expression's type
 96    """
 97
 98    if (
 99        isinstance(expression.this, (exp.PercentileDisc, exp.PercentileCont))
100        and isinstance(order_expr := expression.expression, exp.Order)
101        and len(order_expr.expressions) == 1
102        and isinstance(ordered_expr := order_expr.expressions[0], exp.Ordered)
103    ):
104        self._set_type(expression, ordered_expr.this.type)
105    else:
106        self._set_type(expression, expression.this.type)
107
108    return expression
109
110
111def _annotate_median(self: TypeAnnotator, expression: exp.Median) -> exp.Median:
112    """Annotate MEDIAN function with correct return type.
113
114    Based on Snowflake documentation:
115    - If the expr is FLOAT/DOUBLE -> annotate as DOUBLE (FLOAT is a synonym for DOUBLE)
116    - If the expr is NUMBER(p, s) -> annotate as NUMBER(min(p+3, 38), min(s+3, 37))
117    """
118    # First annotate the argument to get its type
119    expression = self._annotate_by_args(expression, "this")
120
121    # Get the input type
122    input_type = expression.this.type
123
124    if input_type.is_type(exp.DType.DOUBLE):
125        # If input is FLOAT/DOUBLE, return DOUBLE (FLOAT is normalized to DOUBLE in Snowflake)
126        self._set_type(expression, exp.DType.DOUBLE)
127    else:
128        # If input is NUMBER(p, s), return NUMBER(min(p+3, 38), min(s+3, 37))
129        exprs = input_type.expressions
130
131        precision_expr = seq_get(exprs, 0)
132        precision = precision_expr.this.to_py() if precision_expr else MAX_PRECISION
133
134        scale_expr = seq_get(exprs, 1)
135        scale = scale_expr.this.to_py() if scale_expr else 0
136
137        new_precision = min(precision + 3, MAX_PRECISION)
138        new_scale = min(scale + 3, MAX_SCALE)
139
140        # Build the new NUMBER type
141        new_type = exp.DataType.build(f"NUMBER({new_precision}, {new_scale})", dialect="snowflake")
142        self._set_type(expression, new_type)
143
144    return expression
145
146
147def _annotate_variance(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr:
148    """Annotate variance functions (VAR_POP, VAR_SAMP, VARIANCE, VARIANCE_POP) with correct return type.
149
150    Based on Snowflake behavior:
151    - DECFLOAT -> DECFLOAT(38)
152    - FLOAT/DOUBLE -> FLOAT
153    - INT, NUMBER(p, 0) -> NUMBER(38, 6)
154    - NUMBER(p, s) -> NUMBER(38, max(12, s))
155    """
156    # First annotate the argument to get its type
157    expression = self._annotate_by_args(expression, "this")
158
159    # Get the input type
160    input_type = expression.this.type
161
162    # Special case: DECFLOAT -> DECFLOAT(38)
163    if input_type.is_type(exp.DType.DECFLOAT):
164        self._set_type(expression, exp.DataType.build("DECFLOAT", dialect="snowflake"))
165    # Special case: FLOAT/DOUBLE -> DOUBLE
166    elif input_type.is_type(exp.DType.FLOAT, exp.DType.DOUBLE):
167        self._set_type(expression, exp.DType.DOUBLE)
168    # For NUMBER types: determine the scale
169    else:
170        exprs = input_type.expressions
171        scale_expr = seq_get(exprs, 1)
172        scale = scale_expr.this.to_py() if scale_expr else 0
173
174        # If scale is 0 (INT, BIGINT, NUMBER(p,0)): return NUMBER(38, 6)
175        # Otherwise, Snowflake appears to assign scale through the formula MAX(12, s)
176        new_scale = 6 if scale == 0 else max(12, scale)
177
178        # Build the new NUMBER type
179        new_type = exp.DataType.build(f"NUMBER({MAX_PRECISION}, {new_scale})", dialect="snowflake")
180        self._set_type(expression, new_type)
181
182    return expression
183
184
185def _annotate_kurtosis(self: TypeAnnotator, expression: exp.Kurtosis) -> exp.Kurtosis:
186    """Annotate KURTOSIS with correct return type.
187
188    Based on Snowflake behavior:
189    - DECFLOAT input -> DECFLOAT
190    - DOUBLE or FLOAT input -> DOUBLE
191    - Other numeric types (INT, NUMBER) -> NUMBER(38, 12)
192    """
193    expression = self._annotate_by_args(expression, "this")
194    input_type = expression.this.type
195
196    if input_type.is_type(exp.DType.DECFLOAT):
197        self._set_type(expression, exp.DataType.build("DECFLOAT", dialect="snowflake"))
198    elif input_type.is_type(exp.DType.FLOAT, exp.DType.DOUBLE):
199        self._set_type(expression, exp.DType.DOUBLE)
200    else:
201        self._set_type(
202            expression, exp.DataType.build(f"NUMBER({MAX_PRECISION}, 12)", dialect="snowflake")
203        )
204
205    return expression
206
207
208def _annotate_math_with_float_decfloat(self: TypeAnnotator, expression: exp.Expr) -> exp.Expr:
209    """Annotate math functions that preserve  DECFLOAT but return DOUBLE for others.
210
211    In Snowflake, trigonometric and exponential math functions:
212    - If input is DECFLOAT -> return DECFLOAT
213    - For integer types (INT, BIGINT, etc.) -> return DOUBLE
214    - For other numeric types (NUMBER, DECIMAL, DOUBLE) -> return DOUBLE
215    """
216    expression = self._annotate_by_args(expression, "this")
217
218    # If input is DECFLOAT, preserve
219    if expression.this.is_type(exp.DType.DECFLOAT):
220        self._set_type(expression, expression.this.type)
221    else:
222        # For all other types (integers, decimals, etc.), return DOUBLE
223        self._set_type(expression, exp.DType.DOUBLE)
224
225    return expression
226
227
228def _annotate_str_to_time(self: TypeAnnotator, expression: exp.StrToTime) -> exp.StrToTime:
229    # target_type is stored as a DataType instance
230    target_type_arg = expression.args.get("target_type")
231    target_type = (
232        target_type_arg.this if isinstance(target_type_arg, exp.DataType) else exp.DType.TIMESTAMP
233    )
234    self._set_type(expression, target_type)
235    return expression
236
237
238EXPRESSION_METADATA = {
239    **EXPRESSION_METADATA,
240    **{
241        expr_type: {"annotator": lambda self, e: self._annotate_by_args(e, "this")}
242        for expr_type in {
243            exp.AddMonths,
244            exp.Ceil,
245            exp.DateTrunc,
246            exp.Floor,
247            exp.Left,
248            exp.Mode,
249            exp.Pad,
250            exp.Right,
251            exp.Round,
252            exp.Stuff,
253            exp.Substring,
254            exp.TimeSlice,
255            exp.TimestampTrunc,
256        }
257    },
258    **{
259        expr_type: {"returns": exp.DType.ARRAY}
260        for expr_type in (
261            exp.ApproxTopK,
262            exp.ApproxTopKEstimate,
263            exp.Array,
264            exp.ArrayAgg,
265            exp.ArrayAppend,
266            exp.ArrayCompact,
267            exp.ArrayConcat,
268            exp.ArrayConstructCompact,
269            exp.ArrayPrepend,
270            exp.ArrayRemove,
271            exp.ArraysZip,
272            exp.ArrayUniqueAgg,
273            exp.ArrayUnionAgg,
274            exp.MapKeys,
275            exp.RegexpExtractAll,
276            exp.Split,
277            exp.StringToArray,
278        )
279    },
280    **{
281        expr_type: {"returns": exp.DType.BIGINT}
282        for expr_type in {
283            exp.BitmapBitPosition,
284            exp.BitmapBucketNumber,
285            exp.BitmapCount,
286            exp.Factorial,
287            exp.GroupingId,
288            exp.MD5NumberLower64,
289            exp.MD5NumberUpper64,
290            exp.Rand,
291            exp.Seq8,
292            exp.Zipf,
293        }
294    },
295    **{
296        expr_type: {"returns": exp.DType.BINARY}
297        for expr_type in {
298            exp.Base64DecodeBinary,
299            exp.BitmapConstructAgg,
300            exp.BitmapOrAgg,
301            exp.Compress,
302            exp.DecompressBinary,
303            exp.Decrypt,
304            exp.DecryptRaw,
305            exp.Encrypt,
306            exp.EncryptRaw,
307            exp.HexString,
308            exp.MD5Digest,
309            exp.SHA1Digest,
310            exp.SHA2Digest,
311            exp.ToBinary,
312            exp.TryBase64DecodeBinary,
313            exp.TryHexDecodeBinary,
314            exp.Unhex,
315        }
316    },
317    **{
318        expr_type: {"returns": exp.DType.BOOLEAN}
319        for expr_type in {
320            exp.Booland,
321            exp.Boolnot,
322            exp.Boolor,
323            exp.BoolxorAgg,
324            exp.EqualNull,
325            exp.IsNullValue,
326            exp.MapContainsKey,
327            exp.Search,
328            exp.SearchIp,
329            exp.ToBoolean,
330        }
331    },
332    **{
333        expr_type: {"returns": exp.DType.DATE}
334        for expr_type in {
335            exp.NextDay,
336            exp.PreviousDay,
337        }
338    },
339    **{
340        expr_type: {
341            "annotator": lambda self, e: self._set_type(
342                e, exp.DataType.build("NUMBER", dialect="snowflake")
343            )
344        }
345        for expr_type in (
346            exp.BitwiseAndAgg,
347            exp.BitwiseOrAgg,
348            exp.BitwiseXorAgg,
349            exp.RegexpCount,
350            exp.RegexpInstr,
351            exp.ToNumber,
352        )
353    },
354    **{
355        expr_type: {"returns": exp.DType.DOUBLE}
356        for expr_type in {
357            exp.ApproxPercentileEstimate,
358            exp.ApproximateSimilarity,
359            exp.CosineDistance,
360            exp.CovarPop,
361            exp.CovarSamp,
362            exp.DotProduct,
363            exp.EuclideanDistance,
364            exp.ManhattanDistance,
365            exp.MonthsBetween,
366            exp.Normal,
367        }
368    },
369    exp.Kurtosis: {"annotator": _annotate_kurtosis},
370    **{
371        expr_type: {"returns": exp.DType.DECFLOAT}
372        for expr_type in {
373            exp.ToDecfloat,
374            exp.TryToDecfloat,
375        }
376    },
377    **{
378        expr_type: {"annotator": _annotate_math_with_float_decfloat}
379        for expr_type in {
380            exp.Acos,
381            exp.Asin,
382            exp.Atan,
383            exp.Atan2,
384            exp.Cbrt,
385            exp.Cos,
386            exp.Cot,
387            exp.Degrees,
388            exp.Exp,
389            exp.Ln,
390            exp.Log,
391            exp.Pow,
392            exp.Radians,
393            exp.RegrAvgx,
394            exp.RegrAvgy,
395            exp.RegrCount,
396            exp.RegrIntercept,
397            exp.RegrR2,
398            exp.RegrSlope,
399            exp.RegrSxx,
400            exp.RegrSxy,
401            exp.RegrSyy,
402            exp.RegrValx,
403            exp.RegrValy,
404            exp.Sin,
405            exp.Sqrt,
406            exp.Tan,
407            exp.Tanh,
408        }
409    },
410    **{
411        expr_type: {"returns": exp.DType.INT}
412        for expr_type in {
413            exp.ByteLength,
414            exp.Grouping,
415            exp.JarowinklerSimilarity,
416            exp.MapSize,
417            exp.Minute,
418            exp.RtrimmedLength,
419            exp.Second,
420            exp.Seq1,
421            exp.Seq2,
422            exp.Seq4,
423            exp.WidthBucket,
424        }
425    },
426    **{
427        expr_type: {"returns": exp.DType.OBJECT}
428        for expr_type in {
429            exp.ApproxPercentileAccumulate,
430            exp.ApproxPercentileCombine,
431            exp.ApproxTopKAccumulate,
432            exp.ApproxTopKCombine,
433            exp.ObjectAgg,
434            exp.ParseIp,
435            exp.ParseUrl,
436            exp.XMLGet,
437        }
438    },
439    **{
440        expr_type: {"returns": exp.DType.MAP}
441        for expr_type in {
442            exp.MapCat,
443            exp.MapDelete,
444            exp.MapInsert,
445            exp.MapPick,
446        }
447    },
448    **{
449        expr_type: {"returns": exp.DType.FILE}
450        for expr_type in {
451            exp.ToFile,
452        }
453    },
454    **{
455        expr_type: {"returns": exp.DType.TIME}
456        for expr_type in {
457            exp.TimeFromParts,
458            exp.TsOrDsToTime,
459        }
460    },
461    **{
462        expr_type: {"returns": exp.DType.TIMESTAMPLTZ}
463        for expr_type in {
464            exp.CurrentTimestamp,
465            exp.Localtimestamp,
466        }
467    },
468    **{
469        expr_type: {"returns": exp.DType.TINYINT}
470        for expr_type in {
471            exp.DayOfMonth,
472            exp.DayOfWeek,
473            exp.DayOfYear,
474            exp.Quarter,
475        }
476    },
477    **{
478        expr_type: {"returns": exp.DType.VARCHAR}
479        for expr_type in {
480            exp.AIAgg,
481            exp.AIClassify,
482            exp.AISummarizeAgg,
483            exp.Base64DecodeString,
484            exp.Base64Encode,
485            exp.CheckJson,
486            exp.CheckXml,
487            exp.Collate,
488            exp.Collation,
489            exp.CurrentAccount,
490            exp.CurrentAccountName,
491            exp.CurrentAvailableRoles,
492            exp.CurrentClient,
493            exp.CurrentDatabase,
494            exp.CurrentIpAddress,
495            exp.CurrentSchemas,
496            exp.CurrentSecondaryRoles,
497            exp.CurrentSession,
498            exp.CurrentStatement,
499            exp.CurrentTransaction,
500            exp.CurrentWarehouse,
501            exp.CurrentOrganizationUser,
502            exp.CurrentRegion,
503            exp.CurrentRole,
504            exp.CurrentRoleType,
505            exp.CurrentOrganizationName,
506            exp.DecompressString,
507            exp.HexDecodeString,
508            exp.HexEncode,
509            exp.Randstr,
510            exp.RegexpExtract,
511            exp.RegexpReplace,
512            exp.Repeat,
513            exp.Replace,
514            exp.Soundex,
515            exp.SoundexP123,
516            exp.SplitPart,
517            exp.Strtok,
518            exp.TryBase64DecodeString,
519            exp.TryHexDecodeString,
520            exp.Uuid,
521        }
522    },
523    **{
524        expr_type: {"returns": exp.DType.VARIANT}
525        for expr_type in {
526            exp.Minhash,
527            exp.MinhashCombine,
528        }
529    },
530    **{
531        expr_type: {"annotator": _annotate_variance}
532        for expr_type in (
533            exp.Variance,
534            exp.VariancePop,
535        )
536    },
537    exp.ArgMax: {"annotator": _annotate_arg_max_min},
538    exp.ArgMin: {"annotator": _annotate_arg_max_min},
539    exp.ConcatWs: {"annotator": lambda self, e: self._annotate_by_args(e, "expressions")},
540    exp.ConvertTimezone: {
541        "annotator": lambda self, e: self._set_type(
542            e,
543            exp.DType.TIMESTAMPNTZ if e.args.get("source_tz") else exp.DType.TIMESTAMPTZ,
544        )
545    },
546    exp.DateAdd: {"annotator": _annotate_date_or_time_add},
547    exp.DecodeCase: {"annotator": _annotate_decode_case},
548    exp.HashAgg: {
549        "annotator": lambda self, e: self._set_type(
550            e, exp.DataType.build("NUMBER(19, 0)", dialect="snowflake")
551        )
552    },
553    exp.Median: {"annotator": _annotate_median},
554    exp.Reverse: {"annotator": _annotate_reverse},
555    exp.StrToTime: {"annotator": _annotate_str_to_time},
556    exp.TimeAdd: {"annotator": _annotate_date_or_time_add},
557    exp.TimestampFromParts: {"annotator": _annotate_timestamp_from_parts},
558    exp.WithinGroup: {"annotator": _annotate_within_group},
559}
DATE_PARTS = {'MONTH', 'WEEK', 'DAY', 'QUARTER', 'YEAR'}
MAX_PRECISION = 38
MAX_SCALE = 37
EXPRESSION_METADATA = {<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.ArrayContains'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <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'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <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.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.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.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'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <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'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <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.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.Unary'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.CountIf'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.temporal.UnixSeconds'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.array.ArraySize'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.functions.Int64'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.temporal.UnixMillis'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.temporal.UnixMicros'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.core.ApproxDistinct'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.string.FromBase64'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.FromBase32'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.math.IsInf'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.aggregate.LogicalOr'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Between'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Any'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.aggregate.LogicalAnd'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.All'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.EndsWith'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.Contains'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.Exists'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.IsNan'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.In'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.StartsWith'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.core.Boolean'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.temporal.DateStrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.CurrentDate'>: {'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.TimeStrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.Date'>: {'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.StrToDate'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.DatetimeAdd'>: {'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.Datetime'>: {'returns': <DType.DATETIME: 'DATETIME'>}, <class 'sqlglot.expressions.math.Tanh'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.VariancePop'>: {'annotator': <function _annotate_variance>}, <class 'sqlglot.expressions.math.Exp'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.functions.Rand'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.math.Pi'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Sinh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cbrt'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Ln'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Cos'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.StddevPop'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.string.ToDouble'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Quantile'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Radians'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Atanh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Skewness'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Avg'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Asinh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Cosh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Acosh'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Sqrt'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.SafeDivide'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Round'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.Tan'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.Kurtosis'>: {'annotator': <function _annotate_kurtosis>}, <class 'sqlglot.expressions.aggregate.Variance'>: {'annotator': <function _annotate_variance>}, <class 'sqlglot.expressions.math.Log'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Sin'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.StddevSamp'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.ApproxQuantile'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.Stddev'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.Degrees'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Atan'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Cot'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Asin'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Acos'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Sign'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.BitLength'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DayOfMonth'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.string.StrPosition'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DateToDi'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Length'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.Quarter'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.math.Getbit'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.UnixDate'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.Hour'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.math.Ceil'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.DayOfYear'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.TsOrDiToDi'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.DayOfWeek'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.string.Ascii'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Levenshtein'>: {'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.DatetimeDiff'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.Unicode'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.JustifyInterval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.JustifyHours'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.datatypes.Interval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.JustifyDays'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.temporal.MakeInterval'>: {'returns': <DType.INTERVAL: 'INTERVAL'>}, <class 'sqlglot.expressions.json.ParseJSON'>: {'returns': <DType.JSON: 'JSON'>}, <class 'sqlglot.expressions.temporal.CurrentTime'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TimeAdd'>: {'annotator': <function _annotate_date_or_time_add>}, <class 'sqlglot.expressions.temporal.Time'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TimeSub'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.Localtime'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TimestampLtzFromParts'>: {'returns': <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}, <class 'sqlglot.expressions.temporal.TimestampTzFromParts'>: {'returns': <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>}, <class 'sqlglot.expressions.temporal.CurrentTimestampLTZ'>: {'returns': <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>}, <class 'sqlglot.expressions.temporal.CurrentTimestamp'>: {'returns': <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}, <class 'sqlglot.expressions.temporal.TimeStrToTime'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.UnixToTime'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.StrToTime'>: {'annotator': <function _annotate_str_to_time>}, <class 'sqlglot.expressions.temporal.TimestampAdd'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.TimestampSub'>: {'returns': <DType.TIMESTAMP: 'TIMESTAMP'>}, <class 'sqlglot.expressions.temporal.DayOfWeekIso'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.YearOfWeekIso'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Month'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.YearOfWeek'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Year'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.WeekOfYear'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Day'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.temporal.Week'>: {'returns': <DType.TINYINT: 'TINYINT'>}, <class 'sqlglot.expressions.functions.CurrentVersion'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentCatalog'>: {'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.temporal.Dayname'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.query.RawString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Substring'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.String'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Lower'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TimeToStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Space'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.array.ArrayToString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.UnixToStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ToBase32'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Upper'>: {'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.functions.CurrentUser'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.UnixToTimeStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.aggregate.GroupConcat'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TsOrDsToDateStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SHA2'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.TimeToTimeStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentSchema'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.DateToDateStr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SHA'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Initcap'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ToBase64'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.temporal.Monthname'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.MD5'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.SessionUser'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.ConcatWs'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.array.ArraySlice'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Order'>: {'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.aggregate.LastValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Filter'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.Abs'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Window'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.query.Limit'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.AnyValue'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.HavingMax'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.SortArray'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayConcat'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.aggregate.Min'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Least'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Greatest'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Coalesce'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.Max'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayLast'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.array.ArrayFirst'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.core.Anonymous'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.temporal.DateAdd'>: {'annotator': <function _annotate_date_or_time_add>}, <class 'sqlglot.expressions.temporal.DateSub'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.DateTrunc'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.Cast'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.functions.TryCast'>: {'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'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.aggregate.ArrayAgg'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <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'>: {'returns': <DType.BINARY: 'BINARY'>}, <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.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.query.Subquery'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.string.Left'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.Pad'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.TimeSlice'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.TimestampTrunc'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.Stuff'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.Mode'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.Right'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.temporal.AddMonths'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.Floor'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.ApproxTopK'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.aggregate.ApproxTopKEstimate'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArrayAppend'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArrayCompact'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArrayConstructCompact'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArrayPrepend'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArrayRemove'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.ArraysZip'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.aggregate.ArrayUniqueAgg'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.aggregate.ArrayUnionAgg'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.MapKeys'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.string.RegexpExtractAll'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.string.Split'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.array.StringToArray'>: {'returns': <DType.ARRAY: 'ARRAY'>}, <class 'sqlglot.expressions.math.BitmapBitPosition'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.math.Factorial'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.string.MD5NumberUpper64'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.functions.Seq8'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.string.MD5NumberLower64'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.aggregate.GroupingId'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.math.BitmapCount'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.functions.Zipf'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.math.BitmapBucketNumber'>: {'returns': <DType.BIGINT: 'BIGINT'>}, <class 'sqlglot.expressions.string.Encrypt'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.SHA1Digest'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.TryHexDecodeBinary'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.ToBinary'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.DecompressBinary'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.TryBase64DecodeBinary'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.DecryptRaw'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.MD5Digest'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.math.BitmapOrAgg'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.Base64DecodeBinary'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.Decrypt'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.Compress'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.SHA2Digest'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.math.BitmapConstructAgg'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.Unhex'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.string.EncryptRaw'>: {'returns': <DType.BINARY: 'BINARY'>}, <class 'sqlglot.expressions.math.BoolxorAgg'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.Boolor'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.Boolnot'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.IsNullValue'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.SearchIp'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.math.Booland'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.array.MapContainsKey'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.EqualNull'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.functions.ToBoolean'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.string.Search'>: {'returns': <DType.BOOLEAN: 'BOOLEAN'>}, <class 'sqlglot.expressions.temporal.NextDay'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.temporal.PreviousDay'>: {'returns': <DType.DATE: 'DATE'>}, <class 'sqlglot.expressions.math.BitwiseAndAgg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.BitwiseOrAgg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.math.BitwiseXorAgg'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.RegexpCount'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.RegexpInstr'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.string.ToNumber'>: {'annotator': <function <dictcomp>.<lambda>>}, <class 'sqlglot.expressions.aggregate.CovarPop'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.DotProduct'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.CosineDistance'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.temporal.MonthsBetween'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.ApproxPercentileEstimate'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.functions.Normal'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.ManhattanDistance'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.ApproximateSimilarity'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.aggregate.CovarSamp'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.math.EuclideanDistance'>: {'returns': <DType.DOUBLE: 'DOUBLE'>}, <class 'sqlglot.expressions.string.TryToDecfloat'>: {'returns': <DType.DECFLOAT: 'DECFLOAT'>}, <class 'sqlglot.expressions.string.ToDecfloat'>: {'returns': <DType.DECFLOAT: 'DECFLOAT'>}, <class 'sqlglot.expressions.aggregate.RegrIntercept'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrAvgy'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrValy'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrSyy'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrSxx'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrR2'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrCount'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrAvgx'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.math.Atan2'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrValx'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrSxy'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.aggregate.RegrSlope'>: {'annotator': <function _annotate_math_with_float_decfloat>}, <class 'sqlglot.expressions.string.ByteLength'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.string.RtrimmedLength'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.Second'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.functions.Seq4'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.functions.Seq2'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.functions.WidthBucket'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.functions.Seq1'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.temporal.Minute'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.math.JarowinklerSimilarity'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.array.MapSize'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.aggregate.Grouping'>: {'returns': <DType.INT: 'INT'>}, <class 'sqlglot.expressions.aggregate.ApproxTopKAccumulate'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.string.ParseUrl'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.functions.XMLGet'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.aggregate.ObjectAgg'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.aggregate.ApproxPercentileCombine'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.aggregate.ApproxPercentileAccumulate'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.functions.ParseIp'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.aggregate.ApproxTopKCombine'>: {'returns': <DType.OBJECT: 'OBJECT'>}, <class 'sqlglot.expressions.array.MapInsert'>: {'returns': <DType.MAP: 'MAP'>}, <class 'sqlglot.expressions.array.MapDelete'>: {'returns': <DType.MAP: 'MAP'>}, <class 'sqlglot.expressions.array.MapPick'>: {'returns': <DType.MAP: 'MAP'>}, <class 'sqlglot.expressions.array.MapCat'>: {'returns': <DType.MAP: 'MAP'>}, <class 'sqlglot.expressions.string.ToFile'>: {'returns': <DType.FILE: 'FILE'>}, <class 'sqlglot.expressions.temporal.TimeFromParts'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.TsOrDsToTime'>: {'returns': <DType.TIME: 'TIME'>}, <class 'sqlglot.expressions.temporal.Localtimestamp'>: {'returns': <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>}, <class 'sqlglot.expressions.functions.Randstr'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Repeat'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.TryHexDecodeString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.Uuid'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentTransaction'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentAccountName'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.TryBase64DecodeString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentSession'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentSchemas'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.RegexpExtract'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Strtok'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentRole'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Soundex'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Base64DecodeString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentOrganizationUser'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.AIClassify'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentIpAddress'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentWarehouse'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentClient'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.HexDecodeString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.aggregate.AIAgg'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentAvailableRoles'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.DecompressString'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.RegexpReplace'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.json.CheckJson'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentAccount'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentStatement'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Replace'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentSecondaryRoles'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.Collation'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentRoleType'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SoundexP123'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.SplitPart'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.Base64Encode'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentRegion'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.string.HexEncode'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentOrganizationName'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CurrentDatabase'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.functions.CheckXml'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.aggregate.AISummarizeAgg'>: {'returns': <DType.VARCHAR: 'VARCHAR'>}, <class 'sqlglot.expressions.aggregate.MinhashCombine'>: {'returns': <DType.VARIANT: 'VARIANT'>}, <class 'sqlglot.expressions.aggregate.Minhash'>: {'returns': <DType.VARIANT: 'VARIANT'>}, <class 'sqlglot.expressions.aggregate.ArgMax'>: {'annotator': <function _annotate_arg_max_min>}, <class 'sqlglot.expressions.aggregate.ArgMin'>: {'annotator': <function _annotate_arg_max_min>}, <class 'sqlglot.expressions.temporal.ConvertTimezone'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.functions.DecodeCase'>: {'annotator': <function _annotate_decode_case>}, <class 'sqlglot.expressions.core.HashAgg'>: {'annotator': <function <lambda>>}, <class 'sqlglot.expressions.aggregate.Median'>: {'annotator': <function _annotate_median>}, <class 'sqlglot.expressions.string.Reverse'>: {'annotator': <function _annotate_reverse>}, <class 'sqlglot.expressions.temporal.TimestampFromParts'>: {'annotator': <function _annotate_timestamp_from_parts>}, <class 'sqlglot.expressions.core.WithinGroup'>: {'annotator': <function _annotate_within_group>}}