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_duckdb.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'tests/dialects/test_duckdb.py') diff --git a/tests/dialects/test_duckdb.py b/tests/dialects/test_duckdb.py index 5284700..5c35d8f 100644 --- a/tests/dialects/test_duckdb.py +++ b/tests/dialects/test_duckdb.py @@ -583,6 +583,38 @@ class TestDuckDB(Validator): write={"duckdb": "SELECT a, BOOL_OR(b) FROM table GROUP BY a"}, ) + def test_encode_decode(self): + self.validate_all( + "ENCODE(x)", + read={ + "spark": "ENCODE(x, 'utf-8')", + "presto": "TO_UTF8(x)", + }, + write={ + "duckdb": "ENCODE(x)", + "spark": "ENCODE(x, 'utf-8')", + "presto": "TO_UTF8(x)", + }, + ) + self.validate_all( + "DECODE(x)", + read={ + "spark": "DECODE(x, 'utf-8')", + "presto": "FROM_UTF8(x)", + }, + write={ + "duckdb": "DECODE(x)", + "spark": "DECODE(x, 'utf-8')", + "presto": "FROM_UTF8(x)", + }, + ) + self.validate_all( + "DECODE(x)", + read={ + "presto": "FROM_UTF8(x, y)", + }, + ) + def test_rename_table(self): self.validate_all( "ALTER TABLE db.t1 RENAME TO db.t2", -- cgit v1.2.3