1
0
Fork 0

Merging upstream version 26.10.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-03-17 07:38:58 +01:00
parent f2e3d707cd
commit 273cfbc19c
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
66 changed files with 79349 additions and 76628 deletions

View file

@ -1856,3 +1856,17 @@ def groupconcat_sql(
listagg.set("expressions", [f"{args}{self.sql(expression=expression.this)}"])
return self.sql(listagg)
def build_timetostr_or_tochar(args: t.List, dialect: Dialect) -> exp.TimeToStr | exp.ToChar:
this = seq_get(args, 0)
if this and not this.type:
from sqlglot.optimizer.annotate_types import annotate_types
annotate_types(this)
if this.is_type(*exp.DataType.TEMPORAL_TYPES):
dialect_name = dialect.__class__.__name__.lower()
return build_formatted_time(exp.TimeToStr, dialect_name, default=True)(args)
return exp.ToChar.from_arg_list(args)