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 2022/05/16 17:42:00 UTC
[jira] [Updated] (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:all-tabpanel ]
Jarno Rajala updated SPARK-39198:
---------------------------------
Description:
The following query fails with {color:#ff0000}Table or view not found: cte1;{color}
{{set spark.sql.legacy.ctePrecedencePolicy=CORRECTED;}}
{{with}}
{{cte1 as (select 1)}}
{{select * from (}}
{{ with}}
{{ cte2 as (select * from cte1)}}
{{ select * from cte2}}
{{);}}
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.
was:
The following query fails with {color:#ff0000}Table or view not found: cte1;{color}
{{set spark.sql.legacy.ctePrecedencePolicy=CORRECTED;}}
{{with}}
{{{}cte1 as (select 1){}}}{{{}select * from ({}}}
{{ with}}
{{ cte2 as (select * from cte1)}}
{{ select * from cte2}}
{{);}}
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.
> 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
> 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}
> {{set spark.sql.legacy.ctePrecedencePolicy=CORRECTED;}}
> {{with}}
> {{cte1 as (select 1)}}
> {{select * from (}}
> {{ with}}
> {{ cte2 as (select * from cte1)}}
> {{ select * from cte2}}
> {{);}}
>
> 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.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org