You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jarno Rajala (Jira)" <ji...@apache.org> on 2023/02/22 10:24:00 UTC

[jira] [Commented] (SPARK-39198) Cannot refer to nested CTE within a nested CTE in a subquery.

    [ https://issues.apache.org/jira/browse/SPARK-39198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17692100#comment-17692100 ] 

Jarno Rajala commented on SPARK-39198:
--------------------------------------

Seems like the issue has been fixed in 3.3.2.

> Cannot refer to nested CTE within a nested CTE in a subquery.
> -------------------------------------------------------------
>
>                 Key: SPARK-39198
>                 URL: https://issues.apache.org/jira/browse/SPARK-39198
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.2.1, 3.3.0
>         Environment: Tested on
>  * Databricks runtime 10.4
>  * Spark 3.2.1 from [https://spark.apache.org/downloads.html]
>  * GitHub apache/spark 'master' commit 17b85ff9
>            Reporter: Jarno Rajala
>            Priority: Major
>
> The following query fails with {color:#ff0000}Table or view not found: cte1;{color}
> {code:java}
> set spark.sql.legacy.ctePrecedencePolicy=CORRECTED;
> with
> cte1 as (select 1)
> select * from (
>   with
>     cte2 as (select * from cte1)
>     select * from cte2
> ); {code}
> Or Spark 3.1.1 it returns 1 as expected.
> This is related to SPARK-38404, but different, since the query fails with Spark built from 'master' (commit 17b85ff9). The [PR #36146|https://github.com/apache/spark/pull/36146] therefore does not fix this issue.



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

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