1
0
Fork 0

Adding upstream version 26.3.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 22:00:18 +01:00
parent 7ee28625fb
commit b80c44840a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
89 changed files with 59179 additions and 57645 deletions

View file

@ -16,14 +16,13 @@ from sqlglot.dialects.dialect import (
left_to_substring_sql,
no_ilike_sql,
no_pivot_sql,
no_safe_divide_sql,
no_timestamp_sql,
regexp_extract_sql,
rename_func,
right_to_substring_sql,
sha256_sql,
strposition_sql,
struct_extract_sql,
str_position_sql,
timestamptrunc_sql,
timestrtotime_sql,
ts_or_ds_add_cast,
@ -292,7 +291,7 @@ class Presto(Dialect):
"SET_AGG": exp.ArrayUniqueAgg.from_arg_list,
"SPLIT_TO_MAP": exp.StrToMap.from_arg_list,
"STRPOS": lambda args: exp.StrPosition(
this=seq_get(args, 0), substr=seq_get(args, 1), instance=seq_get(args, 2)
this=seq_get(args, 0), substr=seq_get(args, 1), occurrence=seq_get(args, 2)
),
"TO_CHAR": _build_to_char,
"TO_UNIXTIME": exp.TimeToUnix.from_arg_list,
@ -418,7 +417,6 @@ class Presto(Dialect):
exp.RegexpExtract: regexp_extract_sql,
exp.RegexpExtractAll: regexp_extract_sql,
exp.Right: right_to_substring_sql,
exp.SafeDivide: no_safe_divide_sql,
exp.Schema: _schema_sql,
exp.SchemaCommentProperty: lambda self, e: self.naked_property(e),
exp.Select: transforms.preprocess(
@ -430,7 +428,7 @@ class Presto(Dialect):
]
),
exp.SortArray: _no_sort_array,
exp.StrPosition: lambda self, e: str_position_sql(self, e, generate_instance=True),
exp.StrPosition: lambda self, e: strposition_sql(self, e, supports_occurrence=True),
exp.StrToDate: lambda self, e: f"CAST({_str_to_time_sql(self, e)} AS DATE)",
exp.StrToMap: rename_func("SPLIT_TO_MAP"),
exp.StrToTime: _str_to_time_sql,