1
0
Fork 0

Merging upstream version 10.0.8.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 14:54:32 +01:00
parent 407314e8d2
commit efc1e37108
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
67 changed files with 2461 additions and 840 deletions

View file

@ -177,6 +177,15 @@ class TestPresto(Validator):
"spark": "CREATE TABLE test USING PARQUET AS SELECT 1",
},
)
self.validate_all(
"CREATE TABLE test STORED = 'PARQUET' AS SELECT 1",
write={
"duckdb": "CREATE TABLE test AS SELECT 1",
"presto": "CREATE TABLE test WITH (FORMAT='PARQUET') AS SELECT 1",
"hive": "CREATE TABLE test STORED AS PARQUET AS SELECT 1",
"spark": "CREATE TABLE test USING PARQUET AS SELECT 1",
},
)
self.validate_all(
"CREATE TABLE test WITH (FORMAT = 'PARQUET', X = '1', Z = '2') AS SELECT 1",
write={
@ -427,3 +436,69 @@ class TestPresto(Validator):
"spark": UnsupportedError,
},
)
self.validate_identity("START TRANSACTION READ WRITE, ISOLATION LEVEL SERIALIZABLE")
self.validate_identity("START TRANSACTION ISOLATION LEVEL REPEATABLE READ")
def test_encode_decode(self):
self.validate_all(
"TO_UTF8(x)",
write={
"spark": "ENCODE(x, 'utf-8')",
},
)
self.validate_all(
"FROM_UTF8(x)",
write={
"spark": "DECODE(x, 'utf-8')",
},
)
self.validate_all(
"ENCODE(x, 'utf-8')",
write={
"presto": "TO_UTF8(x)",
},
)
self.validate_all(
"DECODE(x, 'utf-8')",
write={
"presto": "FROM_UTF8(x)",
},
)
self.validate_all(
"ENCODE(x, 'invalid')",
write={
"presto": UnsupportedError,
},
)
self.validate_all(
"DECODE(x, 'invalid')",
write={
"presto": UnsupportedError,
},
)
def test_hex_unhex(self):
self.validate_all(
"TO_HEX(x)",
write={
"spark": "HEX(x)",
},
)
self.validate_all(
"FROM_HEX(x)",
write={
"spark": "UNHEX(x)",
},
)
self.validate_all(
"HEX(x)",
write={
"presto": "TO_HEX(x)",
},
)
self.validate_all(
"UNHEX(x)",
write={
"presto": "FROM_HEX(x)",
},
)