aboutsummaryrefslogblamecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/cte.sql.out
blob: a446c2cd183da4734216e936638508dcd8cbeeac (plain) (tree)
1
2
                                               
                       














































                                                                            
                                                                                      






                    














































                                               
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 9


-- !query 0
create temporary view t as select * from values 0, 1, 2 as t(id)
-- !query 0 schema
struct<>
-- !query 0 output



-- !query 1
create temporary view t2 as select * from values 0, 1 as t(id)
-- !query 1 schema
struct<>
-- !query 1 output



-- !query 2
WITH s AS (SELECT 1 FROM s) SELECT * FROM s
-- !query 2 schema
struct<>
-- !query 2 output
org.apache.spark.sql.AnalysisException
Table or view not found: s; line 1 pos 25


-- !query 3
WITH t AS (SELECT 1 FROM t) SELECT * FROM t
-- !query 3 schema
struct<1:int>
-- !query 3 output
1
1
1


-- !query 4
WITH s1 AS (SELECT 1 FROM s2), s2 AS (SELECT 1 FROM s1) SELECT * FROM s1, s2
-- !query 4 schema
struct<>
-- !query 4 output
org.apache.spark.sql.AnalysisException
Table or view not found: s2; line 1 pos 26


-- !query 5
WITH t1 AS (SELECT * FROM t2), t2 AS (SELECT 2 FROM t1) SELECT * FROM t1 cross join t2
-- !query 5 schema
struct<id:int,2:int>
-- !query 5 output
0	2
0	2
1	2
1	2


-- !query 6
WITH CTE1 AS (
  SELECT b.id AS id
  FROM   T2 a
         CROSS JOIN (SELECT id AS id FROM T2) b
)
SELECT t1.id AS c1,
       t2.id AS c2
FROM   CTE1 t1
       CROSS JOIN CTE1 t2
-- !query 6 schema
struct<c1:int,c2:int>
-- !query 6 output
0	0
0	0
0	0
0	0
0	1
0	1
0	1
0	1
1	0
1	0
1	0
1	0
1	1
1	1
1	1
1	1


-- !query 7
DROP VIEW IF EXISTS t
-- !query 7 schema
struct<>
-- !query 7 output



-- !query 8
DROP VIEW IF EXISTS t2
-- !query 8 schema
struct<>
-- !query 8 output