Merging upstream version 11.3.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
f223c02081
commit
1c10961499
62 changed files with 26499 additions and 24781 deletions
|
@ -360,10 +360,9 @@ def create_with_partitions_sql(self: Generator, expression: exp.Create) -> str:
|
|||
if has_schema and is_partitionable:
|
||||
expression = expression.copy()
|
||||
prop = expression.find(exp.PartitionedByProperty)
|
||||
this = prop and prop.this
|
||||
if prop and not isinstance(this, exp.Schema):
|
||||
if prop and prop.this and not isinstance(prop.this, exp.Schema):
|
||||
schema = expression.this
|
||||
columns = {v.name.upper() for v in this.expressions}
|
||||
columns = {v.name.upper() for v in prop.this.expressions}
|
||||
partitions = [col for col in schema.expressions if col.name.upper() in columns]
|
||||
schema.set("expressions", [e for e in schema.expressions if e not in partitions])
|
||||
prop.replace(exp.PartitionedByProperty(this=exp.Schema(expressions=partitions)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue