Skip to content

Commit

Permalink
Fix(hive): don't generate WithDataProperty (#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas authored Sep 30, 2023
1 parent 1df9333 commit a794bfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ class Generator(generator.Generator):
exp.FileFormatProperty: exp.Properties.Location.POST_SCHEMA,
exp.PartitionedByProperty: exp.Properties.Location.POST_SCHEMA,
exp.VolatileProperty: exp.Properties.Location.UNSUPPORTED,
exp.WithDataProperty: exp.Properties.Location.UNSUPPORTED,
}

def temporary_storage_provider(self, expression: exp.Create) -> exp.Create:
Expand Down
6 changes: 6 additions & 0 deletions tests/dialects/test_databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def test_databricks(self):
"tsql": "CREATE TABLE foo (x AS YEAR(CAST(y AS DATE)))",
},
)
self.validate_all(
"CREATE TABLE t1 AS (SELECT c FROM t2)",
read={
"teradata": "CREATE TABLE t1 AS (SELECT c FROM t2) WITH DATA",
},
)

# https://docs.databricks.com/sql/language-manual/functions/colonsign.html
def test_json(self):
Expand Down

0 comments on commit a794bfe

Please sign in to comment.