summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_snowflake.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-06 07:48:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-06 07:48:08 +0000
commitb737ee75da2515a4a53956e41ae85e29dd67f21d (patch)
tree3896f4cac8aebc31f5cdb32a111fa801aba7ca22 /tests/dialects/test_snowflake.py
parentAdding upstream version 17.7.0. (diff)
downloadsqlglot-b737ee75da2515a4a53956e41ae85e29dd67f21d.tar.xz
sqlglot-b737ee75da2515a4a53956e41ae85e29dd67f21d.zip
Adding upstream version 17.9.1.upstream/17.9.1
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.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 82762e8..a889e1d 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -45,6 +45,14 @@ class TestSnowflake(Validator):
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 DATE_PART('year', TIMESTAMP '2020-01-01')",
+ write={
+ "hive": "SELECT EXTRACT(year FROM CAST('2020-01-01' AS TIMESTAMP))",
+ "snowflake": "SELECT DATE_PART('year', CAST('2020-01-01' AS TIMESTAMPNTZ))",
+ "spark": "SELECT EXTRACT(year FROM CAST('2020-01-01' AS TIMESTAMP))",
+ },
+ )
+ self.validate_all(
"SELECT * FROM (VALUES (0) foo(bar))",
write={"snowflake": "SELECT * FROM (VALUES (0)) AS foo(bar)"},
)