peter-toth commented on a change in pull request #24831: [SPARK-19799][SQL] Support WITH clause in subqueries URL: https://github.com/apache/spark/pull/24831#discussion_r300237706
########## File path: sql/core/src/test/resources/sql-tests/results/cte.sql.out ########## @@ -88,26 +98,192 @@ struct<c1:int,c2:int> 1 1 --- !query 7 +-- !query 8 WITH t(x) AS (SELECT 1) SELECT * FROM t WHERE x = 1 --- !query 7 schema +-- !query 8 schema struct<x:int> --- !query 7 output +-- !query 8 output 1 --- !query 8 +-- !query 9 +WITH t as ( + WITH t2 AS (SELECT 1) + SELECT * FROM t2 +) +SELECT * FROM t +-- !query 9 schema +struct<1:int> +-- !query 9 output +1 + + +-- !query 10 +SELECT max(c) FROM ( + WITH t(c) AS (SELECT 1) + SELECT * FROM t +) +-- !query 10 schema +struct<max(c):int> +-- !query 10 output +1 + + +-- !query 11 +SELECT ( + WITH t AS (SELECT 1) + SELECT * FROM t +) +-- !query 11 schema +struct<scalarsubquery():int> +-- !query 11 output +1 + + +-- !query 12 +WITH + t AS (SELECT 1), + t2 AS ( + WITH t AS (SELECT 2) + SELECT * FROM t + ) +SELECT * FROM t2 +-- !query 12 schema +struct<1:int> +-- !query 12 output +1 + Review comment: Yes, after https://github.com/apache/spark/pull/25029 it will return `2` (https://github.com/apache/spark/pull/25029/files#diff-fc515a5db268d29b08b80f5eb8202026R145) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
