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

Wenchen Fan updated SPARK-46526:
--------------------------------
        Parent: SPARK-35553
    Issue Type: Sub-task  (was: Bug)

> Limit over certain correlated subqueries results in Nosuchelement exception
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-46526
>                 URL: https://issues.apache.org/jira/browse/SPARK-46526
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.4.0
>            Reporter: Andrey Gubichev
>            Assignee: Andrey Gubichev
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>
> The types of queries that result in errors are:
>  * have LIMIT in the subquery
>  * predicate with correlated references does not depend on the inner query 
> (references exclusively outer table).
> For example:
> {code:java}
> SELECT COUNT(DISTINCT(t1a))
> FROM t1
> WHERE t1d IN (SELECT t2d
>               FROM   t2
>               WHERE t1a IS NOT NULL
>               LIMIT 10);
>  {code}
> Here, WHERE t1a IS NOT NULL can be conceptually lifted to the join that 
> connects inner and outer query. 
> Currently, this query results in an error ("no such element exception").



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