diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-02 23:59:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-02 23:59:11 +0000 |
commit | caea5267cb8e1fea3702adbdf6f68fd37d13b3b7 (patch) | |
tree | f06f1da1ab3b6906beca1c3c7222d28ff00766ac /tests/dialects/test_databricks.py | |
parent | Adding upstream version 12.2.0. (diff) | |
download | sqlglot-caea5267cb8e1fea3702adbdf6f68fd37d13b3b7.tar.xz sqlglot-caea5267cb8e1fea3702adbdf6f68fd37d13b3b7.zip |
Adding upstream version 15.0.0.upstream/15.0.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_databricks.py')
-rw-r--r-- | tests/dialects/test_databricks.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/dialects/test_databricks.py b/tests/dialects/test_databricks.py index 4619108..8239dec 100644 --- a/tests/dialects/test_databricks.py +++ b/tests/dialects/test_databricks.py @@ -9,6 +9,14 @@ class TestDatabricks(Validator): self.validate_identity("CREATE FUNCTION a.b(x INT) RETURNS INT RETURN x + 1") self.validate_identity("CREATE FUNCTION a AS b") self.validate_identity("SELECT ${x} FROM ${y} WHERE ${z} > 1") + self.validate_identity("CREATE TABLE foo (x DATE GENERATED ALWAYS AS (CAST(y AS DATE)))") + + self.validate_all( + "CREATE TABLE foo (x INT GENERATED ALWAYS AS (YEAR(y)))", + write={ + "databricks": "CREATE TABLE foo (x INT GENERATED ALWAYS AS (YEAR(TO_DATE(y))))", + }, + ) # https://docs.databricks.com/sql/language-manual/functions/colonsign.html def test_json(self): |