diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-04 12:14:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-04 12:14:40 +0000 |
commit | d7f0758e21b5111b5327f3839c5c9f49a04d272b (patch) | |
tree | a425f4ebcc159d6bd9443fe4e0e2f9eb20151027 /tests/fixtures/optimizer/optimizer.sql | |
parent | Adding upstream version 18.7.0. (diff) | |
download | sqlglot-d7f0758e21b5111b5327f3839c5c9f49a04d272b.tar.xz sqlglot-d7f0758e21b5111b5327f3839c5c9f49a04d272b.zip |
Adding upstream version 18.11.2.upstream/18.11.2
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.sql | 22 |
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`; |