You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2022/05/19 06:40:00 UTC

[jira] [Updated] (SPARK-39216) Do not collapse projects in CombineUnions if it hasCorrelatedSubquery

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

Dongjoon Hyun updated SPARK-39216:
----------------------------------
    Summary: Do not collapse projects in CombineUnions if it hasCorrelatedSubquery  (was: Issue with correlated subquery and Union)

> Do not collapse projects in CombineUnions if it hasCorrelatedSubquery
> ---------------------------------------------------------------------
>
>                 Key: SPARK-39216
>                 URL: https://issues.apache.org/jira/browse/SPARK-39216
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Allison Wang
>            Assignee: Yuming Wang
>            Priority: Major
>             Fix For: 3.3.1
>
>
>  
> SPARK-37915 added CollapseProject in rule CombineUnions, but it shouldn't collapse projects that contain correlated subqueries since haven't been de-correlated (PullupCorrelatedPredicates).
> Here is a simple example to reproduce this issue
> {code:java}
> SELECT (SELECT IF(x, 1, 0)) AS a
> FROM (SELECT true) t(x)
> UNION 
> SELECT 1 AS a {code}
> Exception:
> {code:java}
> java.lang.IllegalStateException: Couldn't find x#4 in [] {code}
>  



--
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