summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/optimizer.sql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-16 11:37:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-16 11:37:35 +0000
commit45eab59f38aae326a4970767f9bc7119bef339b9 (patch)
treef5a21c1bba9fd891c923cc14206986691931ca47 /tests/fixtures/optimizer/optimizer.sql
parentAdding upstream version 18.11.6. (diff)
downloadsqlglot-45eab59f38aae326a4970767f9bc7119bef339b9.tar.xz
sqlglot-45eab59f38aae326a4970767f9bc7119bef339b9.zip
Adding upstream version 18.13.0.upstream/18.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures/optimizer/optimizer.sql')
-rw-r--r--tests/fixtures/optimizer/optimizer.sql29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql
index 4cc62c9..a812bc5 100644
--- a/tests/fixtures/optimizer/optimizer.sql
+++ b/tests/fixtures/optimizer/optimizer.sql
@@ -15,6 +15,35 @@ SELECT
"q"."x" AS "x"
FROM UNNEST(ARRAY(1, 2)) AS "q"("x", "y");
+# title: explode_outer
+# dialect: spark
+# execute: false
+CREATE OR REPLACE TEMPORARY VIEW latest_boo AS
+SELECT
+ TRIM(split(points, ':')[0]) as points_type,
+ TRIM(split(points, ':')[1]) as points_value
+FROM (
+ SELECT
+ explode_outer(split(object_pointsText, ',')) as points
+ FROM (
+ SELECT
+ object_pointstext,
+ FROM boo
+ )
+ WHERE object_pointstext IS NOT NULL
+ );
+CREATE OR REPLACE TEMPORARY VIEW `latest_boo` AS
+SELECT
+ TRIM(SPLIT(`_q_1`.`points`, ':')[0]) AS `points_type`,
+ TRIM(SPLIT(`_q_1`.`points`, ':')[1]) AS `points_value`
+FROM (
+ SELECT
+ EXPLODE_OUTER(SPLIT(`boo`.`object_pointstext`, ',')) AS `points`
+ FROM `boo` AS `boo`
+ WHERE
+ NOT `boo`.`object_pointstext` IS NULL
+) AS `_q_1`;
+
# title: Union in CTE
WITH cte AS (
(