summaryrefslogtreecommitdiffstats
path: root/tests/dialects
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-24 18:46:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-24 18:46:54 +0000
commit5cb547bdac6f807c3a1bc42faffaceaf726a3e3e (patch)
tree89287ecd0265188fc3119e9d711017634526a09e /tests/dialects
parentAdding upstream version 16.4.0. (diff)
downloadsqlglot-5cb547bdac6f807c3a1bc42faffaceaf726a3e3e.tar.xz
sqlglot-5cb547bdac6f807c3a1bc42faffaceaf726a3e3e.zip
Adding upstream version 16.4.2.upstream/16.4.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects')
-rw-r--r--tests/dialects/test_databricks.py1
-rw-r--r--tests/dialects/test_snowflake.py9
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/dialects/test_databricks.py b/tests/dialects/test_databricks.py
index 8239dec..14f7cd0 100644
--- a/tests/dialects/test_databricks.py
+++ b/tests/dialects/test_databricks.py
@@ -5,6 +5,7 @@ class TestDatabricks(Validator):
dialect = "databricks"
def test_databricks(self):
+ self.validate_identity("INSERT INTO a REPLACE WHERE cond VALUES (1), (2)")
self.validate_identity("SELECT c1 : price")
self.validate_identity("CREATE FUNCTION a.b(x INT) RETURNS INT RETURN x + 1")
self.validate_identity("CREATE FUNCTION a AS b")
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 0514149..48bb2f7 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -23,19 +23,20 @@ class TestSnowflake(Validator):
self.validate_identity("CREATE TABLE foo (bar FLOAT AUTOINCREMENT START 0 INCREMENT 1)")
self.validate_identity("ALTER TABLE IF EXISTS foo SET TAG a = 'a', b = 'b', c = 'c'")
self.validate_identity("ALTER TABLE foo UNSET TAG a, b, c")
+ self.validate_identity("COMMENT IF EXISTS ON TABLE foo IS 'bar'")
+ self.validate_identity("SELECT CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', col)")
self.validate_identity(
'COPY INTO NEW_TABLE ("foo", "bar") FROM (SELECT $1, $2, $3, $4 FROM @%old_table)'
)
- self.validate_identity("COMMENT IF EXISTS ON TABLE foo IS 'bar'")
- self.validate_identity("SELECT CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', col)")
+ self.validate_all("CAST(x AS BYTEINT)", write={"snowflake": "CAST(x AS INT)"})
self.validate_all("CAST(x AS CHAR VARYING)", write={"snowflake": "CAST(x AS VARCHAR)"})
+ self.validate_all("CAST(x AS CHARACTER VARYING)", write={"snowflake": "CAST(x AS VARCHAR)"})
+ self.validate_all("CAST(x AS NCHAR VARYING)", write={"snowflake": "CAST(x AS VARCHAR)"})
self.validate_all(
"SELECT * FROM (VALUES (0) foo(bar))",
write={"snowflake": "SELECT * FROM (VALUES (0)) AS foo(bar)"},
)
- self.validate_all("CAST(x AS CHARACTER VARYING)", write={"snowflake": "CAST(x AS VARCHAR)"})
- self.validate_all("CAST(x AS NCHAR VARYING)", write={"snowflake": "CAST(x AS VARCHAR)"})
self.validate_all(
"OBJECT_CONSTRUCT(a, b, c, d)",
read={