summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_redshift.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialects/test_redshift.py')
-rw-r--r--tests/dialects/test_redshift.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/dialects/test_redshift.py b/tests/dialects/test_redshift.py
index aea8b69..e261c01 100644
--- a/tests/dialects/test_redshift.py
+++ b/tests/dialects/test_redshift.py
@@ -360,3 +360,17 @@ class TestRedshift(Validator):
"redshift": "CREATE OR REPLACE VIEW v1 AS SELECT cola, colb FROM t1 WITH NO SCHEMA BINDING",
},
)
+
+ def test_concat(self):
+ self.validate_all(
+ "SELECT CONCAT('abc', 'def')",
+ write={
+ "redshift": "SELECT COALESCE(CAST('abc' AS VARCHAR(MAX)), '') || COALESCE(CAST('def' AS VARCHAR(MAX)), '')",
+ },
+ )
+ self.validate_all(
+ "SELECT CONCAT_WS('DELIM', 'abc', 'def', 'ghi')",
+ write={
+ "redshift": "SELECT COALESCE(CAST('abc' AS VARCHAR(MAX)), '') || 'DELIM' || COALESCE(CAST('def' AS VARCHAR(MAX)), '') || 'DELIM' || COALESCE(CAST('ghi' AS VARCHAR(MAX)), '')",
+ },
+ )