diff options
Diffstat (limited to 'sqlglot/dialects/spark.py')
-rw-r--r-- | sqlglot/dialects/spark.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sqlglot/dialects/spark.py b/sqlglot/dialects/spark.py index dd3e0c8..05ee53f 100644 --- a/sqlglot/dialects/spark.py +++ b/sqlglot/dialects/spark.py @@ -8,9 +8,12 @@ from sqlglot.helper import seq_get def _create_sql(self, e): kind = e.args.get("kind") - temporary = e.args.get("temporary") + properties = e.args.get("properties") - if kind.upper() == "TABLE" and temporary is True: + if kind.upper() == "TABLE" and any( + isinstance(prop, exp.TemporaryProperty) + for prop in (properties.expressions if properties else []) + ): return f"CREATE TEMPORARY VIEW {self.sql(e, 'this')} AS {self.sql(e, 'expression')}" return create_with_partitions_sql(self, e) |