summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_redshift.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-13 09:17:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-13 09:17:37 +0000
commit22342ec7693d09ebf96484be7c3cd5d8b506f38e (patch)
treeb8fe2ebfb290eb425dcee4f15fa8cab46e74b40f /tests/dialects/test_redshift.py
parentAdding upstream version 18.3.0. (diff)
downloadsqlglot-22342ec7693d09ebf96484be7c3cd5d8b506f38e.tar.xz
sqlglot-22342ec7693d09ebf96484be7c3cd5d8b506f38e.zip
Adding upstream version 18.4.1.upstream/18.4.1
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.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)), '')",
+ },
+ )