Bruce Robbins created SPARK-59351:
-------------------------------------

             Summary: Nested subquery results in plan node that references 
non-reachable attributes
                 Key: SPARK-59351
                 URL: https://issues.apache.org/jira/browse/SPARK-59351
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 4.0.1
            Reporter: Bruce Robbins


In Spark, this query gets an error:
{noformat}
select *
from (values (1), (2), (3)) as t1(a)
where exists (
  select c1
  from (values (1), (8), (9)) as t2(c1)
  where a = c1
  or c1 in (select col1 from (values (3), (9)) as t3(col1))
);

[INTERNAL_ERROR] Couldn't find c1#25 in [a#24,col1#26] SQLSTATE: XX000
{noformat}
In Postgresql and DuckDB, the same query returns the following:
{noformat}
 a 
---
 1
 2
 3
(3 rows)
{noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to