summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_snowflake.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-20 09:37:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-20 09:37:57 +0000
commit5c70c63284a8ff61607db1a51ac2829b74f71c1c (patch)
tree10a81ffbd8da8cae58e292848cbdd0550d08721d /tests/dialects/test_snowflake.py
parentAdding upstream version 21.1.1. (diff)
downloadsqlglot-5c70c63284a8ff61607db1a51ac2829b74f71c1c.tar.xz
sqlglot-5c70c63284a8ff61607db1a51ac2829b74f71c1c.zip
Adding upstream version 21.1.2.upstream/21.1.2
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.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 321dd73..4e4feb3 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -594,9 +594,9 @@ WHERE
self.validate_all(
"SELECT TO_TIMESTAMP(16599817290000, 4)",
write={
- "bigquery": "SELECT TIMESTAMP_SECONDS(CAST(16599817290000 / POW(10, 4) AS INT64))",
+ "bigquery": "SELECT TIMESTAMP_SECONDS(CAST(16599817290000 / POWER(10, 4) AS INT64))",
"snowflake": "SELECT TO_TIMESTAMP(16599817290000, 4)",
- "spark": "SELECT TIMESTAMP_SECONDS(16599817290000 / POW(10, 4))",
+ "spark": "SELECT TIMESTAMP_SECONDS(16599817290000 / POWER(10, 4))",
},
)
self.validate_all(
@@ -609,11 +609,11 @@ WHERE
self.validate_all(
"SELECT TO_TIMESTAMP(1659981729000000000, 9)",
write={
- "bigquery": "SELECT TIMESTAMP_SECONDS(CAST(1659981729000000000 / POW(10, 9) AS INT64))",
- "duckdb": "SELECT TO_TIMESTAMP(1659981729000000000 / POW(10, 9))",
+ "bigquery": "SELECT TIMESTAMP_SECONDS(CAST(1659981729000000000 / POWER(10, 9) AS INT64))",
+ "duckdb": "SELECT TO_TIMESTAMP(1659981729000000000 / POWER(10, 9))",
"presto": "SELECT FROM_UNIXTIME(CAST(1659981729000000000 AS DOUBLE) / POW(10, 9))",
"snowflake": "SELECT TO_TIMESTAMP(1659981729000000000, 9)",
- "spark": "SELECT TIMESTAMP_SECONDS(1659981729000000000 / POW(10, 9))",
+ "spark": "SELECT TIMESTAMP_SECONDS(1659981729000000000 / POWER(10, 9))",
},
)
self.validate_all(
@@ -1548,6 +1548,17 @@ MATCH_RECOGNIZE (
self.assertTrue(isinstance(users_exp, exp.Show))
self.assertEqual(users_exp.this, "USERS")
+ def test_storage_integration(self):
+ self.validate_identity(
+ """CREATE STORAGE INTEGRATION s3_int
+TYPE=EXTERNAL_STAGE
+STORAGE_PROVIDER='S3'
+STORAGE_AWS_ROLE_ARN='arn:aws:iam::001234567890:role/myrole'
+ENABLED=TRUE
+STORAGE_ALLOWED_LOCATIONS=('s3://mybucket1/path1/', 's3://mybucket2/path2/')""",
+ pretty=True,
+ )
+
def test_swap(self):
ast = parse_one("ALTER TABLE a SWAP WITH b", read="snowflake")
assert isinstance(ast, exp.AlterTable)