Merging upstream version 26.10.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f2e3d707cd
commit
273cfbc19c
66 changed files with 79349 additions and 76628 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue