1
0
Fork 0

Adding upstream version 25.29.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:56:11 +01:00
parent dfac4c492f
commit c61927f460
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
97 changed files with 64720 additions and 61752 deletions

View file

@ -4312,6 +4312,7 @@ class DataType(Expression):
DECIMAL32 = auto()
DECIMAL64 = auto()
DECIMAL128 = auto()
DECIMAL256 = auto()
DOUBLE = auto()
ENUM = auto()
ENUM8 = auto()
@ -4320,6 +4321,12 @@ class DataType(Expression):
FLOAT = auto()
GEOGRAPHY = auto()
GEOMETRY = auto()
POINT = auto()
RING = auto()
LINESTRING = auto()
MULTILINESTRING = auto()
POLYGON = auto()
MULTIPOLYGON = auto()
HLLSKETCH = auto()
HSTORE = auto()
IMAGE = auto()
@ -4467,6 +4474,7 @@ class DataType(Expression):
Type.DECIMAL32,
Type.DECIMAL64,
Type.DECIMAL128,
Type.DECIMAL256,
Type.MONEY,
Type.SMALLMONEY,
Type.UDECIMAL,
@ -4597,10 +4605,6 @@ class Any(SubqueryPredicate):
pass
class Exists(SubqueryPredicate):
pass
# Commands to interact with the databases or engines. For most of the command
# expressions we parse whatever comes after the command's name as a string.
class Command(Expression):
@ -5276,6 +5280,11 @@ class ArrayToString(Func):
_sql_names = ["ARRAY_TO_STRING", "ARRAY_JOIN"]
# https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#string
class String(Func):
arg_types = {"this": True, "zone": False}
class StringToArray(Func):
arg_types = {"this": True, "expression": True, "null": False}
_sql_names = ["STRING_TO_ARRAY", "SPLIT_BY_STRING"]
@ -5494,11 +5503,17 @@ class DateTrunc(Func):
arg_types = {"unit": True, "this": True, "zone": False}
def __init__(self, **args):
# Across most dialects it's safe to unabbreviate the unit (e.g. 'Q' -> 'QUARTER') except Oracle
# https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/ROUND-and-TRUNC-Date-Functions.html
unabbreviate = args.pop("unabbreviate", True)
unit = args.get("unit")
if isinstance(unit, TimeUnit.VAR_LIKE):
args["unit"] = Literal.string(
(TimeUnit.UNABBREVIATED_UNIT_NAME.get(unit.name) or unit.name).upper()
)
unit_name = unit.name.upper()
if unabbreviate and unit_name in TimeUnit.UNABBREVIATED_UNIT_NAME:
unit_name = TimeUnit.UNABBREVIATED_UNIT_NAME[unit_name]
args["unit"] = Literal.string(unit_name)
elif isinstance(unit, Week):
unit.set("this", Literal.string(unit.this.name.upper()))
@ -5570,6 +5585,10 @@ class Extract(Func):
arg_types = {"this": True, "expression": True}
class Exists(Func, SubqueryPredicate):
arg_types = {"this": True, "expression": False}
class Timestamp(Func):
arg_types = {"this": False, "zone": False, "with_tz": False}
@ -5746,8 +5765,14 @@ class Greatest(Func):
is_var_len_args = True
# Trino's `ON OVERFLOW TRUNCATE [filler_string] {WITH | WITHOUT} COUNT`
# https://trino.io/docs/current/functions/aggregate.html#listagg
class OverflowTruncateBehavior(Expression):
arg_types = {"this": False, "with_count": True}
class GroupConcat(AggFunc):
arg_types = {"this": True, "separator": False}
arg_types = {"this": True, "separator": False, "on_overflow": False}
class Hex(Func):
@ -5947,6 +5972,11 @@ class JSONBContains(Binary, Func):
_sql_names = ["JSONB_CONTAINS"]
class JSONBExists(Func):
arg_types = {"this": True, "path": True}
_sql_names = ["JSONB_EXISTS"]
class JSONExtract(Binary, Func):
arg_types = {
"this": True,
@ -6025,6 +6055,7 @@ class Levenshtein(Func):
"ins_cost": False,
"del_cost": False,
"sub_cost": False,
"max_dist": False,
}
@ -6116,6 +6147,10 @@ class MD5Digest(Func):
_sql_names = ["MD5_DIGEST"]
class Median(AggFunc):
pass
class Min(AggFunc):
arg_types = {"this": True, "expressions": False}
is_var_len_args = True
@ -6198,11 +6233,11 @@ class Reduce(Func):
class RegexpExtract(Func):
arg_types = {
"this": True,
"expression": True,
"position": False,
"occurrence": False,
"parameters": False,
"group": False,
"expression": True, # The pattern
"position": False, # Only start searching the string from this index
"occurrence": False, # Skip the first `occurence-1` matches
"parameters": False, # Flags, eg "i" for case-insensitive
"group": False, # Which group to return
}