From 5dde903f4f6659e384287a3e508b9f369c5a2ba3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 10 Aug 2023 11:23:46 +0200 Subject: Adding upstream version 17.11.0. Signed-off-by: Daniel Baumann --- tests/dialects/test_presto.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'tests/dialects/test_presto.py') diff --git a/tests/dialects/test_presto.py b/tests/dialects/test_presto.py index a2800bd..ec1ad30 100644 --- a/tests/dialects/test_presto.py +++ b/tests/dialects/test_presto.py @@ -466,6 +466,7 @@ class TestPresto(Validator): read={"spark": "STARTSWITH('abc', 'a')"}, write={ "presto": "STARTS_WITH('abc', 'a')", + "snowflake": "STARTSWITH('abc', 'a')", "spark": "STARTSWITH('abc', 'a')", }, ) @@ -740,46 +741,44 @@ class TestPresto(Validator): ) def test_encode_decode(self): + self.validate_identity("FROM_UTF8(x, y)") + self.validate_all( "TO_UTF8(x)", + read={ + "duckdb": "ENCODE(x)", + "spark": "ENCODE(x, 'utf-8')", + }, write={ + "duckdb": "ENCODE(x)", + "presto": "TO_UTF8(x)", "spark": "ENCODE(x, 'utf-8')", }, ) self.validate_all( "FROM_UTF8(x)", - write={ + read={ + "duckdb": "DECODE(x)", "spark": "DECODE(x, 'utf-8')", }, - ) - self.validate_all( - "FROM_UTF8(x, y)", - write={ - "presto": "FROM_UTF8(x, y)", - }, - ) - self.validate_all( - "ENCODE(x, 'utf-8')", - write={ - "presto": "TO_UTF8(x)", - }, - ) - self.validate_all( - "DECODE(x, 'utf-8')", write={ + "duckdb": "DECODE(x)", "presto": "FROM_UTF8(x)", + "spark": "DECODE(x, 'utf-8')", }, ) self.validate_all( "ENCODE(x, 'invalid')", write={ "presto": UnsupportedError, + "duckdb": UnsupportedError, }, ) self.validate_all( "DECODE(x, 'invalid')", write={ "presto": UnsupportedError, + "duckdb": UnsupportedError, }, ) -- cgit v1.2.3