diff options
Diffstat (limited to 'tests/dialects/test_redshift.py')
-rw-r--r-- | tests/dialects/test_redshift.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/dialects/test_redshift.py b/tests/dialects/test_redshift.py index c848010..3e42525 100644 --- a/tests/dialects/test_redshift.py +++ b/tests/dialects/test_redshift.py @@ -7,9 +7,25 @@ class TestRedshift(Validator): def test_redshift(self): self.validate_identity( + "SELECT DATE_DIFF('month', CAST('2020-02-29 00:00:00' AS TIMESTAMP), CAST('2020-03-02 00:00:00' AS TIMESTAMP))", + "SELECT DATEDIFF(month, CAST(CAST('2020-02-29 00:00:00' AS TIMESTAMP) AS DATE), CAST(CAST('2020-03-02 00:00:00' AS TIMESTAMP) AS DATE))", + ) + self.validate_identity( "SELECT * FROM x WHERE y = DATEADD('month', -1, DATE_TRUNC('month', (SELECT y FROM #temp_table)))", "SELECT * FROM x WHERE y = DATEADD(month, -1, CAST(DATE_TRUNC('month', (SELECT y FROM #temp_table)) AS DATE))", ) + + self.validate_all( + "LISTAGG(sellerid, ', ')", + read={ + "duckdb": "STRING_AGG(sellerid, ', ')", + }, + write={ + # GROUP_CONCAT and STRING_AGG are aliases in DuckDB + "duckdb": "GROUP_CONCAT(sellerid, ', ')", + "redshift": "LISTAGG(sellerid, ', ')", + }, + ) self.validate_all( "SELECT APPROXIMATE COUNT(DISTINCT y)", read={ |