summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/optimizer.sql
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fixtures/optimizer/optimizer.sql')
-rw-r--r--tests/fixtures/optimizer/optimizer.sql22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/optimizer.sql b/tests/fixtures/optimizer/optimizer.sql
index e59f14d..4cc62c9 100644
--- a/tests/fixtures/optimizer/optimizer.sql
+++ b/tests/fixtures/optimizer/optimizer.sql
@@ -1023,3 +1023,25 @@ SELECT
FROM "table1" AS "table1"
LEFT JOIN "alias3"
ON "table1"."cid" = "alias3"."cid";
+
+# title: CTE with EXPLODE cannot be merged
+# dialect: spark
+# execute: false
+SELECT Name,
+ FruitStruct.`$id`,
+ FruitStruct.value
+ FROM
+ (SELECT Name,
+ explode(Fruits) as FruitStruct
+ FROM fruits_table);
+WITH `_q_0` AS (
+ SELECT
+ `fruits_table`.`name` AS `name`,
+ EXPLODE(`fruits_table`.`fruits`) AS `fruitstruct`
+ FROM `fruits_table` AS `fruits_table`
+)
+SELECT
+ `_q_0`.`name` AS `name`,
+ `_q_0`.`fruitstruct`.`$id` AS `$id`,
+ `_q_0`.`fruitstruct`.`value` AS `value`
+FROM `_q_0` AS `_q_0`;