diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:23:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:23:50 +0000 |
commit | 4cc7d5a6dcda8f275b4156a9a23bbe5380be1b53 (patch) | |
tree | 1084b1a2dd9f2782031b4aa79608db08968a5837 /tests/dialects/test_presto.py | |
parent | Releasing debian version 17.9.1-1. (diff) | |
download | sqlglot-4cc7d5a6dcda8f275b4156a9a23bbe5380be1b53.tar.xz sqlglot-4cc7d5a6dcda8f275b4156a9a23bbe5380be1b53.zip |
Merging upstream version 17.11.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/dialects/test_presto.py | 31 |
1 files changed, 15 insertions, 16 deletions
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, }, ) |