[ 
https://issues.apache.org/jira/browse/SPARK-51752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavle Martinović updated SPARK-51752:
-------------------------------------
    Description: 
We should add the possibility for a recursion CTE to be referenced inside a 
(regular) CTE in the recursive part of the query. An example of one such query 
is the following:

{{WITH RECURSIVE t1 AS (}}

{{  SELECT 1 AS n}}

{{  UNION ALL}}

{{  WITH t2 AS }}{{(SELECT n + 1 FROM t1 WHERE n < 5)}}

{{  SELECT * FROM t2}}

{{) SELECT * FROM t1;}}

 

  was:
We should add the possibility for a recursion CTE to be referenced inside a 
(regular) CTE in the recursive part of the query. An example of one such query 
is the following:

{{WITH RECURSIVE t1(n) AS (}}

{{  SELECT 1}}

{{  UNION ALL}}

{{  WITH t2 AS }}{{(SELECT n + 1 FROM t1 WHERE n < 5)}}

{{  SELECT * FROM t2}}

{{) SELECT * FROM t1;}}

 


> Enable rCTE referencing from within a CTE
> -----------------------------------------
>
>                 Key: SPARK-51752
>                 URL: https://issues.apache.org/jira/browse/SPARK-51752
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 4.1.0
>            Reporter: Pavle Martinović
>            Priority: Major
>
> We should add the possibility for a recursion CTE to be referenced inside a 
> (regular) CTE in the recursive part of the query. An example of one such 
> query is the following:
> {{WITH RECURSIVE t1 AS (}}
> {{  SELECT 1 AS n}}
> {{  UNION ALL}}
> {{  WITH t2 AS }}{{(SELECT n + 1 FROM t1 WHERE n < 5)}}
> {{  SELECT * FROM t2}}
> {{) SELECT * FROM t1;}}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to