diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:35:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:35:00 +0000 |
commit | 862ffe93f7f5530e12816e57fbb77d58932c10ad (patch) | |
tree | 1f770c52c83988eb1b528dad0521d93924056e78 /tests/dialects/test_hive.py | |
parent | Releasing debian version 24.1.0-1. (diff) | |
download | sqlglot-862ffe93f7f5530e12816e57fbb77d58932c10ad.tar.xz sqlglot-862ffe93f7f5530e12816e57fbb77d58932c10ad.zip |
Merging upstream version 25.0.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_hive.py')
-rw-r--r-- | tests/dialects/test_hive.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py index 3ebaded..0311336 100644 --- a/tests/dialects/test_hive.py +++ b/tests/dialects/test_hive.py @@ -744,6 +744,16 @@ class TestHive(Validator): "hive": "SELECT a, SUM(c) FROM t GROUP BY a, DATE_FORMAT(CAST(b AS TIMESTAMP), 'yyyy'), GROUPING SETS ((a, DATE_FORMAT(CAST(b AS TIMESTAMP), 'yyyy')), a)", }, ) + self.validate_all( + "SELECT TRUNC(CAST(ds AS TIMESTAMP), 'MONTH') AS mm FROM tbl WHERE ds BETWEEN '2023-10-01' AND '2024-02-29'", + read={ + "hive": "SELECT TRUNC(CAST(ds AS TIMESTAMP), 'MONTH') AS mm FROM tbl WHERE ds BETWEEN '2023-10-01' AND '2024-02-29'", + "presto": "SELECT DATE_TRUNC('MONTH', CAST(ds AS TIMESTAMP)) AS mm FROM tbl WHERE ds BETWEEN '2023-10-01' AND '2024-02-29'", + }, + write={ + "presto": "SELECT DATE_TRUNC('MONTH', TRY_CAST(ds AS TIMESTAMP)) AS mm FROM tbl WHERE ds BETWEEN '2023-10-01' AND '2024-02-29'", + }, + ) def test_escapes(self) -> None: self.validate_identity("'\n'", "'\\n'") |