Adding upstream version 10.0.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
24752785d9
commit
1e860cc299
98 changed files with 4080 additions and 1666 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue