Merging upstream version 19.0.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
348b067e1b
commit
89acb78953
91 changed files with 45416 additions and 43096 deletions
|
@ -36,7 +36,6 @@ def _approx_distinct_sql(self: Presto.Generator, expression: exp.ApproxDistinct)
|
|||
|
||||
def _explode_to_unnest_sql(self: Presto.Generator, expression: exp.Lateral) -> str:
|
||||
if isinstance(expression.this, exp.Explode):
|
||||
expression = expression.copy()
|
||||
return self.sql(
|
||||
exp.Join(
|
||||
this=exp.Unnest(
|
||||
|
@ -72,7 +71,6 @@ def _schema_sql(self: Presto.Generator, expression: exp.Schema) -> str:
|
|||
for schema in expression.parent.find_all(exp.Schema):
|
||||
column_defs = schema.find_all(exp.ColumnDef)
|
||||
if column_defs and isinstance(schema.parent, exp.Property):
|
||||
expression = expression.copy()
|
||||
expression.expressions.extend(column_defs)
|
||||
|
||||
return self.schema_sql(expression)
|
||||
|
@ -407,12 +405,10 @@ class Presto(Dialect):
|
|||
target_type = None
|
||||
|
||||
if target_type and target_type.is_type("timestamp"):
|
||||
to = target_type.copy()
|
||||
|
||||
if target_type is start.to:
|
||||
end = exp.cast(end, to)
|
||||
end = exp.cast(end, target_type)
|
||||
else:
|
||||
start = exp.cast(start, to)
|
||||
start = exp.cast(start, target_type)
|
||||
|
||||
return self.func("SEQUENCE", start, end, step)
|
||||
|
||||
|
@ -432,6 +428,5 @@ class Presto(Dialect):
|
|||
kind = expression.args["kind"]
|
||||
schema = expression.this
|
||||
if kind == "VIEW" and schema.expressions:
|
||||
expression = expression.copy()
|
||||
expression.this.set("expressions", None)
|
||||
return super().create_sql(expression)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue