Adding upstream version 25.30.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c61927f460
commit
44a4f87ffd
69 changed files with 48139 additions and 46098 deletions
|
@ -13,6 +13,7 @@ from sqlglot.dialects.dialect import (
|
|||
)
|
||||
from sqlglot.dialects.mysql import date_add_sql
|
||||
from sqlglot.transforms import preprocess, move_schema_columns_to_partitioned_by
|
||||
from sqlglot.generator import unsupported_args
|
||||
|
||||
|
||||
def _str_to_date(self: Drill.Generator, expression: exp.StrToDate) -> str:
|
||||
|
@ -78,8 +79,10 @@ class Drill(Dialect):
|
|||
|
||||
FUNCTIONS = {
|
||||
**parser.Parser.FUNCTIONS,
|
||||
"REPEATED_COUNT": exp.ArraySize.from_arg_list,
|
||||
"TO_TIMESTAMP": exp.TimeStrToTime.from_arg_list,
|
||||
"TO_CHAR": build_formatted_time(exp.TimeToStr, "drill"),
|
||||
"LEVENSHTEIN_DISTANCE": exp.Levenshtein.from_arg_list,
|
||||
}
|
||||
|
||||
LOG_DEFAULTS_TO_LN = True
|
||||
|
@ -91,6 +94,7 @@ class Drill(Dialect):
|
|||
NVL2_SUPPORTED = False
|
||||
LAST_DAY_SUPPORTS_DATE_PART = False
|
||||
SUPPORTS_CREATE_TABLE_LIKE = False
|
||||
ARRAY_SIZE_NAME = "REPEATED_COUNT"
|
||||
|
||||
TYPE_MAPPING = {
|
||||
**generator.Generator.TYPE_MAPPING,
|
||||
|
@ -115,7 +119,6 @@ class Drill(Dialect):
|
|||
**generator.Generator.TRANSFORMS,
|
||||
exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
|
||||
exp.ArrayContains: rename_func("REPEATED_CONTAINS"),
|
||||
exp.ArraySize: rename_func("REPEATED_COUNT"),
|
||||
exp.Create: preprocess([move_schema_columns_to_partitioned_by]),
|
||||
exp.DateAdd: date_add_sql("ADD"),
|
||||
exp.DateStrToDate: datestrtodate_sql,
|
||||
|
@ -127,7 +130,9 @@ class Drill(Dialect):
|
|||
exp.If: lambda self,
|
||||
e: f"`IF`({self.format_args(e.this, e.args.get('true'), e.args.get('false'))})",
|
||||
exp.ILike: lambda self, e: self.binary(e, "`ILIKE`"),
|
||||
exp.Levenshtein: rename_func("LEVENSHTEIN_DISTANCE"),
|
||||
exp.Levenshtein: unsupported_args("ins_cost", "del_cost", "sub_cost", "max_dist")(
|
||||
rename_func("LEVENSHTEIN_DISTANCE")
|
||||
),
|
||||
exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
|
||||
exp.RegexpLike: rename_func("REGEXP_MATCHES"),
|
||||
exp.StrPosition: str_position_sql,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue