diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
commit | 58c11f70074708344e433080e47621091a6dcd84 (patch) | |
tree | 2589166e0e58be4947e07a956d26efa497bccaf2 /tests/dialects/test_snowflake.py | |
parent | Adding upstream version 11.4.5. (diff) | |
download | sqlglot-upstream/11.5.2.tar.xz sqlglot-upstream/11.5.2.zip |
Adding upstream version 11.5.2.upstream/11.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/dialects/test_snowflake.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py index 940fa50..eb423a5 100644 --- a/tests/dialects/test_snowflake.py +++ b/tests/dialects/test_snowflake.py @@ -6,6 +6,11 @@ class TestSnowflake(Validator): dialect = "snowflake" def test_snowflake(self): + self.validate_identity("SELECT HLL(*)") + self.validate_identity("SELECT HLL(a)") + self.validate_identity("SELECT HLL(DISTINCT t.a)") + self.validate_identity("SELECT HLL(a, b, c)") + self.validate_identity("SELECT HLL(DISTINCT a, b, c)") self.validate_identity("$x") self.validate_identity("SELECT REGEXP_LIKE(a, b, c)") self.validate_identity("PUT file:///dir/tmp.csv @%table") @@ -376,14 +381,10 @@ class TestSnowflake(Validator): }, ) self.validate_all( - "DECODE(x, a, b, c, d)", - read={ - "": "MATCHES(x, a, b, c, d)", - }, + "DECODE(x, a, b, c, d, e)", write={ - "": "MATCHES(x, a, b, c, d)", - "oracle": "DECODE(x, a, b, c, d)", - "snowflake": "DECODE(x, a, b, c, d)", + "": "CASE WHEN x = a OR (x IS NULL AND a IS NULL) THEN b WHEN x = c OR (x IS NULL AND c IS NULL) THEN d ELSE e END", + "snowflake": "CASE WHEN x = a OR (x IS NULL AND a IS NULL) THEN b WHEN x = c OR (x IS NULL AND c IS NULL) THEN d ELSE e END", }, ) |