Edit on GitHub

sqlglot.generators.spark

  1from __future__ import annotations
  2
  3from sqlglot import exp
  4from sqlglot import generator
  5from sqlglot.dialects.dialect import (
  6    array_append_sql,
  7    rename_func,
  8    unit_to_var,
  9    timestampdiff_sql,
 10    date_delta_to_binary_interval_op,
 11    groupconcat_sql,
 12)
 13from sqlglot.generators.spark2 import Spark2Generator, temporary_storage_provider
 14from sqlglot.helper import seq_get
 15from sqlglot.transforms import (
 16    ctas_with_tmp_tables_to_create_tmp_view,
 17    remove_unique_constraints,
 18    preprocess,
 19    move_partitioned_by_to_schema_columns,
 20)
 21
 22
 23def _normalize_partition(e: exp.Expr) -> exp.Expr:
 24    """Normalize the expressions in PARTITION BY (<expression>, <expression>, ...)"""
 25    if isinstance(e, str):
 26        return exp.to_identifier(e)
 27    if isinstance(e, exp.Literal):
 28        return exp.to_identifier(e.name)
 29    return e
 30
 31
 32def _dateadd_sql(self: SparkGenerator, expression: exp.TsOrDsAdd | exp.TimestampAdd) -> str:
 33    if not expression.unit or (
 34        isinstance(expression, exp.TsOrDsAdd) and expression.text("unit").upper() == "DAY"
 35    ):
 36        # Coming from Hive/Spark2 DATE_ADD or roundtripping the 2-arg version of Spark3/DB
 37        return self.func("DATE_ADD", expression.this, expression.expression)
 38
 39    this = self.func(
 40        "DATE_ADD",
 41        unit_to_var(expression),
 42        expression.expression,
 43        expression.this,
 44    )
 45
 46    if isinstance(expression, exp.TsOrDsAdd):
 47        # The 3 arg version of DATE_ADD produces a timestamp in Spark3/DB but possibly not
 48        # in other dialects
 49        return_type = expression.return_type
 50        if not return_type.is_type(exp.DType.TIMESTAMP, exp.DType.DATETIME):
 51            this = f"CAST({this} AS {return_type})"
 52
 53    return this
 54
 55
 56class SparkGenerator(Spark2Generator):
 57    SUPPORTS_TO_NUMBER = True
 58    PAD_FILL_PATTERN_IS_REQUIRED = False
 59    SUPPORTS_CONVERT_TIMEZONE = True
 60    SUPPORTS_MEDIAN = True
 61    SUPPORTS_UNIX_SECONDS = True
 62    MERGE_SCHEMA_EVOLUTION_MIN_VERSION = (4, 0)
 63    ORDERED_PERCENTILE_MIN_VERSIONS = dict.fromkeys(exp.PERCENTILES, (3, 3))
 64    LISTAGG_MIN_VERSION = (4, 0)
 65    SUPPORTS_DECODE_CASE = True
 66    SET_ASSIGNMENT_REQUIRES_VARIABLE_KEYWORD = True
 67
 68    TYPE_MAPPING = {
 69        **Spark2Generator.TYPE_MAPPING,
 70        exp.DType.MONEY: "DECIMAL",
 71        exp.DType.SMALLMONEY: "DECIMAL",
 72        exp.DType.UUID: "STRING",
 73        exp.DType.TIMESTAMPLTZ: "TIMESTAMP_LTZ",
 74        exp.DType.TIMESTAMPNTZ: "TIMESTAMP_NTZ",
 75    }
 76
 77    TYPE_PARAM_SETTINGS = {
 78        **Spark2Generator.TYPE_PARAM_SETTINGS,
 79        exp.DType.MONEY: ((15, 4), ()),
 80        exp.DType.SMALLMONEY: ((6, 4), ()),
 81    }
 82
 83    TRANSFORMS = {
 84        k: v
 85        for k, v in {
 86            **Spark2Generator.TRANSFORMS,
 87            exp.ArrayConstructCompact: lambda self, e: self.func(
 88                "ARRAY_COMPACT", self.func("ARRAY", *e.expressions)
 89            ),
 90            exp.ArrayAppend: array_append_sql("ARRAY_APPEND"),
 91            exp.ArrayPrepend: array_append_sql("ARRAY_PREPEND"),
 92            exp.BitwiseAndAgg: rename_func("BIT_AND"),
 93            exp.BitwiseOrAgg: rename_func("BIT_OR"),
 94            exp.BitwiseXorAgg: rename_func("BIT_XOR"),
 95            exp.BitwiseCount: rename_func("BIT_COUNT"),
 96            exp.Create: preprocess(
 97                [
 98                    remove_unique_constraints,
 99                    lambda e: ctas_with_tmp_tables_to_create_tmp_view(
100                        e, temporary_storage_provider
101                    ),
102                    move_partitioned_by_to_schema_columns,
103                ]
104            ),
105            exp.CurrentVersion: rename_func("VERSION"),
106            exp.DateFromUnixDate: rename_func("DATE_FROM_UNIX_DATE"),
107            exp.DatetimeAdd: date_delta_to_binary_interval_op(cast=False),
108            exp.DatetimeSub: date_delta_to_binary_interval_op(cast=False),
109            exp.EndsWith: rename_func("ENDSWITH"),
110            exp.JSONKeys: rename_func("JSON_OBJECT_KEYS"),
111            exp.PartitionedByProperty: lambda self, e: (
112                f"PARTITIONED BY {self.wrap(self.expressions(sqls=[_normalize_partition(e) for e in e.this.expressions], skip_first=True))}"
113            ),
114            exp.SafeAdd: rename_func("TRY_ADD"),
115            exp.SafeDivide: rename_func("TRY_DIVIDE"),
116            exp.SafeMultiply: rename_func("TRY_MULTIPLY"),
117            exp.SafeSubtract: rename_func("TRY_SUBTRACT"),
118            exp.StartsWith: rename_func("STARTSWITH"),
119            exp.StabilityProperty: lambda self, e: (
120                "DETERMINISTIC" if e.name == "IMMUTABLE" else "NOT DETERMINISTIC"
121            ),
122            exp.TimeAdd: date_delta_to_binary_interval_op(cast=False),
123            exp.TimeSub: date_delta_to_binary_interval_op(cast=False),
124            exp.TsOrDsAdd: _dateadd_sql,
125            exp.TimestampAdd: _dateadd_sql,
126            exp.TimestampFromParts: rename_func("MAKE_TIMESTAMP"),
127            exp.TimestampSub: date_delta_to_binary_interval_op(cast=False),
128            exp.DatetimeDiff: timestampdiff_sql,
129            exp.TimestampDiff: timestampdiff_sql,
130            exp.TryCast: lambda self, e: (
131                self.trycast_sql(e) if e.args.get("safe") else self.cast_sql(e)
132            ),
133            exp.AnyValue: None,
134            exp.DateDiff: None,
135            exp.With: None,
136        }.items()
137        if v is not None
138    }
139
140    def dateadd_sql(self, expression: exp.DateAdd | exp.DateSub) -> str:
141        if expression.text("unit").upper() in (
142            "HOUR",
143            "MINUTE",
144            "SECOND",
145            "MILLISECOND",
146            "MICROSECOND",
147        ):
148            amount = expression.expression
149            return self.func(
150                "TIMESTAMPADD",
151                unit_to_var(expression),
152                -amount if isinstance(expression, exp.DateSub) else amount,
153                expression.this,
154            )
155
156        return super().dateadd_sql(expression)
157
158    def ignorenulls_sql(self, expression: exp.IgnoreNulls) -> str:
159        return generator.Generator.ignorenulls_sql(self, expression)
160
161    def groupconcat_sql(self, expression: exp.GroupConcat) -> str:
162        if self.dialect.version >= self.LISTAGG_MIN_VERSION:
163            return groupconcat_sql(self, expression)
164
165        this = expression.this
166        if isinstance(this, exp.Limit) or (
167            isinstance(expression.parent, (exp.Filter, exp.Window)) and expression.arg_key == "this"
168        ):
169            self.unsupported("Cannot emulate LISTAGG with LIMIT, FILTER or OVER")
170            return groupconcat_sql(self, expression)
171
172        if isinstance(this, exp.Order):
173            if len(this.expressions) != 1 or isinstance(this.this, exp.Distinct):
174                self.unsupported(
175                    "Cannot emulate ordered LISTAGG with multiple sort keys or DISTINCT"
176                )
177                return groupconcat_sql(self, expression)
178
179            value, key = this.this, this.expressions[0]
180            asc = not key.args.get("desc")
181            fields = [exp.alias_(key.this, "sort_key"), exp.alias_(value, "value")]
182            if bool(key.args.get("nulls_first")) != asc:
183                # SORT_ARRAY treats NULL as the smallest key within a struct.
184                fields.insert(0, key.this.is_(exp.null()))
185            row = exp.If(
186                this=value.is_(exp.null()), true=exp.null(), false=exp.Struct(expressions=fields)
187            )
188            values: exp.Expr = exp.Dot(
189                this=exp.func("SORT_ARRAY", exp.ArrayAgg(this=row), exp.convert(asc)),
190                expression=exp.to_identifier("value"),
191            )
192        else:
193            values = exp.ArrayAgg(this=this)
194
195        if not expression.args.get("empty_string_on_empty"):
196            values = exp.Nullif(this=values, expression=exp.array())
197
198        separator = expression.args.get("separator") or exp.Literal.string(",")
199        if expression.args.get("null_separator_is_empty") and not separator.is_string:
200            separator = exp.Coalesce(this=separator, expressions=[exp.Literal.string("")])
201        return self.func("ARRAY_JOIN", values, separator)
202
203    def arrayinsert_sql(self, expression: exp.ArrayInsert, index_offset: int = 0) -> str:
204        return super().arrayinsert_sql(expression, index_offset=1)
205
206    def bracket_sql(self, expression: exp.Bracket) -> str:
207        if expression.args.get("safe"):
208            key = seq_get(self.bracket_offset_expressions(expression, index_offset=1), 0)
209            return self.func("TRY_ELEMENT_AT", expression.this, key)
210
211        return super().bracket_sql(expression)
212
213    def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
214        return f"GENERATED ALWAYS AS ({self.sql(expression, 'this')})"
215
216    def anyvalue_sql(self, expression: exp.AnyValue) -> str:
217        return self.function_fallback_sql(expression)
218
219    def datediff_sql(self, expression: exp.DateDiff) -> str:
220        end = self.sql(expression, "this")
221        start = self.sql(expression, "expression")
222
223        if expression.unit:
224            return self.func("DATEDIFF", unit_to_var(expression), start, end)
225
226        return self.func("DATEDIFF", end, start)
227
228    def placeholder_sql(self, expression: exp.Placeholder) -> str:
229        if not expression.args.get("widget"):
230            return super().placeholder_sql(expression)
231
232        return f"{{{expression.name}}}"
233
234    def readparquet_sql(self, expression: exp.ReadParquet) -> str:
235        if len(expression.expressions) != 1:
236            self.unsupported("READ_PARQUET with multiple arguments is not supported")
237            return ""
238
239        parquet_file = expression.expressions[0]
240        return f"parquet.`{parquet_file.name}`"
241
242    def ifblock_sql(self, expression: exp.IfBlock) -> str:
243        condition = expression.this
244        true_block = expression.args.get("true")
245
246        condition_expr = None
247        if isinstance(condition, exp.Not):
248            inner = condition.this
249            if isinstance(inner, exp.Is) and isinstance(inner.expression, exp.Null):
250                condition_expr = inner.this
251
252        if isinstance(condition_expr, exp.ObjectId):
253            object_type = condition_expr.expression
254            if (
255                (object_type is None or object_type.name.upper() == "U")
256                and isinstance(true_block, exp.Block)
257                and isinstance(drop := true_block.expressions[0], exp.Drop)
258            ):
259                drop.set("exists", True)
260                return self.sql(drop)
261
262        return super().ifblock_sql(expression)
class SparkGenerator(sqlglot.generators.spark2.Spark2Generator):
 57class SparkGenerator(Spark2Generator):
 58    SUPPORTS_TO_NUMBER = True
 59    PAD_FILL_PATTERN_IS_REQUIRED = False
 60    SUPPORTS_CONVERT_TIMEZONE = True
 61    SUPPORTS_MEDIAN = True
 62    SUPPORTS_UNIX_SECONDS = True
 63    MERGE_SCHEMA_EVOLUTION_MIN_VERSION = (4, 0)
 64    ORDERED_PERCENTILE_MIN_VERSIONS = dict.fromkeys(exp.PERCENTILES, (3, 3))
 65    LISTAGG_MIN_VERSION = (4, 0)
 66    SUPPORTS_DECODE_CASE = True
 67    SET_ASSIGNMENT_REQUIRES_VARIABLE_KEYWORD = True
 68
 69    TYPE_MAPPING = {
 70        **Spark2Generator.TYPE_MAPPING,
 71        exp.DType.MONEY: "DECIMAL",
 72        exp.DType.SMALLMONEY: "DECIMAL",
 73        exp.DType.UUID: "STRING",
 74        exp.DType.TIMESTAMPLTZ: "TIMESTAMP_LTZ",
 75        exp.DType.TIMESTAMPNTZ: "TIMESTAMP_NTZ",
 76    }
 77
 78    TYPE_PARAM_SETTINGS = {
 79        **Spark2Generator.TYPE_PARAM_SETTINGS,
 80        exp.DType.MONEY: ((15, 4), ()),
 81        exp.DType.SMALLMONEY: ((6, 4), ()),
 82    }
 83
 84    TRANSFORMS = {
 85        k: v
 86        for k, v in {
 87            **Spark2Generator.TRANSFORMS,
 88            exp.ArrayConstructCompact: lambda self, e: self.func(
 89                "ARRAY_COMPACT", self.func("ARRAY", *e.expressions)
 90            ),
 91            exp.ArrayAppend: array_append_sql("ARRAY_APPEND"),
 92            exp.ArrayPrepend: array_append_sql("ARRAY_PREPEND"),
 93            exp.BitwiseAndAgg: rename_func("BIT_AND"),
 94            exp.BitwiseOrAgg: rename_func("BIT_OR"),
 95            exp.BitwiseXorAgg: rename_func("BIT_XOR"),
 96            exp.BitwiseCount: rename_func("BIT_COUNT"),
 97            exp.Create: preprocess(
 98                [
 99                    remove_unique_constraints,
100                    lambda e: ctas_with_tmp_tables_to_create_tmp_view(
101                        e, temporary_storage_provider
102                    ),
103                    move_partitioned_by_to_schema_columns,
104                ]
105            ),
106            exp.CurrentVersion: rename_func("VERSION"),
107            exp.DateFromUnixDate: rename_func("DATE_FROM_UNIX_DATE"),
108            exp.DatetimeAdd: date_delta_to_binary_interval_op(cast=False),
109            exp.DatetimeSub: date_delta_to_binary_interval_op(cast=False),
110            exp.EndsWith: rename_func("ENDSWITH"),
111            exp.JSONKeys: rename_func("JSON_OBJECT_KEYS"),
112            exp.PartitionedByProperty: lambda self, e: (
113                f"PARTITIONED BY {self.wrap(self.expressions(sqls=[_normalize_partition(e) for e in e.this.expressions], skip_first=True))}"
114            ),
115            exp.SafeAdd: rename_func("TRY_ADD"),
116            exp.SafeDivide: rename_func("TRY_DIVIDE"),
117            exp.SafeMultiply: rename_func("TRY_MULTIPLY"),
118            exp.SafeSubtract: rename_func("TRY_SUBTRACT"),
119            exp.StartsWith: rename_func("STARTSWITH"),
120            exp.StabilityProperty: lambda self, e: (
121                "DETERMINISTIC" if e.name == "IMMUTABLE" else "NOT DETERMINISTIC"
122            ),
123            exp.TimeAdd: date_delta_to_binary_interval_op(cast=False),
124            exp.TimeSub: date_delta_to_binary_interval_op(cast=False),
125            exp.TsOrDsAdd: _dateadd_sql,
126            exp.TimestampAdd: _dateadd_sql,
127            exp.TimestampFromParts: rename_func("MAKE_TIMESTAMP"),
128            exp.TimestampSub: date_delta_to_binary_interval_op(cast=False),
129            exp.DatetimeDiff: timestampdiff_sql,
130            exp.TimestampDiff: timestampdiff_sql,
131            exp.TryCast: lambda self, e: (
132                self.trycast_sql(e) if e.args.get("safe") else self.cast_sql(e)
133            ),
134            exp.AnyValue: None,
135            exp.DateDiff: None,
136            exp.With: None,
137        }.items()
138        if v is not None
139    }
140
141    def dateadd_sql(self, expression: exp.DateAdd | exp.DateSub) -> str:
142        if expression.text("unit").upper() in (
143            "HOUR",
144            "MINUTE",
145            "SECOND",
146            "MILLISECOND",
147            "MICROSECOND",
148        ):
149            amount = expression.expression
150            return self.func(
151                "TIMESTAMPADD",
152                unit_to_var(expression),
153                -amount if isinstance(expression, exp.DateSub) else amount,
154                expression.this,
155            )
156
157        return super().dateadd_sql(expression)
158
159    def ignorenulls_sql(self, expression: exp.IgnoreNulls) -> str:
160        return generator.Generator.ignorenulls_sql(self, expression)
161
162    def groupconcat_sql(self, expression: exp.GroupConcat) -> str:
163        if self.dialect.version >= self.LISTAGG_MIN_VERSION:
164            return groupconcat_sql(self, expression)
165
166        this = expression.this
167        if isinstance(this, exp.Limit) or (
168            isinstance(expression.parent, (exp.Filter, exp.Window)) and expression.arg_key == "this"
169        ):
170            self.unsupported("Cannot emulate LISTAGG with LIMIT, FILTER or OVER")
171            return groupconcat_sql(self, expression)
172
173        if isinstance(this, exp.Order):
174            if len(this.expressions) != 1 or isinstance(this.this, exp.Distinct):
175                self.unsupported(
176                    "Cannot emulate ordered LISTAGG with multiple sort keys or DISTINCT"
177                )
178                return groupconcat_sql(self, expression)
179
180            value, key = this.this, this.expressions[0]
181            asc = not key.args.get("desc")
182            fields = [exp.alias_(key.this, "sort_key"), exp.alias_(value, "value")]
183            if bool(key.args.get("nulls_first")) != asc:
184                # SORT_ARRAY treats NULL as the smallest key within a struct.
185                fields.insert(0, key.this.is_(exp.null()))
186            row = exp.If(
187                this=value.is_(exp.null()), true=exp.null(), false=exp.Struct(expressions=fields)
188            )
189            values: exp.Expr = exp.Dot(
190                this=exp.func("SORT_ARRAY", exp.ArrayAgg(this=row), exp.convert(asc)),
191                expression=exp.to_identifier("value"),
192            )
193        else:
194            values = exp.ArrayAgg(this=this)
195
196        if not expression.args.get("empty_string_on_empty"):
197            values = exp.Nullif(this=values, expression=exp.array())
198
199        separator = expression.args.get("separator") or exp.Literal.string(",")
200        if expression.args.get("null_separator_is_empty") and not separator.is_string:
201            separator = exp.Coalesce(this=separator, expressions=[exp.Literal.string("")])
202        return self.func("ARRAY_JOIN", values, separator)
203
204    def arrayinsert_sql(self, expression: exp.ArrayInsert, index_offset: int = 0) -> str:
205        return super().arrayinsert_sql(expression, index_offset=1)
206
207    def bracket_sql(self, expression: exp.Bracket) -> str:
208        if expression.args.get("safe"):
209            key = seq_get(self.bracket_offset_expressions(expression, index_offset=1), 0)
210            return self.func("TRY_ELEMENT_AT", expression.this, key)
211
212        return super().bracket_sql(expression)
213
214    def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
215        return f"GENERATED ALWAYS AS ({self.sql(expression, 'this')})"
216
217    def anyvalue_sql(self, expression: exp.AnyValue) -> str:
218        return self.function_fallback_sql(expression)
219
220    def datediff_sql(self, expression: exp.DateDiff) -> str:
221        end = self.sql(expression, "this")
222        start = self.sql(expression, "expression")
223
224        if expression.unit:
225            return self.func("DATEDIFF", unit_to_var(expression), start, end)
226
227        return self.func("DATEDIFF", end, start)
228
229    def placeholder_sql(self, expression: exp.Placeholder) -> str:
230        if not expression.args.get("widget"):
231            return super().placeholder_sql(expression)
232
233        return f"{{{expression.name}}}"
234
235    def readparquet_sql(self, expression: exp.ReadParquet) -> str:
236        if len(expression.expressions) != 1:
237            self.unsupported("READ_PARQUET with multiple arguments is not supported")
238            return ""
239
240        parquet_file = expression.expressions[0]
241        return f"parquet.`{parquet_file.name}`"
242
243    def ifblock_sql(self, expression: exp.IfBlock) -> str:
244        condition = expression.this
245        true_block = expression.args.get("true")
246
247        condition_expr = None
248        if isinstance(condition, exp.Not):
249            inner = condition.this
250            if isinstance(inner, exp.Is) and isinstance(inner.expression, exp.Null):
251                condition_expr = inner.this
252
253        if isinstance(condition_expr, exp.ObjectId):
254            object_type = condition_expr.expression
255            if (
256                (object_type is None or object_type.name.upper() == "U")
257                and isinstance(true_block, exp.Block)
258                and isinstance(drop := true_block.expressions[0], exp.Drop)
259            ):
260                drop.set("exists", True)
261                return self.sql(drop)
262
263        return super().ifblock_sql(expression)

Generator converts a given syntax tree to the corresponding SQL string.

Arguments:
  • pretty: Whether to format the produced SQL string. Default: False.
  • identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True: Always quote except for specials cases. 'safe': Only quote identifiers that are case insensitive.
  • normalize: Whether to normalize identifiers to lowercase. Default: False.
  • pad: The pad size in a formatted string. For example, this affects the indentation of a projection in a query, relative to its nesting level. Default: 2.
  • indent: The indentation size in a formatted string. For example, this affects the indentation of subqueries and filters under a WHERE clause. Default: 2.
  • normalize_functions: How to normalize function names. Possible values are: "upper" or True (default): Convert names to uppercase. "lower": Convert names to lowercase. False: Disables function name normalization.
  • unsupported_level: Determines the generator's behavior when it encounters unsupported expressions. Default ErrorLevel.WARN.
  • max_unsupported: Maximum number of unsupported messages to include in a raised UnsupportedError. This is only relevant if unsupported_level is ErrorLevel.RAISE. Default: 3
  • leading_comma: Whether the comma is leading or trailing in select expressions. This is only relevant when generating in pretty mode. Default: False
  • max_text_width: The max number of characters in a segment before creating new lines in pretty mode. The default is on the smaller end because the length only represents a segment and not the true line length. Default: 80
  • comments: Whether to preserve comments in the output SQL code. Default: True
SUPPORTS_TO_NUMBER = True
PAD_FILL_PATTERN_IS_REQUIRED = False
SUPPORTS_CONVERT_TIMEZONE = True
SUPPORTS_MEDIAN = True
SUPPORTS_UNIX_SECONDS = True
MERGE_SCHEMA_EVOLUTION_MIN_VERSION = (4, 0)
ORDERED_PERCENTILE_MIN_VERSIONS = {<class 'sqlglot.expressions.aggregate.PercentileCont'>: (3, 3), <class 'sqlglot.expressions.aggregate.PercentileDisc'>: (3, 3)}
LISTAGG_MIN_VERSION = (4, 0)
SUPPORTS_DECODE_CASE = True
SET_ASSIGNMENT_REQUIRES_VARIABLE_KEYWORD = True
TYPE_MAPPING = {<DType.DATETIME2: 'DATETIME2'>: 'TIMESTAMP', <DType.NCHAR: 'NCHAR'>: 'CHAR', <DType.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <DType.MEDIUMTEXT: 'MEDIUMTEXT'>: 'TEXT', <DType.LONGTEXT: 'LONGTEXT'>: 'TEXT', <DType.TINYTEXT: 'TINYTEXT'>: 'TEXT', <DType.BLOB: 'BLOB'>: 'BINARY', <DType.MEDIUMBLOB: 'MEDIUMBLOB'>: 'BLOB', <DType.LONGBLOB: 'LONGBLOB'>: 'BLOB', <DType.TINYBLOB: 'TINYBLOB'>: 'BLOB', <DType.INET: 'INET'>: 'INET', <DType.ROWVERSION: 'ROWVERSION'>: 'BINARY', <DType.SMALLDATETIME: 'SMALLDATETIME'>: 'TIMESTAMP', <DType.BIT: 'BIT'>: 'BOOLEAN', <DType.DATETIME: 'DATETIME'>: 'TIMESTAMP', <DType.TEXT: 'TEXT'>: 'STRING', <DType.TIME: 'TIME'>: 'TIMESTAMP', <DType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>: 'TIMESTAMP_NTZ', <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>: 'TIMESTAMP', <DType.UTINYINT: 'UTINYINT'>: 'SMALLINT', <DType.VARBINARY: 'VARBINARY'>: 'BINARY', <DType.MONEY: 'MONEY'>: 'DECIMAL', <DType.SMALLMONEY: 'SMALLMONEY'>: 'DECIMAL', <DType.UUID: 'UUID'>: 'STRING', <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>: 'TIMESTAMP_LTZ'}
TYPE_PARAM_SETTINGS = {<DType.MONEY: 'MONEY'>: ((15, 4), ()), <DType.SMALLMONEY: 'SMALLMONEY'>: ((6, 4), ())}
TRANSFORMS = {<class 'sqlglot.expressions.query.JSONPathKey'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathRoot'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathWildcard'>: <function <lambda>>, <class 'sqlglot.expressions.core.Adjacent'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.AllowedValuesProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.AnalyzeColumns'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.AnalyzeWith'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.ArrayContainedBy'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.ArrayContainsAll'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.ArrayOverlaps'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.AssumeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.AutoRefreshProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.BackupProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.BinaryColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.CaseSpecificColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CalledOnNullInputProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.math.Ceil'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.CharacterSetColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CharacterSetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.ClusteredColumnConstraint'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.constraints.CollateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.CommentColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.ConnectByRoot'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.string.ConvertToCharset'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CopyGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CopyTagsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CredentialsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.CurrentCatalog'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.SessionUser'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.DateFormatColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.DefaultColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ApiProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ApplicationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.CatalogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ComputeProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.DatabaseProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.DynamicProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.EmptyProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.EncodeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.EndStatement'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.EnviromentProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.HandlerProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ParameterStyleProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.EphemeralColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.ExcludeColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ExecuteAsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Except'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ExternalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.math.Floor'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Get'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.GlobalProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.HeapProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.HybridProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.IcebergProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.IgnoreGrantsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.InheritsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.InlineLengthColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.InputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Intersect'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.datatypes.IntervalSpan'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.Int64'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONBContainsAnyTopKeys'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONBContainsAllTopKeys'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONBContainsTopKey'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONBDeleteAtPath'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONBPathExists'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONObject'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.json.JSONObjectAgg'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.LanguageProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.LocationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.LogProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.MaskingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.MaterializedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.NetFunc'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.NetworkProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.NonClusteredColumnConstraint'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.properties.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.NotForReplicationColumnConstraint'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.properties.OnCommitProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.OnProperty'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.constraints.OnUpdateColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.core.Operator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.OutputModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.core.ExtendsLeft'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.core.ExtendsRight'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.PathColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.PartitionedByBucket'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.properties.PartitionByTruncate'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.core.PivotAny'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.PositionalColumn'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.ProjectionPolicyColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.InvisibleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.ZeroFillColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Put'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.RemoteWithConnectionModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ReturnsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.RowAccessProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.core.SafeFunc'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SampleProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SecureProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SecurityIntegrationProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SetConfigProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SetProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SettingsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SharingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SqlReadWriteProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.SqlSecurityProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.StabilityProperty'>: <function SparkGenerator.<lambda>>, <class 'sqlglot.expressions.query.Stream'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.StreamingTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.StrictProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ddl.SwapTable'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.TableColumn'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.Tags'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.TemporaryProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.TitleColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.ToMap'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ToTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.TransformModelProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.TransientProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.VirtualProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.ddl.TriggerExecute'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Union'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.UnloggedProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.UsingTemplateProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.UsingData'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.UppercaseColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.temporal.UtcDate'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.temporal.UtcTime'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.temporal.UtcTimestamp'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.query.Variadic'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.VarMap'>: <function var_map_sql>, <class 'sqlglot.expressions.properties.ViewAttributeProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.VolatileProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.WithJournalTableProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.WithProcedureOptions'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.WithSchemaBindingProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.WithOperator'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.WithoutRowidProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.ForceProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.Property'>: <function property_sql>, <class 'sqlglot.expressions.core.ApproxDistinct'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.ArgMax'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.aggregate.ArgMin'>: <function arg_max_or_min_no_count.<locals>._arg_max_or_min_sql>, <class 'sqlglot.expressions.array.Array'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.array.ArrayConcat'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.ArrayToString'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.ArraySort'>: <function _array_sort_sql>, <class 'sqlglot.expressions.temporal.DateStrToDate'>: <function datestrtodate_sql>, <class 'sqlglot.expressions.temporal.DateToDi'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.DiToDate'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.properties.StorageHandlerProperty'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.string.FromBase64'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.GenerateSeries'>: <function sequence_sql>, <class 'sqlglot.expressions.temporal.GenerateDateArray'>: <function sequence_sql>, <class 'sqlglot.expressions.functions.If'>: <function if_sql.<locals>._if_sql>, <class 'sqlglot.expressions.math.IsNan'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.json.JSONExtract'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.json.JSONExtractScalar'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.json.JSONFormat'>: <function _json_format_sql>, <class 'sqlglot.expressions.array.Map'>: <function _map_sql>, <class 'sqlglot.expressions.aggregate.Max'>: <function max_or_greatest>, <class 'sqlglot.expressions.string.MD5Digest'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.aggregate.Min'>: <function min_or_least>, <class 'sqlglot.expressions.constraints.NotNullColumnConstraint'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.ddl.Create'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.aggregate.Quantile'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.ApproxQuantile'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.RegexpExtract'>: <function regexp_extract_sql>, <class 'sqlglot.expressions.string.RegexpExtractAll'>: <function regexp_extract_sql>, <class 'sqlglot.expressions.string.RegexpReplace'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.core.RegexpLike'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.string.RegexpSplit'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.properties.SchemaCommentProperty'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.aggregate.ArrayUniqueAgg'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.Split'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.query.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.string.StrPosition'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.StrToDate'>: <function _str_to_date>, <class 'sqlglot.expressions.temporal.StrToTime'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.temporal.StrToUnix'>: <function _str_to_unix_sql>, <class 'sqlglot.expressions.array.StructExtract'>: <function struct_extract_sql>, <class 'sqlglot.expressions.array.StarMap'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.Table'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.temporal.TimeStrToDate'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimeStrToTime'>: <function timestrtotime_sql>, <class 'sqlglot.expressions.temporal.TimeStrToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimestampTrunc'>: <function timestamptrunc_sql.<locals>._timestamptrunc_sql>, <class 'sqlglot.expressions.temporal.TimeToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.ToBase64'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TsOrDiToDi'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TsOrDsAdd'>: <function _dateadd_sql>, <class 'sqlglot.expressions.temporal.TsOrDsDiff'>: <function _date_diff_sql>, <class 'sqlglot.expressions.temporal.TsOrDsToDate'>: <function _to_date_sql>, <class 'sqlglot.expressions.functions.TryCast'>: <function SparkGenerator.<lambda>>, <class 'sqlglot.expressions.string.Trim'>: <function trim_sql>, <class 'sqlglot.expressions.string.Unicode'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.UnixToStr'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.UnixToTime'>: <function _unix_to_time_sql>, <class 'sqlglot.expressions.temporal.UnixToTimeStr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.Unnest'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.properties.PartitionedByProperty'>: <function SparkGenerator.<lambda>>, <class 'sqlglot.expressions.string.NumberToStr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.National'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.constraints.PrimaryKeyColumnConstraint'>: <function HiveGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.WeekOfYear'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.DayOfMonth'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.Levenshtein'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.ArraySum'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.array.ArraySlice'>: <function array_slice_to_slice_sql>, <class 'sqlglot.expressions.core.AtTimeZone'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.core.BitwiseLeftShift'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.core.BitwiseRightShift'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.DateFromParts'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.DateTrunc'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.temporal.DayOfWeekIso'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.temporal.DayOfYear'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.From'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.core.FromTimeZone'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.aggregate.LogicalAnd'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.LogicalOr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.Pivot'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.array.Reduce'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.SHA1Digest'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.string.SHA2'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.string.SHA2Digest'>: <function Spark2Generator.<lambda>>, <class 'sqlglot.expressions.aggregate.VariancePop'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.ArrayConstructCompact'>: <function SparkGenerator.<lambda>>, <class 'sqlglot.expressions.array.ArrayAppend'>: <function array_append_sql.<locals>._array_append_sql>, <class 'sqlglot.expressions.array.ArrayPrepend'>: <function array_append_sql.<locals>._array_append_sql>, <class 'sqlglot.expressions.math.BitwiseAndAgg'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.BitwiseOrAgg'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.BitwiseXorAgg'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.BitwiseCount'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.functions.CurrentVersion'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.DateFromUnixDate'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.DatetimeAdd'>: <function date_delta_to_binary_interval_op.<locals>.date_delta_to_binary_interval_op_sql>, <class 'sqlglot.expressions.temporal.DatetimeSub'>: <function date_delta_to_binary_interval_op.<locals>.date_delta_to_binary_interval_op_sql>, <class 'sqlglot.expressions.string.EndsWith'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.json.JSONKeys'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.SafeAdd'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.SafeDivide'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.SafeMultiply'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.math.SafeSubtract'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.string.StartsWith'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimeAdd'>: <function date_delta_to_binary_interval_op.<locals>.date_delta_to_binary_interval_op_sql>, <class 'sqlglot.expressions.temporal.TimeSub'>: <function date_delta_to_binary_interval_op.<locals>.date_delta_to_binary_interval_op_sql>, <class 'sqlglot.expressions.temporal.TimestampAdd'>: <function _dateadd_sql>, <class 'sqlglot.expressions.temporal.TimestampFromParts'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimestampSub'>: <function date_delta_to_binary_interval_op.<locals>.date_delta_to_binary_interval_op_sql>, <class 'sqlglot.expressions.temporal.DatetimeDiff'>: <function timestampdiff_sql>, <class 'sqlglot.expressions.temporal.TimestampDiff'>: <function timestampdiff_sql>}
def dateadd_sql( self, expression: sqlglot.expressions.temporal.DateAdd | sqlglot.expressions.temporal.DateSub) -> str:
141    def dateadd_sql(self, expression: exp.DateAdd | exp.DateSub) -> str:
142        if expression.text("unit").upper() in (
143            "HOUR",
144            "MINUTE",
145            "SECOND",
146            "MILLISECOND",
147            "MICROSECOND",
148        ):
149            amount = expression.expression
150            return self.func(
151                "TIMESTAMPADD",
152                unit_to_var(expression),
153                -amount if isinstance(expression, exp.DateSub) else amount,
154                expression.this,
155            )
156
157        return super().dateadd_sql(expression)
def ignorenulls_sql(self, expression: sqlglot.expressions.core.IgnoreNulls) -> str:
159    def ignorenulls_sql(self, expression: exp.IgnoreNulls) -> str:
160        return generator.Generator.ignorenulls_sql(self, expression)
def groupconcat_sql(self, expression: sqlglot.expressions.aggregate.GroupConcat) -> str:
162    def groupconcat_sql(self, expression: exp.GroupConcat) -> str:
163        if self.dialect.version >= self.LISTAGG_MIN_VERSION:
164            return groupconcat_sql(self, expression)
165
166        this = expression.this
167        if isinstance(this, exp.Limit) or (
168            isinstance(expression.parent, (exp.Filter, exp.Window)) and expression.arg_key == "this"
169        ):
170            self.unsupported("Cannot emulate LISTAGG with LIMIT, FILTER or OVER")
171            return groupconcat_sql(self, expression)
172
173        if isinstance(this, exp.Order):
174            if len(this.expressions) != 1 or isinstance(this.this, exp.Distinct):
175                self.unsupported(
176                    "Cannot emulate ordered LISTAGG with multiple sort keys or DISTINCT"
177                )
178                return groupconcat_sql(self, expression)
179
180            value, key = this.this, this.expressions[0]
181            asc = not key.args.get("desc")
182            fields = [exp.alias_(key.this, "sort_key"), exp.alias_(value, "value")]
183            if bool(key.args.get("nulls_first")) != asc:
184                # SORT_ARRAY treats NULL as the smallest key within a struct.
185                fields.insert(0, key.this.is_(exp.null()))
186            row = exp.If(
187                this=value.is_(exp.null()), true=exp.null(), false=exp.Struct(expressions=fields)
188            )
189            values: exp.Expr = exp.Dot(
190                this=exp.func("SORT_ARRAY", exp.ArrayAgg(this=row), exp.convert(asc)),
191                expression=exp.to_identifier("value"),
192            )
193        else:
194            values = exp.ArrayAgg(this=this)
195
196        if not expression.args.get("empty_string_on_empty"):
197            values = exp.Nullif(this=values, expression=exp.array())
198
199        separator = expression.args.get("separator") or exp.Literal.string(",")
200        if expression.args.get("null_separator_is_empty") and not separator.is_string:
201            separator = exp.Coalesce(this=separator, expressions=[exp.Literal.string("")])
202        return self.func("ARRAY_JOIN", values, separator)
def arrayinsert_sql( self, expression: sqlglot.expressions.array.ArrayInsert, index_offset: int = 0) -> str:
204    def arrayinsert_sql(self, expression: exp.ArrayInsert, index_offset: int = 0) -> str:
205        return super().arrayinsert_sql(expression, index_offset=1)
def bracket_sql(self, expression: sqlglot.expressions.core.Bracket) -> str:
207    def bracket_sql(self, expression: exp.Bracket) -> str:
208        if expression.args.get("safe"):
209            key = seq_get(self.bracket_offset_expressions(expression, index_offset=1), 0)
210            return self.func("TRY_ELEMENT_AT", expression.this, key)
211
212        return super().bracket_sql(expression)
def computedcolumnconstraint_sql( self, expression: sqlglot.expressions.constraints.ComputedColumnConstraint) -> str:
214    def computedcolumnconstraint_sql(self, expression: exp.ComputedColumnConstraint) -> str:
215        return f"GENERATED ALWAYS AS ({self.sql(expression, 'this')})"
def anyvalue_sql(self, expression: sqlglot.expressions.aggregate.AnyValue) -> str:
217    def anyvalue_sql(self, expression: exp.AnyValue) -> str:
218        return self.function_fallback_sql(expression)
def datediff_sql(self, expression: sqlglot.expressions.temporal.DateDiff) -> str:
220    def datediff_sql(self, expression: exp.DateDiff) -> str:
221        end = self.sql(expression, "this")
222        start = self.sql(expression, "expression")
223
224        if expression.unit:
225            return self.func("DATEDIFF", unit_to_var(expression), start, end)
226
227        return self.func("DATEDIFF", end, start)
def placeholder_sql(self, expression: sqlglot.expressions.core.Placeholder) -> str:
229    def placeholder_sql(self, expression: exp.Placeholder) -> str:
230        if not expression.args.get("widget"):
231            return super().placeholder_sql(expression)
232
233        return f"{{{expression.name}}}"
def readparquet_sql(self, expression: sqlglot.expressions.functions.ReadParquet) -> str:
235    def readparquet_sql(self, expression: exp.ReadParquet) -> str:
236        if len(expression.expressions) != 1:
237            self.unsupported("READ_PARQUET with multiple arguments is not supported")
238            return ""
239
240        parquet_file = expression.expressions[0]
241        return f"parquet.`{parquet_file.name}`"
def ifblock_sql(self, expression: sqlglot.expressions.query.IfBlock) -> str:
243    def ifblock_sql(self, expression: exp.IfBlock) -> str:
244        condition = expression.this
245        true_block = expression.args.get("true")
246
247        condition_expr = None
248        if isinstance(condition, exp.Not):
249            inner = condition.this
250            if isinstance(inner, exp.Is) and isinstance(inner.expression, exp.Null):
251                condition_expr = inner.this
252
253        if isinstance(condition_expr, exp.ObjectId):
254            object_type = condition_expr.expression
255            if (
256                (object_type is None or object_type.name.upper() == "U")
257                and isinstance(true_block, exp.Block)
258                and isinstance(drop := true_block.expressions[0], exp.Drop)
259            ):
260                drop.set("exists", True)
261                return self.sql(drop)
262
263        return super().ifblock_sql(expression)
Inherited Members
sqlglot.generator.Generator
Generator
NULL_ORDERING_SUPPORTED
WINDOW_FUNCS_WITH_NULL_ORDERING
WINDOW_FUNCS_REQUIRING_ORDER
IGNORE_NULLS_IN_FUNC
IGNORE_NULLS_BEFORE_ORDER
LOCKING_READS_SUPPORTED
EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE
MATCHED_BY_SOURCE
SUPPORTS_MERGE_WHERE
MERGE_ALL_BY_NAME
SINGLE_STRING_INTERVAL
INTERVAL_ALLOWS_PLURAL_FORM
AUTO_REFRESH_BARE_INTERVALS
LIMIT_ONLY_LITERALS
RENAME_TABLE_WITH_DB
GROUPINGS_SEP
INOUT_SEPARATOR
DIRECTED_JOINS
SUPPORTS_NEAREST_JOIN
SUPPORTS_MATCH_CONDITION
MATCH_CONDITION_IN_ON
QUERY_HINT_SEP
IS_BOOL_ALLOWED
CAST_TO_INT_ROUNDS
SAFE_INT_DIVISION
DUPLICATE_KEY_UPDATE_WITH_SET
LIMIT_IS_TOP
RETURNING_END
TZ_TO_WITH_TIME_ZONE
VALUES_AS_TABLE
ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
ALTER_TABLE_ADD_COLUMNS_WRAPPED
UNNEST_WITH_ORDINALITY
SEMI_ANTI_JOIN_WITH_SIDE
COMPUTED_COLUMN_WITH_TYPE
SUPPORTS_TABLE_COPY
TABLESAMPLE_REQUIRES_PARENS
TABLESAMPLE_SIZE_IS_ROWS
TABLESAMPLE_KEYWORDS
TABLESAMPLE_SEED_KEYWORD
HISTORICAL_DATA_POST_ALIAS
COLLATE_IS_FUNC
DATA_TYPE_SPECIFIERS_ALLOWED
ENSURE_BOOLS
CTE_RECURSIVE_KEYWORD_REQUIRED
SUPPORTS_SINGLE_ARG_CONCAT
SUPPORTS_TABLE_ALIAS_COLUMNS
SUPPORTS_NAMED_CTE_COLUMNS
UNPIVOT_ALIASES_ARE_IDENTIFIERS
PIVOT_ALIAS_WITH_AS
JSON_KEY_VALUE_PAIR_SEP
INSERT_OVERWRITE
SUPPORTS_SELECT_INTO
SUPPORTS_OPTIMIZE
SUPPORTS_EXECUTE_IMMEDIATE
SUPPORTS_UNLOGGED_TABLES
SUPPORTS_CREATE_TABLE_LIKE
SUPPORTS_MODIFY_COLUMN
SUPPORTS_CHANGE_COLUMN
SUPPORTS_ALTER_COLUMN_NULLABILITY
SUPPORTS_ALTER_COLUMN_IF_EXISTS
LIKE_PROPERTY_INSIDE_SCHEMA
MULTI_ARG_DISTINCT
JSON_TYPE_REQUIRED_FOR_EXTRACTION
SUPPORTS_NESTED_JSON_SELECT
JSON_PATH_BRACKETED_KEY_SUPPORTED
JSON_PATH_KEY_QUOTED_FORCES_BRACKETS
SUPPORTS_WINDOW_EXCLUDE
SET_OP_MODIFIERS
SET_OP_LIMITS
SET_OP_PARENTHESIZED_OPERANDS
COPY_PARAMS_ARE_WRAPPED
COPY_PARAMS_EQ_REQUIRED
COPY_HAS_INTO_KEYWORD
UNICODE_SUBSTITUTE
STAR_EXCEPT
HEX_FUNC
QUOTE_JSON_PATH
SUPPORTS_EXPLODING_PROJECTIONS
ARRAY_CONCAT_IS_VAR_LEN
ALTER_SET_WRAPPED
NORMALIZE_EXTRACT_DATE_PARTS
DAYOFWEEK_ZERO_BASED
VARIANCE_NAME
VARIANCE_RETURNS_ZERO_ON_SINGLE_VALUE
ARRAY_SIZE_DIM_REQUIRED
SUPPORTS_BETWEEN_FLAGS
SUPPORTS_LIKE_QUANTIFIERS
MATCH_AGAINST_TABLE_PREFIX
DECLARE_DEFAULT_ASSIGNMENT
UPDATE_STATEMENT_SUPPORTS_FROM
STAR_EXCLUDE_REQUIRES_DERIVED_TABLE
SUPPORTS_DROP_ALTER_ICEBERG_PROPERTY
UNSUPPORTED_TYPES
TIME_PART_SINGULARS
AFTER_HAVING_MODIFIER_TRANSFORMS
TOKEN_MAPPING
STRUCT_DELIMITER
PARAMETER_TOKEN
NAMED_PLACEHOLDER_TOKEN
EXPRESSION_PRECEDES_PROPERTIES_CREATABLES
RESERVED_KEYWORDS
WITH_SEPARATED_COMMENTS
EXCLUDE_COMMENTS
UNWRAPPED_INTERVAL_VALUES
PARAMETERIZABLE_TEXT_TYPES
RESPECT_IGNORE_NULLS_UNSUPPORTED_EXPRESSIONS
MOD_OPERATOR
BARE_OPERATORS
MOD_PAREN_PARENT_TYPES
ALTER_PARTITION_OPTIONS
SENTINEL_LINE_BREAK
pretty
identify
normalize
pad
unsupported_level
max_unsupported
leading_comma
max_text_width
comments
dialect
normalize_functions
unsupported_messages
generate
preprocess
unsupported
sep
seg
sanitize_comment
maybe_comment
wrap
no_identify
normalize_func
indent
sql
uncache_sql
cache_sql
characterset_sql
column_parts
column_sql
pseudocolumn_sql
columnposition_sql
columnconstraint_sql
autoincrementcolumnconstraint_sql
compresscolumnconstraint_sql
generatedasidentitycolumnconstraint_sql
generatedasrowcolumnconstraint_sql
periodforsystemtimeconstraint_sql
notnullcolumnconstraint_sql
primarykeycolumnconstraint_sql
uniquecolumnconstraint_sql
inoutcolumnconstraint_sql
createable_sql
create_sql
sequenceproperties_sql
triggerproperties_sql
triggerreferencing_sql
triggerevent_sql
clone_sql
describe_sql
heredoc_sql
prepend_ctes
with_sql
cte_sql
tablealias_sql
bitstring_sql
hexstring_sql
bytestring_sql
unicodestring_sql
rawstring_sql
datatypeparam_sql
datatype_param_bound_limiter
directory_sql
delete_sql
drop_sql
set_operation
set_operations
fetch_sql
limitoptions_sql
filter_sql
per_sql
hint_sql
indexparameters_sql
index_sql
dynamicidentifier_sql
identifier_sql
hex_sql
lowerhex_sql
inputoutputformat_sql
national_sql
partition_sql
properties_sql
root_properties
properties
with_properties
locate_properties
property_name
property_sql
uuidproperty_sql
likeproperty_sql
fallbackproperty_sql
journalproperty_sql
freespaceproperty_sql
checksumproperty_sql
mergeblockratioproperty_sql
moduleproperty_sql
datablocksizeproperty_sql
blockcompressionproperty_sql
isolatedloadingproperty_sql
partitionboundspec_sql
partitionedofproperty_sql
lockingproperty_sql
lockingstatement_sql
withdataproperty_sql
withsystemversioningproperty_sql
insert_sql
introducer_sql
kill_sql
pseudotype_sql
objectidentifier_sql
onconflict_sql
returning_sql
rowformatdelimitedproperty_sql
withtablehint_sql
indextablehint_sql
historicaldata_sql
table_parts
table_sql
tableargument_sql
tablefromrows_sql
tablesample_sql
pivot_sql
tuple_sql
update_sql
values_sql
var_sql
into_sql
from_sql
groupingsets_sql
rollup_sql
rollupindex_sql
rollupproperty_sql
cube_sql
group_sql
having_sql
connectto_sql
disconnect_sql
connect_sql
prior_sql
join_sql
nearest_sql
lambda_sql
lateral_op
lateral_sql
limit_sql
offset_sql
setitem_sql
set_sql
queryband_sql
pragma_sql
lock_sql
literal_sql
escape_str
loaddata_sql
null_sql
boolean_sql
booland_sql
boolor_sql
order_sql
withfill_sql
cluster_sql
clusterproperty_sql
distribute_sql
sort_sql
ordered_sql
matchrecognizemeasure_sql
matchrecognize_sql
query_modifiers
options_modifier
forclause_sql
queryoption_sql
offset_limit_modifiers
after_limit_modifiers
select_sql
schema_columns_sql
star_sql
sessionparameter_sql
subquery_sql
qualify_sql
prewhere_sql
where_sql
window_sql
partition_by_sql
partitionbyexcluding_sql
windowspec_sql
between_sql
bracket_offset_expressions
all_sql
any_sql
case_sql
nextvaluefor_sql
dayofweek_sql
extract_date_part
extract_sql
trim_sql
convert_concat_args
concat_sql
concatws_sql
check_sql
foreignkey_sql
primarykey_sql
timeserieskey_sql
if_sql
matchagainst_sql
jsonkeyvalue_sql
jsonpath_sql
json_path_part
formatjson_sql
formatphrase_sql
teradataconversion_sql
teradatatitle_sql
teradatanamed_sql
jsonarray_sql
jsonarrayagg_sql
jsoncolumndef_sql
jsonschema_sql
jsontable_sql
openjsoncolumndef_sql
openjson_sql
in_sql
in_unnest_op
interval_sql
return_sql
reference_sql
anonymous_sql
paren_sql
pos_sql
neg_sql
not_sql
alias_sql
pivotalias_sql
aliases_sql
atindex_sql
attimezone_sql
fromtimezone_sql
fromiso8601date_sql
fromiso8601timestamp_sql
fromiso8601timestampnanos_sql
add_sql
and_sql
or_sql
xor_sql
connector_sql
bitwiseand_sql
bitwiseleftshift_sql
bitwisenot_sql
bitwiseor_sql
bitwiserightshift_sql
bitwisexor_sql
strtotime_sql
strtodate_sql
parsedatetime_sql
currentdate_sql
collate_sql
command_sql
optimize_sql
comment_sql
mergetreettlaction_sql
mergetreettl_sql
transaction_sql
commit_sql
rollback_sql
modifycolumn_sql
alterindex_sql
alterdiststyle_sql
altersortkey_sql
alterrename_sql
alter_sql
altersession_sql
add_column_sql
droppartition_sql
dropprimarykey_sql
addconstraint_sql
replacecolumns_sql
addpartition_sql
distinct_sql
respectnulls_sql
havingmax_sql
intdiv_sql
dpipe_sql
nullif_zero_divisor
div_sql
safedivide_sql
overlaps_sql
distance_sql
distancend_sql
dot_sql
nestedjsonselect_sql
eq_sql
propertyeq_sql
escape_sql
glob_sql
gt_sql
gte_sql
is_sql
like_sql
ilike_sql
match_sql
similarto_sql
lt_sql
lte_sql
mod_sql
mul_sql
neq_sql
nullsafeeq_sql
nullsafeneq_sql
sub_sql
trycast_sql
jsoncast_sql
try_sql
log_sql
use_sql
binary
ceil_floor
function_fallback_sql
function_name
func
format_args
too_wide
expressions
op_expressions
naked_property
tag_sql
token_sql
userdefinedfunction_sql
macrooverloads_sql
macrooverload_sql
joinhint_sql
kwarg_sql
when_sql
whens_sql
merge_sql
tochar_sql
tonumber_sql
dictproperty_sql
dictrange_sql
dictsubproperty_sql
aggregatekeyproperty_sql
duplicatekeyproperty_sql
uniquekeyproperty_sql
distributedbyproperty_sql
oncluster_sql
clusteredbyproperty_sql
querytransform_sql
indexconstraintoption_sql
checkcolumnconstraint_sql
indexcolumnconstraint_sql
nvl2_sql
nthvalue_sql
comprehension_sql
columnprefix_sql
opclass_sql
predict_sql
generateembedding_sql
generatetext_sql
generatetable_sql
generatebool_sql
generateint_sql
generatedouble_sql
mltranslate_sql
mlforecast_sql
aiforecast_sql
featuresattime_sql
vectorsearch_sql
forin_sql
refresh_sql
toarray_sql
tsordstotime_sql
tsordstotimestamp_sql
tsordstodatetime_sql
tsordstodate_sql
unixdate_sql
lastday_sql
arrayany_sql
partitionrange_sql
truncatetable_sql
convert_sql
copyparameter_sql
credentials_sql
copy_sql
semicolon_sql
datadeletionproperty_sql
maskingpolicycolumnconstraint_sql
gapfill_sql
scope_resolution
scoperesolution_sql
parsejson_sql
rand_sql
changes_sql
pad_sql
summarize_sql
explodinggenerateseries_sql
converttimezone_sql
json_sql
jsonvalue_sql
skipjsoncolumn_sql
conditionalinsert_sql
multitableinserts_sql
oncondition_sql
jsonextractquote_sql
jsonexists_sql
min_sql
max_sql
timeslice_sql
slice_sql
apply_sql
grant_sql
revoke_sql
grantprivilege_sql
grantprincipal_sql
columns_sql
overlay_sql
todouble_sql
string_sql
median_sql
overflowtruncatebehavior_sql
unixseconds_sql
arraysort_sql
variance_sql
arraysize_sql
attach_sql
detach_sql
attachoption_sql
watermarkcolumnconstraint_sql
encodeproperty_sql
includeproperty_sql
xmlelement_sql
xmlkeyvalueoption_sql
partitionbyrangeproperty_sql
partitionbyrangepropertydynamic_sql
unpivotcolumns_sql
analyzesample_sql
analyzestatistics_sql
analyzehistogram_sql
analyzedelete_sql
analyzelistchainedrows_sql
analyzevalidate_sql
analyze_sql
xmltable_sql
xmlnamespace_sql
export_sql
declare_sql
declareitem_sql
recursivewithsearch_sql
parameterizedagg_sql
anonymousaggfunc_sql
combinedaggfunc_sql
combinedparameterizedagg_sql
show_sql
install_sql
liststage_sql
get_put_sql
translatecharacters_sql
decodecase_sql
semanticview_sql
getextract_sql
datefromunixdate_sql
space_sql
buildproperty_sql
refreshtriggerproperty_sql
modelattribute_sql
directorystage_sql
uuid_sql
initcap_sql
localtime_sql
localtimestamp_sql
weekstart_name
weekstart_sql
datetrunc_sql
chr_sql
weightstring_sql
block_sql
functionspecification_sql
storedprocedure_sql
casestatement_sql
whileblock_sql
loopblock_sql
repeatblock_sql
leave_sql
iterate_sql
execute_sql
executesql_sql
executeimmediate_sql
altermodifysqlsecurity_sql
renameindex_sql
sqlglot.generators.spark2.Spark2Generator
QUERY_HINTS
NVL2_SUPPORTED
CAN_IMPLEMENT_ARRAY_ANY
ALTER_SET_TYPE
PARSE_JSON_NAME
PROPERTIES_LOCATION
TS_OR_DS_EXPRESSIONS
WRAP_DERIVED_VALUES
CREATE_FUNCTION_RETURN_AS
withingroup_sql
format_sql
struct_sql
cast_sql
fileformatproperty_sql
optionsproperty_sql
altercolumn_sql
renamecolumn_sql
sqlglot.generators.hive.HiveGenerator
DAYOFWEEK_NAME
BYTE_STRING_FUNCTION
SELECT_KINDS
TRY_SUPPORTED
SUPPORTS_UESCAPE
SUPPORTS_MULTI_ARG_CHR
SUPPORTS_GROUPING_SETS_AS_SUFFIX
LIMIT_FETCH
TABLESAMPLE_WITH_METHOD
JOIN_HINTS
TABLE_HINTS
INDEX_ON
INT_DIV_OPERATOR
EXTRACT_ALLOWS_QUOTES
LAST_DAY_SUPPORTS_DATE_PART
JSON_PATH_SINGLE_QUOTE_ESCAPE
SAFE_JSON_PATH_KEY_RE
WITH_PROPERTIES_PREFIX
SUPPORTS_TEMPORAL_PRECISION
ARRAY_SIZE_NAME
EXPRESSIONS_WITHOUT_NESTED_CTES
SUPPORTED_JSON_PATH_PARTS
IGNORE_NULLS_FUNCS
datesub_sql
format_time
unnest_sql
parameter_sql
schema_sql
constraint_sql
rowformatserdeproperty_sql
arrayagg_sql
trunc_sql
datatype_sql
version_sql
columndef_sql
alterset_sql
serdeproperties_sql
exists_sql
timetostr_sql
usingproperty_sql