summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:35:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:35:01 +0000
commit58c11f70074708344e433080e47621091a6dcd84 (patch)
tree2589166e0e58be4947e07a956d26efa497bccaf2 /tests/dialects/test_redshift.py
parentAdding upstream version 11.4.5. (diff)
downloadsqlglot-58c11f70074708344e433080e47621091a6dcd84.tar.xz
sqlglot-58c11f70074708344e433080e47621091a6dcd84.zip
Adding upstream version 11.5.2.upstream/11.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_redshift.py')
-rw-r--r--tests/dialects/test_redshift.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/dialects/test_redshift.py b/tests/dialects/test_redshift.py
index ff730f8..0933051 100644
--- a/tests/dialects/test_redshift.py
+++ b/tests/dialects/test_redshift.py
@@ -69,9 +69,11 @@ class TestRedshift(Validator):
self.validate_all(
"DECODE(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)",
+ "": "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 END",
+ "oracle": "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 END",
+ "redshift": "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 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 END",
+ "spark": "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 END",
},
)
self.validate_all(
@@ -97,9 +99,6 @@ class TestRedshift(Validator):
)
def test_identity(self):
- self.validate_identity(
- "SELECT DECODE(COL1, 'replace_this', 'with_this', 'replace_that', 'with_that')"
- )
self.validate_identity("CAST('bla' AS SUPER)")
self.validate_identity("CREATE TABLE real1 (realcol REAL)")
self.validate_identity("CAST('foo' AS HLLSKETCH)")