Skip to content

Commit

Permalink
[SPARK-24497][SQL] test fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-toth committed Jan 22, 2019
1 parent 0c6e957 commit 31574d7
Showing 1 changed file with 0 additions and 110 deletions.
110 changes: 0 additions & 110 deletions sql/core/src/test/resources/sql-tests/inputs/recursion.sql
Original file line number Diff line number Diff line change
Expand Up @@ -787,113 +787,3 @@ WITH RECURSIVE outermost AS (
SELECT 0 AS level
)
SELECT * FROM outermost;


--NOT SUPPORTED: alias in CTE declaration

---- sum of 1..100
--WITH RECURSIVE t(n) AS (
-- VALUES (1)
--UNION ALL
-- SELECT n+1 FROM t WHERE n < 100
--)
--SELECT sum(n) FROM t;


--NOT SUPPORTED: RECURSIVE VIEW statements

---- recursive view
--CREATE RECURSIVE VIEW nums (n) AS
-- VALUES (1)
--UNION ALL
-- SELECT n+1 FROM nums WHERE n < 5;
--
--SELECT * FROM nums;
--
--CREATE OR REPLACE RECURSIVE VIEW nums (n) AS
-- DOES NOT WORK
-- VALUES (1)
--UNION ALL
-- SELECT n+1 FROM nums WHERE n < 6;
--
--SELECT * FROM nums;


--NOT SUPPORTED: UNION combinator in recursive CTE

---- This is an infinite loop with UNION ALL, but not with UNION
--WITH RECURSIVE t(n) AS (
-- SELECT 1
--UNION
-- SELECT 10-n FROM t)
--SELECT * FROM t;


--NOT SUPPORTED: LIMIT (infinite recursion is dangerous, limit should be pushed down?)

---- This'd be an infinite loop, but outside query reads only as much as needed
--WITH RECURSIVE t(n) AS (
-- VALUES (1)
--UNION ALL
-- SELECT n+1 FROM t)
--SELECT * FROM t LIMIT 10;


--NOT SUPPORTED: different types of output in anchor and in recursive term

-- POSTGRES: In a perfect world, this would work and resolve the literal as int ...
-- but for now, we have to be content with resolving to text too soon.
--WITH RECURSIVE t AS (
-- SELECT '7' AS n
--UNION ALL
-- SELECT n+1 FROM t WHERE n < 10
--)
--SELECT n FROM t;


--NOT SUPPORTED: WITH can't be nested into FROM as subquery

-- inside subqueries
--SELECT count(*) FROM (
-- WITH RECURSIVE t AS (
-- SELECT 1 AS n UNION ALL SELECT n + 1 FROM t WHERE n < 500
-- )
-- SELECT * FROM t) AS t WHERE n < (
-- SELECT count(*) FROM (
-- WITH RECURSIVE t AS (
-- SELECT 1 AS n UNION ALL SELECT n + 1 FROM t WHERE n < 100
-- )
-- SELECT * FROM t WHERE n < 50000
-- ) AS t WHERE n < 100);


--NOT SUPPORTED: WITH can't be used with UNION ALL as subquery

---- corner case in which sub-WITH gets initialized first
--with recursive q as (
-- select * from department
-- union all
-- (with x as (select * from q)
-- select * from x)
-- )
--select * from q limit 24;
--
--with recursive q as (
-- select * from department
-- union all
-- (with recursive x as (
-- select * from department
-- union all
-- (select * from q union all select * from x)
-- )
-- select * from x)
-- )
--select * from q limit 32;

--NOT SUPPORTED: forward reference

---- forward reference OK
--WITH RECURSIVE
-- x(id) AS (SELECT * FROM y UNION ALL SELECT id+1 FROM x WHERE id < 5),
-- y(id) AS (values (1))
-- SELECT * FROM x;

0 comments on commit 31574d7

Please sign in to comment.