summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_snowflake.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 07:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 07:23:18 +0000
commit9c5cf7fc4a20988d0eda33e4a3afdf7168c05104 (patch)
tree85160e0a3a39feede46b7546566279525b3af373 /tests/dialects/test_snowflake.py
parentReleasing debian version 25.31.4-1. (diff)
downloadsqlglot-9c5cf7fc4a20988d0eda33e4a3afdf7168c05104.tar.xz
sqlglot-9c5cf7fc4a20988d0eda33e4a3afdf7168c05104.zip
Merging upstream version 25.32.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_snowflake.py')
-rw-r--r--tests/dialects/test_snowflake.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 515a07c..8058bcf 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -1479,13 +1479,20 @@ WHERE
"snowflake": "CREATE OR REPLACE TRANSIENT TABLE a (id INT)",
},
)
-
self.validate_all(
"CREATE TABLE a (b INT)",
read={"teradata": "CREATE MULTISET TABLE a (b INT)"},
write={"snowflake": "CREATE TABLE a (b INT)"},
)
+ self.validate_identity("CREATE TABLE a TAG (key1='value_1', key2='value_2')")
+ self.validate_all(
+ "CREATE TABLE a TAG (key1='value_1')",
+ read={
+ "snowflake": "CREATE TABLE a WITH TAG (key1='value_1')",
+ },
+ )
+
for action in ("SET", "DROP"):
with self.subTest(f"ALTER COLUMN {action} NOT NULL"):
self.validate_all(
@@ -2250,3 +2257,13 @@ SINGLE = TRUE""",
self.validate_identity(
"GRANT ALL PRIVILEGES ON FUNCTION mydb.myschema.ADD5(number) TO ROLE analyst"
)
+
+ def test_window_function_arg(self):
+ query = "SELECT * FROM TABLE(db.schema.FUNC(a) OVER ())"
+
+ ast = self.parse_one(query)
+ window = ast.find(exp.Window)
+
+ self.assertEqual(ast.sql("snowflake"), query)
+ self.assertEqual(len(list(ast.find_all(exp.Column))), 1)
+ self.assertEqual(window.this.sql("snowflake"), "db.schema.FUNC(a)")