Merging upstream version 25.24.5.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f2b92bd29a
commit
1763c7a4ef
80 changed files with 61531 additions and 59444 deletions
|
@ -577,7 +577,6 @@ class Dialect(metaclass=_Dialect):
|
|||
exp.DataType.Type.DOUBLE: {
|
||||
exp.ApproxQuantile,
|
||||
exp.Avg,
|
||||
exp.Div,
|
||||
exp.Exp,
|
||||
exp.Ln,
|
||||
exp.Log,
|
||||
|
@ -689,9 +688,10 @@ class Dialect(metaclass=_Dialect):
|
|||
exp.GenerateTimestampArray: lambda self, e: self._annotate_with_type(
|
||||
e, exp.DataType.build("ARRAY<TIMESTAMP>")
|
||||
),
|
||||
exp.Greatest: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
||||
exp.If: lambda self, e: self._annotate_by_args(e, "true", "false"),
|
||||
exp.Interval: lambda self, e: self._annotate_with_type(e, exp.DataType.Type.INTERVAL),
|
||||
exp.Least: lambda self, e: self._annotate_by_args(e, "expressions"),
|
||||
exp.Least: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
||||
exp.Literal: lambda self, e: self._annotate_literal(e),
|
||||
exp.Map: lambda self, e: self._annotate_map(e),
|
||||
exp.Max: lambda self, e: self._annotate_by_args(e, "this", "expressions"),
|
||||
|
@ -1052,7 +1052,10 @@ def property_sql(self: Generator, expression: exp.Property) -> str:
|
|||
|
||||
|
||||
def str_position_sql(
|
||||
self: Generator, expression: exp.StrPosition, generate_instance: bool = False
|
||||
self: Generator,
|
||||
expression: exp.StrPosition,
|
||||
generate_instance: bool = False,
|
||||
str_position_func_name: str = "STRPOS",
|
||||
) -> str:
|
||||
this = self.sql(expression, "this")
|
||||
substr = self.sql(expression, "substr")
|
||||
|
@ -1065,7 +1068,7 @@ def str_position_sql(
|
|||
this = self.func("SUBSTR", this, position)
|
||||
position_offset = f" + {position} - 1"
|
||||
|
||||
return self.func("STRPOS", this, substr, instance) + position_offset
|
||||
return self.func(str_position_func_name, this, substr, instance) + position_offset
|
||||
|
||||
|
||||
def struct_extract_sql(self: Generator, expression: exp.StructExtract) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue