diff options
Diffstat (limited to 'sqlglot/dialects/starrocks.py')
-rw-r--r-- | sqlglot/dialects/starrocks.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sqlglot/dialects/starrocks.py b/sqlglot/dialects/starrocks.py index 0cba6fe..3519c09 100644 --- a/sqlglot/dialects/starrocks.py +++ b/sqlglot/dialects/starrocks.py @@ -1,10 +1,12 @@ +from __future__ import annotations + from sqlglot import exp from sqlglot.dialects.dialect import arrow_json_extract_sql, rename_func from sqlglot.dialects.mysql import MySQL class StarRocks(MySQL): - class Generator(MySQL.Generator): + class Generator(MySQL.Generator): # type: ignore TYPE_MAPPING = { **MySQL.Generator.TYPE_MAPPING, exp.DataType.Type.TEXT: "STRING", @@ -13,7 +15,7 @@ class StarRocks(MySQL): } TRANSFORMS = { - **MySQL.Generator.TRANSFORMS, + **MySQL.Generator.TRANSFORMS, # type: ignore exp.JSONExtractScalar: arrow_json_extract_sql, exp.JSONExtract: arrow_json_extract_sql, exp.DateDiff: rename_func("DATEDIFF"), @@ -22,3 +24,4 @@ class StarRocks(MySQL): exp.UnixToStr: lambda self, e: f"FROM_UNIXTIME({self.sql(e, 'this')}, {self.format_time(e)})", exp.UnixToTime: rename_func("FROM_UNIXTIME"), } + TRANSFORMS.pop(exp.DateTrunc) |