Serge Rielau created SPARK-47308:
------------------------------------
Summary: LATERAL regresses correlation name resolution
Key: SPARK-47308
URL: https://issues.apache.org/jira/browse/SPARK-47308
Project: Spark
Issue Type: Bug
Components: Spark Core
Affects Versions: 3.5.0, 3.3.0
Reporter: Serge Rielau
{code:java}
CREATE TABLE persons(name STRING);
INSERT INTO persons VALUES('Table: persons');
CREATE OR REPLACE TABLE women(name STRING);
INSERT INTO women VALUES('Table: women');
-- This works:
SELECT (SELECT max(folk.id)
FROM persons AS men(id),
(SELECT name) AS folk(id))
FROM women;
Table: women
-- This does not:
SELECT (SELECT max(folk.id)
FROM persons AS men(id),
LATERAL (SELECT name) AS folk(id))
FROM women;
[UNRESOLVED_COLUMN.WITHOUT_SUGGESTION] A column, variable, or function
parameter with name `name` cannot be resolved. SQLSTATE: 42703;{code}
This is weird. LATERAL should be strictly additive to name resolution rules.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]