summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_presto.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-24 08:03:45 +0000
commitca57dc468e5d8d0920e964d45ad25271ae6e633d (patch)
tree319d8bffcb5c3e9afe9e62beca9ef401480578d2 /tests/dialects/test_presto.py
parentAdding upstream version 17.4.1. (diff)
downloadsqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.tar.xz
sqlglot-ca57dc468e5d8d0920e964d45ad25271ae6e633d.zip
Adding upstream version 17.7.0.upstream/17.7.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_presto.py')
-rw-r--r--tests/dialects/test_presto.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/dialects/test_presto.py b/tests/dialects/test_presto.py
index ddfa9e8..c0b77a3 100644
--- a/tests/dialects/test_presto.py
+++ b/tests/dialects/test_presto.py
@@ -9,6 +9,14 @@ class TestPresto(Validator):
def test_cast(self):
self.validate_all(
+ "SELECT CAST('10C' AS INTEGER)",
+ read={
+ "postgres": "SELECT CAST('10C' AS INTEGER)",
+ "presto": "SELECT CAST('10C' AS INTEGER)",
+ "redshift": "SELECT CAST('10C' AS INTEGER)",
+ },
+ )
+ self.validate_all(
"SELECT DATE_DIFF('week', CAST(CAST('2009-01-01' AS TIMESTAMP) AS DATE), CAST(CAST('2009-12-31' AS TIMESTAMP) AS DATE))",
read={"redshift": "SELECT DATEDIFF(week, '2009-01-01', '2009-12-31')"},
)
@@ -17,7 +25,7 @@ class TestPresto(Validator):
read={"redshift": "SELECT DATEADD(month, 18, '2008-02-28')"},
)
self.validate_all(
- "SELECT TRY_CAST('1970-01-01 00:00:00' AS TIMESTAMP)",
+ "SELECT CAST('1970-01-01 00:00:00' AS TIMESTAMP)",
read={"postgres": "SELECT 'epoch'::TIMESTAMP"},
)
self.validate_all(