summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_presto.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dialects/test_presto.py')
-rw-r--r--tests/dialects/test_presto.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/dialects/test_presto.py b/tests/dialects/test_presto.py
index c0b77a3..a2800bd 100644
--- a/tests/dialects/test_presto.py
+++ b/tests/dialects/test_presto.py
@@ -109,6 +109,8 @@ class TestPresto(Validator):
"spark": "CAST(x AS TIMESTAMP)",
},
)
+ self.validate_identity("CAST(x AS IPADDRESS)")
+ self.validate_identity("CAST(x AS IPPREFIX)")
def test_regex(self):
self.validate_all(
@@ -459,6 +461,25 @@ class TestPresto(Validator):
self.validate_identity("START TRANSACTION ISOLATION LEVEL REPEATABLE READ")
self.validate_identity("APPROX_PERCENTILE(a, b, c, d)")
+ self.validate_all(
+ "STARTS_WITH('abc', 'a')",
+ read={"spark": "STARTSWITH('abc', 'a')"},
+ write={
+ "presto": "STARTS_WITH('abc', 'a')",
+ "spark": "STARTSWITH('abc', 'a')",
+ },
+ )
+ self.validate_all(
+ "IS_NAN(x)",
+ read={
+ "spark": "ISNAN(x)",
+ },
+ write={
+ "presto": "IS_NAN(x)",
+ "spark": "ISNAN(x)",
+ "spark2": "ISNAN(x)",
+ },
+ )
self.validate_all("VALUES 1, 2, 3", write={"presto": "VALUES (1), (2), (3)"})
self.validate_all("INTERVAL '1 day'", write={"trino": "INTERVAL '1' day"})
self.validate_all("(5 * INTERVAL '7' day)", read={"": "INTERVAL '5' week"})