summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_snowflake.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-02 09:16:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-02 09:16:29 +0000
commit1a60bbae98d3b530924a6807a55f8250de19ea86 (patch)
tree87d3000f271a6604fff43db188731229aed918a8 /tests/dialects/test_snowflake.py
parentAdding upstream version 10.0.8. (diff)
downloadsqlglot-1a60bbae98d3b530924a6807a55f8250de19ea86.tar.xz
sqlglot-1a60bbae98d3b530924a6807a55f8250de19ea86.zip
Adding upstream version 10.1.3.upstream/10.1.3
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.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index 0e69f4e..baca269 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -172,13 +172,28 @@ class TestSnowflake(Validator):
self.validate_all(
"trim(date_column, 'UTC')",
write={
+ "bigquery": "TRIM(date_column, 'UTC')",
"snowflake": "TRIM(date_column, 'UTC')",
"postgres": "TRIM('UTC' FROM date_column)",
},
)
self.validate_all(
"trim(date_column)",
- write={"snowflake": "TRIM(date_column)"},
+ write={
+ "snowflake": "TRIM(date_column)",
+ "bigquery": "TRIM(date_column)",
+ },
+ )
+ self.validate_all(
+ "DECODE(x, a, b, c, d)",
+ read={
+ "": "MATCHES(x, a, b, c, d)",
+ },
+ write={
+ "": "MATCHES(x, a, b, c, d)",
+ "oracle": "DECODE(x, a, b, c, d)",
+ "snowflake": "DECODE(x, a, b, c, d)",
+ },
)
def test_null_treatment(self):
@@ -370,7 +385,8 @@ class TestSnowflake(Validator):
)
self.validate_all(
- r"""SELECT * FROM TABLE(?)""", write={"snowflake": r"""SELECT * FROM TABLE(?)"""}
+ r"""SELECT * FROM TABLE(?)""",
+ write={"snowflake": r"""SELECT * FROM TABLE(?)"""},
)
self.validate_all(