You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/10/31 09:10:00 UTC
[jira] [Assigned] (SPARK-40974) EXPODE function selects outer column
[ https://issues.apache.org/jira/browse/SPARK-40974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-40974:
------------------------------------
Assignee: (was: Apache Spark)
> EXPODE function selects outer column
> ------------------------------------
>
> Key: SPARK-40974
> URL: https://issues.apache.org/jira/browse/SPARK-40974
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.3.0
> Reporter: Omar Ismail
> Priority: Minor
>
> Im trying to determine if indirectly selecting an outer column is a bug or an intended feature of the EXPLODE function.
>
> If I run the following SQL statement:
> ```
> SELECT
> (SELECT FIRST(name_element_)
> FROM LATERAL VIEW EXPLODE(name) AS name_element_
> *)*
> FROM patient
> ```
>
> it fails with:
> ```
> Accessing outer query column is not allowed in:
> Generate explode(outer(name#9628))
> ```
>
> However, if I do a "cheeky select" (bolded below), the SQL query is valid and runs:
> ```
> SELECT(
> SELECT FIRST(name_element_)
> FROM (SELECT EXPLODE(name_element_) AS name_element_
> \{*}FROM ({*}{*}SELECT{*} *name AS name_element_)*
> ** )
> )
> FROM patient
> ```
> From the viewpoint of the EXPLODE function, it seems like the column name_element_ does not come from an outer column. Is this an intended feature or a bug?
--
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