diff options
Diffstat (limited to '')
-rw-r--r-- | tests/dialects/test_dialect.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/dialects/test_dialect.py b/tests/dialects/test_dialect.py index 8ffdf07..3ac05cf 100644 --- a/tests/dialects/test_dialect.py +++ b/tests/dialects/test_dialect.py @@ -485,7 +485,7 @@ class TestDialect(Validator): "duckdb": "CAST(x AS DATE)", "hive": "TO_DATE(x)", "postgres": "CAST(x AS DATE)", - "presto": "CAST(SUBSTR(CAST(x AS VARCHAR), 1, 10) AS DATE)", + "presto": "CAST(CAST(x AS TIMESTAMP) AS DATE)", "snowflake": "CAST(x AS DATE)", }, ) @@ -749,14 +749,14 @@ class TestDialect(Validator): "drill": "DATE_ADD(CAST('2021-02-01' AS DATE), INTERVAL 1 DAY)", "duckdb": "CAST('2021-02-01' AS DATE) + INTERVAL 1 DAY", "hive": "DATE_ADD('2021-02-01', 1)", - "presto": "DATE_ADD('DAY', 1, DATE_PARSE(SUBSTR('2021-02-01', 1, 10), '%Y-%m-%d'))", + "presto": "DATE_ADD('DAY', 1, CAST(CAST('2021-02-01' AS TIMESTAMP) AS DATE))", "spark": "DATE_ADD('2021-02-01', 1)", }, ) self.validate_all( "TS_OR_DS_ADD(x, 1, 'DAY')", write={ - "presto": "DATE_ADD('DAY', 1, DATE_PARSE(SUBSTR(CAST(x AS VARCHAR), 1, 10), '%Y-%m-%d'))", + "presto": "DATE_ADD('DAY', 1, CAST(CAST(x AS TIMESTAMP) AS DATE))", "hive": "DATE_ADD(x, 1)", }, ) @@ -1192,7 +1192,7 @@ class TestDialect(Validator): }, ) self.validate_all( - "COALESCE(a, '')", + "COALESCE(CAST(a AS TEXT), '')", read={ "drill": "CONCAT(a)", "duckdb": "CONCAT(a)", @@ -1300,7 +1300,9 @@ class TestDialect(Validator): self.validate_all( "SELECT x FROM y LIMIT 10", read={ + "teradata": "SELECT TOP 10 x FROM y", "tsql": "SELECT TOP 10 x FROM y", + "snowflake": "SELECT TOP 10 x FROM y", }, write={ "sqlite": "SELECT x FROM y LIMIT 10", |