You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Bruce Robbins (Jira)" <ji...@apache.org> on 2026/09/08 23:20:00 UTC

[jira] [Created] (SPARK-59351) Nested subquery results in plan node that references non-reachable attributes

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: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org