Merging upstream version 17.11.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
2bd548fc43
commit
14ca349bca
69 changed files with 30974 additions and 30030 deletions
|
@ -17,6 +17,13 @@ class StarRocks(MySQL):
|
|||
"DATE_TRUNC": lambda args: exp.TimestampTrunc(
|
||||
this=seq_get(args, 1), unit=seq_get(args, 0)
|
||||
),
|
||||
"DATEDIFF": lambda args: exp.DateDiff(
|
||||
this=seq_get(args, 0), expression=seq_get(args, 1), unit=exp.Literal.string("DAY")
|
||||
),
|
||||
"DATE_DIFF": lambda args: exp.DateDiff(
|
||||
this=seq_get(args, 1), expression=seq_get(args, 2), unit=seq_get(args, 0)
|
||||
),
|
||||
"REGEXP": exp.RegexpLike.from_arg_list,
|
||||
}
|
||||
|
||||
class Generator(MySQL.Generator):
|
||||
|
@ -32,9 +39,11 @@ class StarRocks(MySQL):
|
|||
TRANSFORMS = {
|
||||
**MySQL.Generator.TRANSFORMS,
|
||||
exp.ApproxDistinct: approx_count_distinct_sql,
|
||||
exp.DateDiff: lambda self, e: self.func(
|
||||
"DATE_DIFF", exp.Literal.string(e.text("unit") or "DAY"), e.this, e.expression
|
||||
),
|
||||
exp.JSONExtractScalar: arrow_json_extract_sql,
|
||||
exp.JSONExtract: arrow_json_extract_sql,
|
||||
exp.DateDiff: rename_func("DATEDIFF"),
|
||||
exp.RegexpLike: rename_func("REGEXP"),
|
||||
exp.StrToUnix: lambda self, e: f"UNIX_TIMESTAMP({self.sql(e, 'this')}, {self.format_time(e)})",
|
||||
exp.TimestampTrunc: lambda self, e: self.func(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue