diff options
Diffstat (limited to 'tests/dialects/test_snowflake.py')
-rw-r--r-- | tests/dialects/test_snowflake.py | 8 |
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)"}, ) |