[ https://issues.apache.org/jira/browse/SPARK-53040?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-53040: ----------------------------------- Labels: pull-request-available (was: ) > Ban self references inside topmost CTEs in Recursive CTEs > --------------------------------------------------------- > > Key: SPARK-53040 > URL: https://issues.apache.org/jira/browse/SPARK-53040 > Project: Spark > Issue Type: Sub-task > Components: SQL > Affects Versions: 4.1.0 > Reporter: Pavle Martinović > Priority: Major > Labels: pull-request-available > Fix For: 4.1.0 > > > Currently for queries that become recursive because self references inside > CTEs that apply to the whole union, but aren't called in the anchor are > allowed. Most other engines ban this behavior. An example of an affected > query: > > WITH RECURSIVE t1 AS ( > WITH t2(n ) AS (SELECT * FROM t1) > SELECT 1 AS n > UNION ALL > SELECT n+1 FROM t2 WHERE n < 5) > SELECT * FROM t1; > > This removes no functionality, since just moving the WITH beneath the UNION > ALL will create an equivalent query. -- 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