summaryrefslogtreecommitdiffstats
path: root/tests/dialects/test_presto.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-25 08:20:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-09-25 08:20:06 +0000
commitbd2d949d1f2fb728cf4c429dd3ae9a1510e10182 (patch)
treec051102e5aff0ca2d75e5b96b09968c52114060a /tests/dialects/test_presto.py
parentAdding upstream version 18.5.1. (diff)
downloadsqlglot-bd2d949d1f2fb728cf4c429dd3ae9a1510e10182.tar.xz
sqlglot-bd2d949d1f2fb728cf4c429dd3ae9a1510e10182.zip
Adding upstream version 18.7.0.upstream/18.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.py42
1 files changed, 2 insertions, 40 deletions
diff --git a/tests/dialects/test_presto.py b/tests/dialects/test_presto.py
index a92f04f..a80013e 100644
--- a/tests/dialects/test_presto.py
+++ b/tests/dialects/test_presto.py
@@ -431,8 +431,8 @@ class TestPresto(Validator):
self.validate_all(
"SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname ASC NULLS LAST, lname",
write={
- "presto": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname, lname",
- "spark": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname NULLS LAST, lname NULLS LAST",
+ "presto": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname ASC, lname",
+ "spark": "SELECT fname, lname, age FROM person ORDER BY age DESC NULLS FIRST, fname ASC NULLS LAST, lname NULLS LAST",
},
)
@@ -947,44 +947,6 @@ class TestPresto(Validator):
},
)
- def test_explode_to_unnest(self):
- self.validate_all(
- "SELECT col FROM tbl CROSS JOIN UNNEST(x) AS _u(col)",
- read={"spark": "SELECT EXPLODE(x) FROM tbl"},
- )
- self.validate_all(
- "SELECT col_2 FROM _u CROSS JOIN UNNEST(col) AS _u_2(col_2)",
- read={"spark": "SELECT EXPLODE(col) FROM _u"},
- )
- self.validate_all(
- "SELECT exploded FROM schema.tbl CROSS JOIN UNNEST(col) AS _u(exploded)",
- read={"spark": "SELECT EXPLODE(col) AS exploded FROM schema.tbl"},
- )
- self.validate_all(
- "SELECT col FROM UNNEST(SEQUENCE(1, 2)) AS _u(col)",
- read={"spark": "SELECT EXPLODE(SEQUENCE(1, 2))"},
- )
- self.validate_all(
- "SELECT col FROM tbl AS t CROSS JOIN UNNEST(t.c) AS _u(col)",
- read={"spark": "SELECT EXPLODE(t.c) FROM tbl t"},
- )
- self.validate_all(
- "SELECT pos, col FROM UNNEST(SEQUENCE(2, 3)) WITH ORDINALITY AS _u(col, pos)",
- read={"spark": "SELECT POSEXPLODE(SEQUENCE(2, 3))"},
- )
- self.validate_all(
- "SELECT pos, col FROM tbl CROSS JOIN UNNEST(SEQUENCE(2, 3)) WITH ORDINALITY AS _u(col, pos)",
- read={"spark": "SELECT POSEXPLODE(SEQUENCE(2, 3)) FROM tbl"},
- )
- self.validate_all(
- "SELECT pos, col FROM tbl AS t CROSS JOIN UNNEST(t.c) WITH ORDINALITY AS _u(col, pos)",
- read={"spark": "SELECT POSEXPLODE(t.c) FROM tbl t"},
- )
- self.validate_all(
- "SELECT col, pos, pos_2, col_2 FROM _u CROSS JOIN UNNEST(SEQUENCE(2, 3)) WITH ORDINALITY AS _u_2(col_2, pos_2)",
- read={"spark": "SELECT col, pos, POSEXPLODE(SEQUENCE(2, 3)) FROM _u"},
- )
-
def test_match_recognize(self):
self.validate_identity(
"""SELECT