1
0
Fork 0

Merging upstream version 17.11.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 20:51:40 +01:00
parent 2bd548fc43
commit 14ca349bca
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
69 changed files with 30974 additions and 30030 deletions

View file

@ -77,7 +77,7 @@ class ClickHouse(Dialect):
FUNCTION_PARSERS.pop("MATCH")
NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
NO_PAREN_FUNCTION_PARSERS.pop(TokenType.ANY)
NO_PAREN_FUNCTION_PARSERS.pop("ANY")
RANGE_PARSERS = {
**parser.Parser.RANGE_PARSERS,
@ -355,6 +355,7 @@ class ClickHouse(Dialect):
def safeconcat_sql(self, expression: exp.SafeConcat) -> str:
# Clickhouse errors out if we try to cast a NULL value to TEXT
expression = expression.copy()
return self.func(
"CONCAT",
*[
@ -389,11 +390,7 @@ class ClickHouse(Dialect):
def oncluster_sql(self, expression: exp.OnCluster) -> str:
return f"ON CLUSTER {self.sql(expression, 'this')}"
def createable_sql(
self,
expression: exp.Create,
locations: dict[exp.Properties.Location, list[exp.Property]],
) -> str:
def createable_sql(self, expression: exp.Create, locations: t.DefaultDict) -> str:
kind = self.sql(expression, "kind").upper()
if kind in self.ON_CLUSTER_TARGETS and locations.get(exp.Properties.Location.POST_NAME):
this_name = self.sql(expression.this, "this")
@ -402,4 +399,5 @@ class ClickHouse(Dialect):
)
this_schema = self.schema_columns_sql(expression.this)
return f"{this_name}{self.sep()}{this_properties}{self.sep()}{this_schema}"
return super().createable_sql(expression, locations)