sqlglot.generators.starrocks
1from __future__ import annotations 2 3 4from sqlglot import exp, transforms 5from sqlglot.dialects.dialect import ( 6 approx_count_distinct_sql, 7 arrow_json_extract_sql, 8 rename_func, 9 unit_to_str, 10 inline_array_sql, 11 property_sql, 12 var_map_sql, 13) 14from sqlglot.generators.mysql import MySQLGenerator 15 16 17def _eliminate_between_in_delete(expression: exp.Expr) -> exp.Expr: 18 """ 19 StarRocks doesn't support BETWEEN in DELETE statements, so we convert 20 BETWEEN expressions to explicit comparisons. 21 22 https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/DELETE/#parameters 23 24 Example: 25 >>> from sqlglot import parse_one 26 >>> expr = parse_one("DELETE FROM t WHERE x BETWEEN 1 AND 10") 27 >>> print(_eliminate_between_in_delete(expr).sql(dialect="starrocks")) 28 DELETE FROM t WHERE x >= 1 AND x <= 10 29 """ 30 if where := expression.args.get("where"): 31 for between in where.find_all(exp.Between): 32 between.replace( 33 exp.and_( 34 exp.GTE(this=between.this.copy(), expression=between.args["low"]), 35 exp.LTE(this=between.this.copy(), expression=between.args["high"]), 36 copy=False, 37 ) 38 ) 39 return expression 40 41 42# https://docs.starrocks.io/docs/sql-reference/sql-functions/spatial-functions/st_distance_sphere/ 43def st_distance_sphere(self, expression: exp.StDistance) -> str: 44 point1 = expression.this 45 point2 = expression.expression 46 47 point1_x = self.func("ST_X", point1) 48 point1_y = self.func("ST_Y", point1) 49 point2_x = self.func("ST_X", point2) 50 point2_y = self.func("ST_Y", point2) 51 52 return self.func("ST_Distance_Sphere", point1_x, point1_y, point2_x, point2_y) 53 54 55class StarRocksGenerator(MySQLGenerator): 56 EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE = False 57 JSON_TYPE_REQUIRED_FOR_EXTRACTION = False 58 VARCHAR_REQUIRES_SIZE = False 59 PARSE_JSON_NAME: str | None = "PARSE_JSON" 60 WITH_PROPERTIES_PREFIX = "PROPERTIES" 61 UPDATE_STATEMENT_SUPPORTS_FROM = True 62 INSERT_OVERWRITE = " OVERWRITE" 63 64 # StarRocks doesn't support "IS TRUE/FALSE" syntax. 65 IS_BOOL_ALLOWED = False 66 # StarRocks doesn't support renaming a table with a database. 67 RENAME_TABLE_WITH_DB = False 68 69 CAST_MAPPING = {} 70 71 TYPE_MAPPING = { 72 **MySQLGenerator.TYPE_MAPPING, 73 exp.DType.INT128: "LARGEINT", 74 exp.DType.TEXT: "STRING", 75 exp.DType.TIMESTAMP: "DATETIME", 76 exp.DType.TIMESTAMPTZ: "DATETIME", 77 } 78 79 SQL_SECURITY_VIEW_LOCATION = exp.Properties.Location.POST_SCHEMA 80 81 PROPERTIES_LOCATION = { 82 **MySQLGenerator.PROPERTIES_LOCATION, 83 exp.PrimaryKey: exp.Properties.Location.POST_SCHEMA, 84 exp.UniqueKeyProperty: exp.Properties.Location.POST_SCHEMA, 85 exp.RollupProperty: exp.Properties.Location.POST_SCHEMA, 86 exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA, 87 } 88 89 TRANSFORMS = { 90 # StarRocks uses the native TRIM(str, chars)/LTRIM/RTRIM function form, not 91 # MySQL's TRIM(chars FROM str) syntax, so it falls back to the base generator. 92 **{ 93 k: v for k, v in MySQLGenerator.TRANSFORMS.items() if k not in (exp.DateTrunc, exp.Trim) 94 }, 95 exp.ArgMax: rename_func("MAX_BY"), 96 exp.ArgMin: rename_func("MIN_BY"), 97 exp.Array: inline_array_sql, 98 exp.ArrayAgg: rename_func("ARRAY_AGG"), 99 # a <@ b (ArrayContainedBy) is equivalent to ARRAY_CONTAINS_ALL(b, a) 100 exp.ArrayContainedBy: lambda self, e: self.func("ARRAY_CONTAINS_ALL", e.expression, e.this), 101 exp.ArrayContainsAll: rename_func("ARRAY_CONTAINS_ALL"), 102 exp.ArrayFilter: rename_func("ARRAY_FILTER"), 103 exp.ArrayToString: rename_func("ARRAY_JOIN"), 104 exp.ApproxDistinct: approx_count_distinct_sql, 105 exp.CurrentVersion: lambda *_: "CURRENT_VERSION()", 106 exp.DateDiff: lambda self, e: self.func("DATE_DIFF", unit_to_str(e), e.this, e.expression), 107 exp.Delete: transforms.preprocess([_eliminate_between_in_delete]), 108 exp.Flatten: rename_func("ARRAY_FLATTEN"), 109 exp.JSONExtractScalar: arrow_json_extract_sql, 110 exp.JSONExtract: arrow_json_extract_sql, 111 # Both MAP forms (two-array MAP([keys], [values]) and variadic MAP(k1, v1, ...)) 112 # generate StarRocks' variadic MAP(k1, v1, k2, v2, ...) constructor 113 exp.Map: lambda self, e: var_map_sql(self, e, "MAP"), 114 exp.Property: property_sql, 115 exp.RegexpLike: rename_func("REGEXP"), 116 # Inherited from MySQL, minus operations StarRocks supports natively 117 # (QUALIFY, FULL OUTER JOIN, SEMI/ANTI JOIN) 118 exp.Select: transforms.preprocess( 119 [ 120 transforms.eliminate_distinct_on, 121 transforms.unnest_generate_date_array_using_recursive_cte, 122 ] 123 ), 124 exp.SchemaCommentProperty: lambda self, e: self.naked_property(e), 125 exp.SqlSecurityProperty: lambda self, e: f"SECURITY {self.sql(e.this)}", 126 exp.StDistance: st_distance_sphere, 127 exp.StrToUnix: lambda self, e: self.func("UNIX_TIMESTAMP", e.this, self.format_time(e)), 128 exp.TimestampTrunc: lambda self, e: self.func("DATE_TRUNC", unit_to_str(e), e.this), 129 exp.TimeStrToDate: rename_func("TO_DATE"), 130 exp.UnixToStr: lambda self, e: self.func("FROM_UNIXTIME", e.this, self.format_time(e)), 131 exp.UnixToTime: rename_func("FROM_UNIXTIME"), 132 exp.VarMap: lambda self, e: var_map_sql(self, e, "MAP"), 133 } 134 135 # https://docs.starrocks.io/docs/sql-reference/sql-statements/keywords/#reserved-keywords 136 RESERVED_KEYWORDS = { 137 "add", 138 "all", 139 "alter", 140 "analyze", 141 "and", 142 "array", 143 "as", 144 "asc", 145 "between", 146 "bigint", 147 "bitmap", 148 "both", 149 "by", 150 "case", 151 "char", 152 "character", 153 "check", 154 "collate", 155 "column", 156 "compaction", 157 "convert", 158 "create", 159 "cross", 160 "cube", 161 "current_date", 162 "current_role", 163 "current_time", 164 "current_timestamp", 165 "current_user", 166 "database", 167 "databases", 168 "decimal", 169 "decimalv2", 170 "decimal32", 171 "decimal64", 172 "decimal128", 173 "default", 174 "deferred", 175 "delete", 176 "dense_rank", 177 "desc", 178 "describe", 179 "distinct", 180 "double", 181 "drop", 182 "dual", 183 "else", 184 "except", 185 "exists", 186 "explain", 187 "false", 188 "first_value", 189 "float", 190 "for", 191 "force", 192 "from", 193 "full", 194 "function", 195 "grant", 196 "group", 197 "grouping", 198 "grouping_id", 199 "groups", 200 "having", 201 "hll", 202 "host", 203 "if", 204 "ignore", 205 "immediate", 206 "in", 207 "index", 208 "infile", 209 "inner", 210 "insert", 211 "int", 212 "integer", 213 "intersect", 214 "into", 215 "is", 216 "join", 217 "json", 218 "key", 219 "keys", 220 "kill", 221 "lag", 222 "largeint", 223 "last_value", 224 "lateral", 225 "lead", 226 "left", 227 "like", 228 "limit", 229 "load", 230 "localtime", 231 "localtimestamp", 232 "maxvalue", 233 "minus", 234 "mod", 235 "not", 236 "ntile", 237 "null", 238 "on", 239 "or", 240 "order", 241 "outer", 242 "outfile", 243 "over", 244 "partition", 245 "percentile", 246 "primary", 247 "procedure", 248 "qualify", 249 "range", 250 "rank", 251 "read", 252 "regexp", 253 "release", 254 "rename", 255 "replace", 256 "revoke", 257 "right", 258 "rlike", 259 "row", 260 "row_number", 261 "rows", 262 "schema", 263 "schemas", 264 "select", 265 "set", 266 "set_var", 267 "show", 268 "smallint", 269 "system", 270 "table", 271 "terminated", 272 "text", 273 "then", 274 "tinyint", 275 "to", 276 "true", 277 "union", 278 "unique", 279 "unsigned", 280 "update", 281 "use", 282 "using", 283 "values", 284 "varchar", 285 "when", 286 "where", 287 "with", 288 } 289 290 def create_sql(self, expression: exp.Create) -> str: 291 # Starrocks' primary key is defined outside of the schema, so we need to move it there 292 schema = expression.this 293 if isinstance(schema, exp.Schema): 294 primary_key = schema.find(exp.PrimaryKey) 295 296 if primary_key: 297 props = expression.args.get("properties") 298 299 if not props: 300 props = exp.Properties(expressions=[]) 301 expression.set("properties", props) 302 303 # Verify if the first one is an engine property. Is true then insert it after the engine, 304 # otherwise insert it at the beginning 305 engine = props.find(exp.EngineProperty) 306 engine_index = (engine.index or 0) if engine else -1 307 props.set("expressions", primary_key.pop(), engine_index + 1, overwrite=False) 308 309 return super().create_sql(expression) 310 311 def partitionedbyproperty_sql(self, expression: exp.PartitionedByProperty) -> str: 312 this = expression.this 313 if isinstance(this, exp.Schema): 314 # For MVs, StarRocks needs outer parentheses. 315 create = expression.find_ancestor(exp.Create) 316 317 sql = self.expressions(this, flat=True) 318 if (create and create.kind == "VIEW") or all( 319 isinstance(col, (exp.Column, exp.Identifier)) for col in this.expressions 320 ): 321 sql = f"({sql})" 322 323 return f"PARTITION BY {sql}" 324 325 return f"PARTITION BY {self.sql(this)}" 326 327 def clusterproperty_sql(self, expression: exp.ClusterProperty) -> str: 328 """Generate StarRocks ORDER BY clause for clustering.""" 329 if expression.this: 330 self.unsupported(f"Unsupported CLUSTER BY {self.sql(expression, 'this')}") 331 return "" 332 expressions = self.expressions(expression, flat=True) 333 return f"ORDER BY ({expressions})" 334 335 def refreshtriggerproperty_sql(self, expression: exp.RefreshTriggerProperty) -> str: 336 """Generate StarRocks REFRESH clause for materialized views. 337 There is a little difference of the syntax between StarRocks and Doris. 338 """ 339 method = self.sql(expression, "method") 340 method = f" {method}" if method else "" 341 kind = self.sql(expression, "kind") 342 kind = f" {kind}" if kind else "" 343 starts = self.sql(expression, "starts") 344 starts = f" START ({starts})" if starts else "" 345 every = self.sql(expression, "every") 346 unit = self.sql(expression, "unit") 347 every = f" EVERY (INTERVAL {every} {unit})" if every and unit else "" 348 349 return f"REFRESH{method}{kind}{starts}{every}"
44def st_distance_sphere(self, expression: exp.StDistance) -> str: 45 point1 = expression.this 46 point2 = expression.expression 47 48 point1_x = self.func("ST_X", point1) 49 point1_y = self.func("ST_Y", point1) 50 point2_x = self.func("ST_X", point2) 51 point2_y = self.func("ST_Y", point2) 52 53 return self.func("ST_Distance_Sphere", point1_x, point1_y, point2_x, point2_y)
56class StarRocksGenerator(MySQLGenerator): 57 EXCEPT_INTERSECT_SUPPORT_ALL_CLAUSE = False 58 JSON_TYPE_REQUIRED_FOR_EXTRACTION = False 59 VARCHAR_REQUIRES_SIZE = False 60 PARSE_JSON_NAME: str | None = "PARSE_JSON" 61 WITH_PROPERTIES_PREFIX = "PROPERTIES" 62 UPDATE_STATEMENT_SUPPORTS_FROM = True 63 INSERT_OVERWRITE = " OVERWRITE" 64 65 # StarRocks doesn't support "IS TRUE/FALSE" syntax. 66 IS_BOOL_ALLOWED = False 67 # StarRocks doesn't support renaming a table with a database. 68 RENAME_TABLE_WITH_DB = False 69 70 CAST_MAPPING = {} 71 72 TYPE_MAPPING = { 73 **MySQLGenerator.TYPE_MAPPING, 74 exp.DType.INT128: "LARGEINT", 75 exp.DType.TEXT: "STRING", 76 exp.DType.TIMESTAMP: "DATETIME", 77 exp.DType.TIMESTAMPTZ: "DATETIME", 78 } 79 80 SQL_SECURITY_VIEW_LOCATION = exp.Properties.Location.POST_SCHEMA 81 82 PROPERTIES_LOCATION = { 83 **MySQLGenerator.PROPERTIES_LOCATION, 84 exp.PrimaryKey: exp.Properties.Location.POST_SCHEMA, 85 exp.UniqueKeyProperty: exp.Properties.Location.POST_SCHEMA, 86 exp.RollupProperty: exp.Properties.Location.POST_SCHEMA, 87 exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA, 88 } 89 90 TRANSFORMS = { 91 # StarRocks uses the native TRIM(str, chars)/LTRIM/RTRIM function form, not 92 # MySQL's TRIM(chars FROM str) syntax, so it falls back to the base generator. 93 **{ 94 k: v for k, v in MySQLGenerator.TRANSFORMS.items() if k not in (exp.DateTrunc, exp.Trim) 95 }, 96 exp.ArgMax: rename_func("MAX_BY"), 97 exp.ArgMin: rename_func("MIN_BY"), 98 exp.Array: inline_array_sql, 99 exp.ArrayAgg: rename_func("ARRAY_AGG"), 100 # a <@ b (ArrayContainedBy) is equivalent to ARRAY_CONTAINS_ALL(b, a) 101 exp.ArrayContainedBy: lambda self, e: self.func("ARRAY_CONTAINS_ALL", e.expression, e.this), 102 exp.ArrayContainsAll: rename_func("ARRAY_CONTAINS_ALL"), 103 exp.ArrayFilter: rename_func("ARRAY_FILTER"), 104 exp.ArrayToString: rename_func("ARRAY_JOIN"), 105 exp.ApproxDistinct: approx_count_distinct_sql, 106 exp.CurrentVersion: lambda *_: "CURRENT_VERSION()", 107 exp.DateDiff: lambda self, e: self.func("DATE_DIFF", unit_to_str(e), e.this, e.expression), 108 exp.Delete: transforms.preprocess([_eliminate_between_in_delete]), 109 exp.Flatten: rename_func("ARRAY_FLATTEN"), 110 exp.JSONExtractScalar: arrow_json_extract_sql, 111 exp.JSONExtract: arrow_json_extract_sql, 112 # Both MAP forms (two-array MAP([keys], [values]) and variadic MAP(k1, v1, ...)) 113 # generate StarRocks' variadic MAP(k1, v1, k2, v2, ...) constructor 114 exp.Map: lambda self, e: var_map_sql(self, e, "MAP"), 115 exp.Property: property_sql, 116 exp.RegexpLike: rename_func("REGEXP"), 117 # Inherited from MySQL, minus operations StarRocks supports natively 118 # (QUALIFY, FULL OUTER JOIN, SEMI/ANTI JOIN) 119 exp.Select: transforms.preprocess( 120 [ 121 transforms.eliminate_distinct_on, 122 transforms.unnest_generate_date_array_using_recursive_cte, 123 ] 124 ), 125 exp.SchemaCommentProperty: lambda self, e: self.naked_property(e), 126 exp.SqlSecurityProperty: lambda self, e: f"SECURITY {self.sql(e.this)}", 127 exp.StDistance: st_distance_sphere, 128 exp.StrToUnix: lambda self, e: self.func("UNIX_TIMESTAMP", e.this, self.format_time(e)), 129 exp.TimestampTrunc: lambda self, e: self.func("DATE_TRUNC", unit_to_str(e), e.this), 130 exp.TimeStrToDate: rename_func("TO_DATE"), 131 exp.UnixToStr: lambda self, e: self.func("FROM_UNIXTIME", e.this, self.format_time(e)), 132 exp.UnixToTime: rename_func("FROM_UNIXTIME"), 133 exp.VarMap: lambda self, e: var_map_sql(self, e, "MAP"), 134 } 135 136 # https://docs.starrocks.io/docs/sql-reference/sql-statements/keywords/#reserved-keywords 137 RESERVED_KEYWORDS = { 138 "add", 139 "all", 140 "alter", 141 "analyze", 142 "and", 143 "array", 144 "as", 145 "asc", 146 "between", 147 "bigint", 148 "bitmap", 149 "both", 150 "by", 151 "case", 152 "char", 153 "character", 154 "check", 155 "collate", 156 "column", 157 "compaction", 158 "convert", 159 "create", 160 "cross", 161 "cube", 162 "current_date", 163 "current_role", 164 "current_time", 165 "current_timestamp", 166 "current_user", 167 "database", 168 "databases", 169 "decimal", 170 "decimalv2", 171 "decimal32", 172 "decimal64", 173 "decimal128", 174 "default", 175 "deferred", 176 "delete", 177 "dense_rank", 178 "desc", 179 "describe", 180 "distinct", 181 "double", 182 "drop", 183 "dual", 184 "else", 185 "except", 186 "exists", 187 "explain", 188 "false", 189 "first_value", 190 "float", 191 "for", 192 "force", 193 "from", 194 "full", 195 "function", 196 "grant", 197 "group", 198 "grouping", 199 "grouping_id", 200 "groups", 201 "having", 202 "hll", 203 "host", 204 "if", 205 "ignore", 206 "immediate", 207 "in", 208 "index", 209 "infile", 210 "inner", 211 "insert", 212 "int", 213 "integer", 214 "intersect", 215 "into", 216 "is", 217 "join", 218 "json", 219 "key", 220 "keys", 221 "kill", 222 "lag", 223 "largeint", 224 "last_value", 225 "lateral", 226 "lead", 227 "left", 228 "like", 229 "limit", 230 "load", 231 "localtime", 232 "localtimestamp", 233 "maxvalue", 234 "minus", 235 "mod", 236 "not", 237 "ntile", 238 "null", 239 "on", 240 "or", 241 "order", 242 "outer", 243 "outfile", 244 "over", 245 "partition", 246 "percentile", 247 "primary", 248 "procedure", 249 "qualify", 250 "range", 251 "rank", 252 "read", 253 "regexp", 254 "release", 255 "rename", 256 "replace", 257 "revoke", 258 "right", 259 "rlike", 260 "row", 261 "row_number", 262 "rows", 263 "schema", 264 "schemas", 265 "select", 266 "set", 267 "set_var", 268 "show", 269 "smallint", 270 "system", 271 "table", 272 "terminated", 273 "text", 274 "then", 275 "tinyint", 276 "to", 277 "true", 278 "union", 279 "unique", 280 "unsigned", 281 "update", 282 "use", 283 "using", 284 "values", 285 "varchar", 286 "when", 287 "where", 288 "with", 289 } 290 291 def create_sql(self, expression: exp.Create) -> str: 292 # Starrocks' primary key is defined outside of the schema, so we need to move it there 293 schema = expression.this 294 if isinstance(schema, exp.Schema): 295 primary_key = schema.find(exp.PrimaryKey) 296 297 if primary_key: 298 props = expression.args.get("properties") 299 300 if not props: 301 props = exp.Properties(expressions=[]) 302 expression.set("properties", props) 303 304 # Verify if the first one is an engine property. Is true then insert it after the engine, 305 # otherwise insert it at the beginning 306 engine = props.find(exp.EngineProperty) 307 engine_index = (engine.index or 0) if engine else -1 308 props.set("expressions", primary_key.pop(), engine_index + 1, overwrite=False) 309 310 return super().create_sql(expression) 311 312 def partitionedbyproperty_sql(self, expression: exp.PartitionedByProperty) -> str: 313 this = expression.this 314 if isinstance(this, exp.Schema): 315 # For MVs, StarRocks needs outer parentheses. 316 create = expression.find_ancestor(exp.Create) 317 318 sql = self.expressions(this, flat=True) 319 if (create and create.kind == "VIEW") or all( 320 isinstance(col, (exp.Column, exp.Identifier)) for col in this.expressions 321 ): 322 sql = f"({sql})" 323 324 return f"PARTITION BY {sql}" 325 326 return f"PARTITION BY {self.sql(this)}" 327 328 def clusterproperty_sql(self, expression: exp.ClusterProperty) -> str: 329 """Generate StarRocks ORDER BY clause for clustering.""" 330 if expression.this: 331 self.unsupported(f"Unsupported CLUSTER BY {self.sql(expression, 'this')}") 332 return "" 333 expressions = self.expressions(expression, flat=True) 334 return f"ORDER BY ({expressions})" 335 336 def refreshtriggerproperty_sql(self, expression: exp.RefreshTriggerProperty) -> str: 337 """Generate StarRocks REFRESH clause for materialized views. 338 There is a little difference of the syntax between StarRocks and Doris. 339 """ 340 method = self.sql(expression, "method") 341 method = f" {method}" if method else "" 342 kind = self.sql(expression, "kind") 343 kind = f" {kind}" if kind else "" 344 starts = self.sql(expression, "starts") 345 starts = f" START ({starts})" if starts else "" 346 every = self.sql(expression, "every") 347 unit = self.sql(expression, "unit") 348 every = f" EVERY (INTERVAL {every} {unit})" if every and unit else "" 349 350 return f"REFRESH{method}{kind}{starts}{every}"
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
WHEREclause. 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
TYPE_MAPPING =
{<DType.NCHAR: 'NCHAR'>: 'CHAR', <DType.NVARCHAR: 'NVARCHAR'>: 'VARCHAR', <DType.INET: 'INET'>: 'INET', <DType.ROWVERSION: 'ROWVERSION'>: 'VARBINARY', <DType.UBIGINT: 'UBIGINT'>: 'BIGINT', <DType.UINT: 'UINT'>: 'INT', <DType.UMEDIUMINT: 'UMEDIUMINT'>: 'MEDIUMINT', <DType.USMALLINT: 'USMALLINT'>: 'SMALLINT', <DType.UTINYINT: 'UTINYINT'>: 'TINYINT', <DType.UDECIMAL: 'UDECIMAL'>: 'DECIMAL', <DType.UDOUBLE: 'UDOUBLE'>: 'DOUBLE', <DType.DATETIME2: 'DATETIME2'>: 'DATETIME', <DType.SMALLDATETIME: 'SMALLDATETIME'>: 'DATETIME', <DType.TIMESTAMP: 'TIMESTAMP'>: 'DATETIME', <DType.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>: 'DATETIME', <DType.TIMESTAMPTZ: 'TIMESTAMPTZ'>: 'DATETIME', <DType.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>: 'TIMESTAMP', <DType.INT128: 'INT128'>: 'LARGEINT', <DType.TEXT: 'TEXT'>: 'STRING'}
PROPERTIES_LOCATION =
{<class 'sqlglot.expressions.properties.AllowedValuesProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.AlgorithmProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.ApiProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.ApplicationProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.AutoIncrementProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.AutoRefreshProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.BackupProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.BlockCompressionProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.CalledOnNullInputProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.CatalogProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.CharacterSetProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ChecksumProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.CollateProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ComputeProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.CopyGrantsProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.query.Cluster'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ClusteredByProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ClusterProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DistributedByProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DuplicateKeyProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DataBlocksizeProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.DatabaseProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.DataDeletionProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DefinerProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.DictRange'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DictProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DynamicProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.DistKeyProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.DistStyleProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.EmptyProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.EncodeProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.properties.EngineProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.EnviromentProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.HandlerProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ParameterStyleProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ExecuteAsProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ExternalProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.FallbackProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.FileFormatProperty'>: <PropertiesLocation.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.properties.FreespaceProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.GlobalProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.HeapProperty'>: <PropertiesLocation.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.properties.HybridProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.InheritsProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.IcebergProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.IncludeProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.InputModelProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.IsolatedLoadingProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.JournalProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.LanguageProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.LikeProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.LocationProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.LockProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.LockingProperty'>: <PropertiesLocation.POST_ALIAS: 'POST_ALIAS'>, <class 'sqlglot.expressions.properties.LogProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.MaskingProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.MaterializedProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.MergeBlockRatioProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.ModuleProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.NetworkProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.NoPrimaryIndexProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.properties.OnProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.OnCommitProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.query.Order'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.OutputModelProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.PartitionedByProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.PartitionedOfProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.constraints.PrimaryKey'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.Property'>: <PropertiesLocation.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.properties.RefreshTriggerProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.RemoteWithConnectionModelProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ReturnsProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.RollupProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.RowAccessProperty'>: <PropertiesLocation.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.properties.RowFormatProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.RowFormatDelimitedProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.RowFormatSerdeProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SampleProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SchemaCommentProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SecureProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.SecurityIntegrationProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.SerdeProperties'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ddl.Set'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SettingsProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SetProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.SetConfigProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SharingProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.ddl.SequenceProperties'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.ddl.TriggerProperties'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.properties.SortKeyProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SqlReadWriteProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.SqlSecurityProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.StabilityProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.StorageHandlerProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.StreamingTableProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.StrictProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.Tags'>: <PropertiesLocation.POST_WITH: 'POST_WITH'>, <class 'sqlglot.expressions.properties.TemporaryProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.ToTableProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.TransientProperty'>: <PropertiesLocation.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.properties.TransformModelProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.ddl.MergeTreeTTL'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.UnloggedProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.UsingProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.properties.UsingTemplateProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ViewAttributeProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.VirtualProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.VolatileProperty'>: <PropertiesLocation.UNSUPPORTED: 'UNSUPPORTED'>, <class 'sqlglot.expressions.properties.WithDataProperty'>: <PropertiesLocation.POST_EXPRESSION: 'POST_EXPRESSION'>, <class 'sqlglot.expressions.properties.WithJournalTableProperty'>: <PropertiesLocation.POST_NAME: 'POST_NAME'>, <class 'sqlglot.expressions.properties.WithProcedureOptions'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.WithSchemaBindingProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.WithSystemVersioningProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.ForceProperty'>: <PropertiesLocation.POST_CREATE: 'POST_CREATE'>, <class 'sqlglot.expressions.properties.PartitionByRangeProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.PartitionByListProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>, <class 'sqlglot.expressions.properties.UniqueKeyProperty'>: <PropertiesLocation.POST_SCHEMA: 'POST_SCHEMA'>}
TRANSFORMS =
{<class 'sqlglot.expressions.query.JSONPathFilter'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathKey'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathRecursive'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathRoot'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathScript'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathSelector'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathSlice'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathSubscript'>: <function <lambda>>, <class 'sqlglot.expressions.query.JSONPathUnion'>: <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 StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.array.ArrayContainsAll'>: <function rename_func.<locals>.<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.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 Generator.<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.CredentialsProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.CurrentCatalog'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.functions.SessionUser'>: <function MySQLGenerator.<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.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.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 Generator.<lambda>>, <class 'sqlglot.expressions.properties.NoPrimaryIndexProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.constraints.NotForReplicationColumnConstraint'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.OnCommitProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.properties.OnProperty'>: <function Generator.<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 Generator.<lambda>>, <class 'sqlglot.expressions.properties.PartitionByTruncate'>: <function Generator.<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 StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.properties.StabilityProperty'>: <function Generator.<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 rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.UtcTimestamp'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.Variadic'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.array.VarMap'>: <function StarRocksGenerator.<lambda>>, <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.ForceProperty'>: <function Generator.<lambda>>, <class 'sqlglot.expressions.aggregate.ArrayAgg'>: <function rename_func.<locals>.<lambda>>, <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.string.Chr'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.CurrentDate'>: <function no_paren_current_date_sql>, <class 'sqlglot.expressions.functions.CurrentVersion'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.DateDiff'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.DateAdd'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.DateStrToDate'>: <function datestrtodate_sql>, <class 'sqlglot.expressions.temporal.DateSub'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.Day'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.DayOfMonth'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.DayOfWeek'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.DayOfYear'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.aggregate.GroupConcat'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.core.ILike'>: <function no_ilike_sql>, <class 'sqlglot.expressions.json.JSONExtractScalar'>: <function arrow_json_extract_sql>, <class 'sqlglot.expressions.string.Length'>: <function length_or_char_length_sql>, <class 'sqlglot.expressions.aggregate.LogicalOr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.LogicalAnd'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.Max'>: <function max_or_greatest>, <class 'sqlglot.expressions.aggregate.Min'>: <function min_or_least>, <class 'sqlglot.expressions.temporal.Month'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.core.NullSafeEQ'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.core.NullSafeNEQ'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.string.NumberToStr'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.Pivot'>: <function no_pivot_sql>, <class 'sqlglot.expressions.query.Select'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.string.StrPosition'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.StrToDate'>: <function _str_to_date_sql>, <class 'sqlglot.expressions.temporal.StrToTime'>: <function _str_to_date_sql>, <class 'sqlglot.expressions.string.Stuff'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.query.TableSample'>: <function no_tablesample_sql>, <class 'sqlglot.expressions.temporal.TimeFromParts'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimestampAdd'>: <function date_add_interval_sql.<locals>.func>, <class 'sqlglot.expressions.temporal.TimestampDiff'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TimestampSub'>: <function date_add_interval_sql.<locals>.func>, <class 'sqlglot.expressions.temporal.TimeStrToUnix'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.TimeStrToTime'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TimeToStr'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.math.Trunc'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.functions.TryCast'>: <function no_trycast_sql>, <class 'sqlglot.expressions.temporal.TsOrDsAdd'>: <function date_add_sql.<locals>.func>, <class 'sqlglot.expressions.temporal.TsOrDsDiff'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TsOrDsToDate'>: <function _ts_or_ds_to_date_sql>, <class 'sqlglot.expressions.string.Unicode'>: <function MySQLGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.UnixToTime'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.Week'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.WeekOfYear'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.temporal.Year'>: <function _remove_ts_or_ds_to_date.<locals>.func>, <class 'sqlglot.expressions.aggregate.ArgMax'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.aggregate.ArgMin'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.Array'>: <function inline_array_sql>, <class 'sqlglot.expressions.array.ArrayFilter'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.array.ArrayToString'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.core.ApproxDistinct'>: <function approx_count_distinct_sql>, <class 'sqlglot.expressions.dml.Delete'>: <function preprocess.<locals>._to_sql>, <class 'sqlglot.expressions.array.Flatten'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.json.JSONExtract'>: <function arrow_json_extract_sql>, <class 'sqlglot.expressions.array.Map'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.properties.Property'>: <function property_sql>, <class 'sqlglot.expressions.core.RegexpLike'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.properties.SchemaCommentProperty'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.array.StDistance'>: <function st_distance_sphere>, <class 'sqlglot.expressions.temporal.StrToUnix'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TimestampTrunc'>: <function StarRocksGenerator.<lambda>>, <class 'sqlglot.expressions.temporal.TimeStrToDate'>: <function rename_func.<locals>.<lambda>>, <class 'sqlglot.expressions.temporal.UnixToStr'>: <function StarRocksGenerator.<lambda>>}
RESERVED_KEYWORDS =
{'analyze', 'to', 'release', 'load', 'char', 'having', 'rlike', 'last_value', 'bigint', 'schemas', 'select', 'create', 'inner', 'percentile', 'character', 'array', 'show', 'when', 'rank', 'host', 'explain', 'json', 'current_user', 'from', 'unique', 'then', 'set', 'else', 'current_time', 'lead', 'text', 'range', 'null', 'by', 'dense_rank', 'primary', 'int', 'row_number', 'float', 'force', 'index', 'decimal', 'lag', 'with', 'values', 'current_role', 'except', 'largeint', 'procedure', 'outer', 'union', 'group', 'decimal128', 'on', 'decimalv2', 'over', 'right', 'for', 'in', 'infile', 'distinct', 'left', 'deferred', 'collate', 'grouping', 'keys', 'is', 'decimal64', 'read', 'convert', 'column', 'using', 'bitmap', 'and', 'like', 'cross', 'as', 'current_timestamp', 'both', 'case', 'varchar', 'database', 'ntile', 'schema', 'row', 'false', 'groups', 'compaction', 'databases', 'minus', 'into', 'hll', 'double', 'system', 'current_date', 'or', 'regexp', 'cube', 'full', 'grouping_id', 'integer', 'tinyint', 'order', 'table', 'alter', 'describe', 'localtime', 'ignore', 'grant', 'between', 'add', 'rename', 'kill', 'dual', 'use', 'rows', 'intersect', 'true', 'revoke', 'mod', 'function', 'insert', 'exists', 'desc', 'check', 'replace', 'default', 'decimal32', 'set_var', 'smallint', 'immediate', 'limit', 'first_value', 'join', 'localtimestamp', 'delete', 'unsigned', 'maxvalue', 'asc', 'lateral', 'all', 'terminated', 'outfile', 'drop', 'where', 'partition', 'key', 'not', 'qualify', 'update', 'if'}
291 def create_sql(self, expression: exp.Create) -> str: 292 # Starrocks' primary key is defined outside of the schema, so we need to move it there 293 schema = expression.this 294 if isinstance(schema, exp.Schema): 295 primary_key = schema.find(exp.PrimaryKey) 296 297 if primary_key: 298 props = expression.args.get("properties") 299 300 if not props: 301 props = exp.Properties(expressions=[]) 302 expression.set("properties", props) 303 304 # Verify if the first one is an engine property. Is true then insert it after the engine, 305 # otherwise insert it at the beginning 306 engine = props.find(exp.EngineProperty) 307 engine_index = (engine.index or 0) if engine else -1 308 props.set("expressions", primary_key.pop(), engine_index + 1, overwrite=False) 309 310 return super().create_sql(expression)
def
partitionedbyproperty_sql( self, expression: sqlglot.expressions.properties.PartitionedByProperty) -> str:
312 def partitionedbyproperty_sql(self, expression: exp.PartitionedByProperty) -> str: 313 this = expression.this 314 if isinstance(this, exp.Schema): 315 # For MVs, StarRocks needs outer parentheses. 316 create = expression.find_ancestor(exp.Create) 317 318 sql = self.expressions(this, flat=True) 319 if (create and create.kind == "VIEW") or all( 320 isinstance(col, (exp.Column, exp.Identifier)) for col in this.expressions 321 ): 322 sql = f"({sql})" 323 324 return f"PARTITION BY {sql}" 325 326 return f"PARTITION BY {self.sql(this)}"
328 def clusterproperty_sql(self, expression: exp.ClusterProperty) -> str: 329 """Generate StarRocks ORDER BY clause for clustering.""" 330 if expression.this: 331 self.unsupported(f"Unsupported CLUSTER BY {self.sql(expression, 'this')}") 332 return "" 333 expressions = self.expressions(expression, flat=True) 334 return f"ORDER BY ({expressions})"
Generate StarRocks ORDER BY clause for clustering.
def
refreshtriggerproperty_sql( self, expression: sqlglot.expressions.properties.RefreshTriggerProperty) -> str:
336 def refreshtriggerproperty_sql(self, expression: exp.RefreshTriggerProperty) -> str: 337 """Generate StarRocks REFRESH clause for materialized views. 338 There is a little difference of the syntax between StarRocks and Doris. 339 """ 340 method = self.sql(expression, "method") 341 method = f" {method}" if method else "" 342 kind = self.sql(expression, "kind") 343 kind = f" {kind}" if kind else "" 344 starts = self.sql(expression, "starts") 345 starts = f" START ({starts})" if starts else "" 346 every = self.sql(expression, "every") 347 unit = self.sql(expression, "unit") 348 every = f" EVERY (INTERVAL {every} {unit})" if every and unit else "" 349 350 return f"REFRESH{method}{kind}{starts}{every}"
Generate StarRocks REFRESH clause for materialized views. There is a little difference of the syntax between StarRocks and Doris.
Inherited Members
- sqlglot.generator.Generator
- Generator
- WINDOW_FUNCS_WITH_NULL_ORDERING
- IGNORE_NULLS_IN_FUNC
- IGNORE_NULLS_BEFORE_ORDER
- CREATE_FUNCTION_RETURN_AS
- MATCHED_BY_SOURCE
- SUPPORTS_MERGE_WHERE
- SINGLE_STRING_INTERVAL
- GROUPINGS_SEP
- INDEX_ON
- INOUT_SEPARATOR
- DIRECTED_JOINS
- QUERY_HINTS
- LIMIT_IS_TOP
- RETURNING_END
- EXTRACT_ALLOWS_QUOTES
- TZ_TO_WITH_TIME_ZONE
- ALTER_TABLE_INCLUDE_COLUMN_KEYWORD
- UNNEST_WITH_ORDINALITY
- AGGREGATE_FILTER_SUPPORTED
- SEMI_ANTI_JOIN_WITH_SIDE
- COMPUTED_COLUMN_WITH_TYPE
- SUPPORTS_TABLE_COPY
- TABLESAMPLE_REQUIRES_PARENS
- TABLESAMPLE_SIZE_IS_ROWS
- TABLESAMPLE_KEYWORDS
- TABLESAMPLE_WITH_METHOD
- TABLESAMPLE_SEED_KEYWORD
- COLLATE_IS_FUNC
- DATA_TYPE_SPECIFIERS_ALLOWED
- ENSURE_BOOLS
- CTE_RECURSIVE_KEYWORD_REQUIRED
- SUPPORTS_SINGLE_ARG_CONCAT
- SUPPORTS_TABLE_ALIAS_COLUMNS
- SUPPORTS_NAMED_CTE_COLUMNS
- UNPIVOT_ALIASES_ARE_IDENTIFIERS
- SUPPORTS_SELECT_INTO
- SUPPORTS_UNLOGGED_TABLES
- SUPPORTS_CREATE_TABLE_LIKE
- LIKE_PROPERTY_INSIDE_SCHEMA
- MULTI_ARG_DISTINCT
- JSON_PATH_SINGLE_QUOTE_ESCAPE
- JSON_PATH_KEY_QUOTED_FORCES_BRACKETS
- SUPPORTED_JSON_PATH_PARTS
- CAN_IMPLEMENT_ARRAY_ANY
- SUPPORTS_WINDOW_EXCLUDE
- SET_OP_MODIFIERS
- 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
- SUPPORTS_CONVERT_TIMEZONE
- SUPPORTS_UNIX_SECONDS
- ALTER_SET_WRAPPED
- NORMALIZE_EXTRACT_DATE_PARTS
- ARRAY_SIZE_NAME
- ALTER_SET_TYPE
- ARRAY_SIZE_DIM_REQUIRED
- SUPPORTS_BETWEEN_FLAGS
- SUPPORTS_LIKE_QUANTIFIERS
- MATCH_AGAINST_TABLE_PREFIX
- SET_ASSIGNMENT_REQUIRES_VARIABLE_KEYWORD
- DECLARE_DEFAULT_ASSIGNMENT
- STAR_EXCLUDE_REQUIRES_DERIVED_TABLE
- SUPPORTS_DROP_ALTER_ICEBERG_PROPERTY
- UNSUPPORTED_TYPES
- TYPE_PARAM_SETTINGS
- TIME_PART_SINGULARS
- TOKEN_MAPPING
- STRUCT_DELIMITER
- PARAMETER_TOKEN
- NAMED_PLACEHOLDER_TOKEN
- EXPRESSION_PRECEDES_PROPERTIES_CREATABLES
- WITH_SEPARATED_COMMENTS
- EXCLUDE_COMMENTS
- UNWRAPPED_INTERVAL_VALUES
- PARAMETERIZABLE_TEXT_TYPES
- EXPRESSIONS_WITHOUT_NESTED_CTES
- RESPECT_IGNORE_NULLS_UNSUPPORTED_EXPRESSIONS
- SAFE_JSON_PATH_KEY_RE
- 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
- columndef_sql
- columnconstraint_sql
- autoincrementcolumnconstraint_sql
- compresscolumnconstraint_sql
- generatedasidentitycolumnconstraint_sql
- generatedasrowcolumnconstraint_sql
- periodforsystemtimeconstraint_sql
- notnullcolumnconstraint_sql
- primarykeycolumnconstraint_sql
- uniquecolumnconstraint_sql
- inoutcolumnconstraint_sql
- createable_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
- hint_sql
- indexparameters_sql
- index_sql
- dynamicidentifier_sql
- identifier_sql
- hex_sql
- lowerhex_sql
- inputoutputformat_sql
- national_sql
- properties_sql
- root_properties
- properties
- with_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
- 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
- tablefromrows_sql
- tablesample_sql
- pivot_sql
- version_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
- connect_sql
- prior_sql
- join_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
- 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_sql
- schema_columns_sql
- star_sql
- parameter_sql
- sessionparameter_sql
- placeholder_sql
- subquery_sql
- qualify_sql
- unnest_sql
- prewhere_sql
- where_sql
- window_sql
- partition_by_sql
- windowspec_sql
- withingroup_sql
- between_sql
- bracket_offset_expressions
- bracket_sql
- all_sql
- any_sql
- exists_sql
- case_sql
- constraint_sql
- nextvaluefor_sql
- trim_sql
- convert_concat_args
- concat_sql
- concatws_sql
- check_sql
- foreignkey_sql
- primarykey_sql
- if_sql
- matchagainst_sql
- jsonkeyvalue_sql
- jsonpath_sql
- json_path_part
- formatjson_sql
- formatphrase_sql
- jsonarray_sql
- jsonarrayagg_sql
- jsoncolumndef_sql
- jsonschema_sql
- jsontable_sql
- openjsoncolumndef_sql
- openjson_sql
- in_sql
- in_unnest_op
- interval_sql
- return_sql
- reference_sql
- anonymous_sql
- paren_sql
- neg_sql
- not_sql
- alias_sql
- pivotalias_sql
- aliases_sql
- atindex_sql
- fromtimezone_sql
- fromiso8601date_sql
- fromiso8601timestamp_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
- parsedatetime_sql
- currentdate_sql
- collate_sql
- command_sql
- comment_sql
- mergetreettlaction_sql
- mergetreettl_sql
- transaction_sql
- commit_sql
- rollback_sql
- modifycolumn_sql
- alterindex_sql
- alterdiststyle_sql
- altersortkey_sql
- renamecolumn_sql
- alterset_sql
- alter_sql
- altersession_sql
- add_column_sql
- droppartition_sql
- dropprimarykey_sql
- addconstraint_sql
- addpartition_sql
- distinct_sql
- respectnulls_sql
- havingmax_sql
- intdiv_sql
- div_sql
- safedivide_sql
- overlaps_sql
- distance_sql
- distancend_sql
- dot_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
- func
- format_args
- too_wide
- format_time
- 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
- duplicatekeyproperty_sql
- uniquekeyproperty_sql
- distributedbyproperty_sql
- oncluster_sql
- clusteredbyproperty_sql
- anyvalue_sql
- querytransform_sql
- indexconstraintoption_sql
- checkcolumnconstraint_sql
- indexcolumnconstraint_sql
- nvl2_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
- dateadd_sql
- arrayany_sql
- struct_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
- json_sql
- jsonvalue_sql
- skipjsoncolumn_sql
- conditionalinsert_sql
- multitableinserts_sql
- oncondition_sql
- jsonextractquote_sql
- jsonexists_sql
- arrayagg_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
- arraysize_sql
- attach_sql
- detach_sql
- attachoption_sql
- watermarkcolumnconstraint_sql
- encodeproperty_sql
- includeproperty_sql
- xmlelement_sql
- xmlkeyvalueoption_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
- install_sql
- get_put_sql
- translatecharacters_sql
- decodecase_sql
- semanticview_sql
- getextract_sql
- datefromunixdate_sql
- space_sql
- buildproperty_sql
- modelattribute_sql
- directorystage_sql
- uuid_sql
- initcap_sql
- localtime_sql
- localtimestamp_sql
- weekstart_sql
- chr_sql
- block_sql
- storedprocedure_sql
- ifblock_sql
- whileblock_sql
- execute_sql
- executesql_sql
- altermodifysqlsecurity_sql
- usingproperty_sql
- renameindex_sql
- sqlglot.generators.mysql.MySQLGenerator
- SELECT_KINDS
- TRY_SUPPORTED
- SUPPORTS_UESCAPE
- SUPPORTS_DECODE_CASE
- SUPPORTS_MODIFY_COLUMN
- SUPPORTS_CHANGE_COLUMN
- AFTER_HAVING_MODIFIER_TRANSFORMS
- INTERVAL_ALLOWS_PLURAL_FORM
- LOCKING_READS_SUPPORTED
- NULL_ORDERING_SUPPORTED
- JOIN_HINTS
- TABLE_HINTS
- DUPLICATE_KEY_UPDATE_WITH_SET
- QUERY_HINT_SEP
- VALUES_AS_TABLE
- NVL2_SUPPORTED
- LAST_DAY_SUPPORTS_DATE_PART
- JSON_PATH_BRACKETED_KEY_SUPPORTED
- JSON_KEY_VALUE_PAIR_SEP
- SUPPORTS_TO_NUMBER
- PAD_FILL_PATTERN_IS_REQUIRED
- WRAP_DERIVED_VALUES
- SUPPORTS_MEDIAN
- UNSIGNED_TYPE_MAPPING
- TIMESTAMP_TYPE_MAPPING
- LIMIT_FETCH
- LIMIT_ONLY_LITERALS
- CHAR_CAST_MAPPING
- SIGNED_CAST_MAPPING
- TIMESTAMP_FUNC_TYPES
- makeinterval_sql
- locate_properties
- computedcolumnconstraint_sql
- array_sql
- arraycontainsall_sql
- arraycontainedby_sql
- dpipe_sql
- extract_sql
- datatype_sql
- jsonarraycontains_sql
- cast_sql
- show_sql
- alterrename_sql
- altercolumn_sql
- timestamptrunc_sql
- converttimezone_sql
- attimezone_sql
- isascii_sql
- ignorenulls_sql
- currentschema_sql
- partition_sql
- partitionbyrangeproperty_sql
- partitionbylistproperty_sql
- partitionlist_sql
- partitionrange_sql