diff options
Diffstat (limited to 'tests/dialects/test_hive.py')
-rw-r--r-- | tests/dialects/test_hive.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/dialects/test_hive.py b/tests/dialects/test_hive.py index 8484805..0161f1e 100644 --- a/tests/dialects/test_hive.py +++ b/tests/dialects/test_hive.py @@ -247,6 +247,30 @@ class TestHive(Validator): def test_time(self): self.validate_all( + "(UNIX_TIMESTAMP(y) - UNIX_TIMESTAMP(x)) * 1000", + read={ + "presto": "DATE_DIFF('millisecond', x, y)", + }, + ) + self.validate_all( + "UNIX_TIMESTAMP(y) - UNIX_TIMESTAMP(x)", + read={ + "presto": "DATE_DIFF('second', x, y)", + }, + ) + self.validate_all( + "(UNIX_TIMESTAMP(y) - UNIX_TIMESTAMP(x)) / 60", + read={ + "presto": "DATE_DIFF('minute', x, y)", + }, + ) + self.validate_all( + "(UNIX_TIMESTAMP(y) - UNIX_TIMESTAMP(x)) / 3600", + read={ + "presto": "DATE_DIFF('hour', x, y)", + }, + ) + self.validate_all( "DATEDIFF(a, b)", write={ "duckdb": "DATE_DIFF('day', CAST(b AS DATE), CAST(a AS DATE))", |