diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-02-08 05:38:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-02-08 05:38:39 +0000 |
commit | aedf35026379f52d7e2b4c1f957691410a758089 (patch) | |
tree | 86540364259b66741173d2333387b78d6f9c31e2 /tests/dialects/test_presto.py | |
parent | Adding upstream version 20.11.0. (diff) | |
download | sqlglot-aedf35026379f52d7e2b4c1f957691410a758089.tar.xz sqlglot-aedf35026379f52d7e2b4c1f957691410a758089.zip |
Adding upstream version 21.0.1.upstream/21.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_presto.py')
-rw-r--r-- | tests/dialects/test_presto.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/dialects/test_presto.py b/tests/dialects/test_presto.py index 387b0e0..36006d2 100644 --- a/tests/dialects/test_presto.py +++ b/tests/dialects/test_presto.py @@ -343,16 +343,16 @@ class TestPresto(Validator): ) self.validate_all( - "SELECT timestamp '2012-10-31 00:00' AT TIME ZONE 'America/Sao_Paulo'", + "SELECT CAST('2012-10-31 00:00' AS TIMESTAMP) AT TIME ZONE 'America/Sao_Paulo'", write={ "spark": "SELECT FROM_UTC_TIMESTAMP(CAST('2012-10-31 00:00' AS TIMESTAMP), 'America/Sao_Paulo')", - "presto": "SELECT CAST('2012-10-31 00:00' AS TIMESTAMP) AT TIME ZONE 'America/Sao_Paulo'", + "presto": "SELECT AT_TIMEZONE(CAST('2012-10-31 00:00' AS TIMESTAMP), 'America/Sao_Paulo')", }, ) self.validate_all( - "CAST('2012-10-31 00:00' AS TIMESTAMP) AT TIME ZONE 'America/Sao_Paulo'", + "SELECT AT_TIMEZONE(CAST('2012-10-31 00:00' AS TIMESTAMP), 'America/Sao_Paulo')", read={ - "spark": "FROM_UTC_TIMESTAMP('2012-10-31 00:00', 'America/Sao_Paulo')", + "spark": "SELECT FROM_UTC_TIMESTAMP(TIMESTAMP '2012-10-31 00:00', 'America/Sao_Paulo')", }, ) self.validate_all( @@ -368,7 +368,7 @@ class TestPresto(Validator): "TIMESTAMP(x, 'America/Los_Angeles')", write={ "duckdb": "CAST(x AS TIMESTAMP) AT TIME ZONE 'America/Los_Angeles'", - "presto": "CAST(x AS TIMESTAMP) AT TIME ZONE 'America/Los_Angeles'", + "presto": "AT_TIMEZONE(CAST(x AS TIMESTAMP), 'America/Los_Angeles')", }, ) # this case isn't really correct, but it's a fall back for mysql's version @@ -564,7 +564,7 @@ class TestPresto(Validator): ) def test_presto(self): - with self.assertLogs(helper_logger) as cm: + with self.assertLogs(helper_logger): self.validate_all( "SELECT COALESCE(ELEMENT_AT(MAP_FROM_ENTRIES(ARRAY[(51, '1')]), id), quantity) FROM my_table", write={ |