Merging upstream version 18.4.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b982664fe2
commit
d90681de49
92 changed files with 43076 additions and 40554 deletions
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import typing as t
|
||||
from enum import Enum
|
||||
from functools import reduce
|
||||
|
||||
from sqlglot import exp
|
||||
from sqlglot._typing import E
|
||||
|
@ -656,11 +657,18 @@ def ts_or_ds_to_date_sql(dialect: str) -> t.Callable:
|
|||
|
||||
def concat_to_dpipe_sql(self: Generator, expression: exp.Concat | exp.SafeConcat) -> str:
|
||||
expression = expression.copy()
|
||||
this, *rest_args = expression.expressions
|
||||
for arg in rest_args:
|
||||
this = exp.DPipe(this=this, expression=arg)
|
||||
return self.sql(reduce(lambda x, y: exp.DPipe(this=x, expression=y), expression.expressions))
|
||||
|
||||
return self.sql(this)
|
||||
|
||||
def concat_ws_to_dpipe_sql(self: Generator, expression: exp.ConcatWs) -> str:
|
||||
expression = expression.copy()
|
||||
delim, *rest_args = expression.expressions
|
||||
return self.sql(
|
||||
reduce(
|
||||
lambda x, y: exp.DPipe(this=x, expression=exp.DPipe(this=delim, expression=y)),
|
||||
rest_args,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def regexp_extract_sql(self: Generator, expression: exp.RegexpExtract) -> str:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue