[
https://issues.apache.org/jira/browse/SPARK-56426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated SPARK-56426:
-----------------------------------
Labels: pull-request-available (was: )
> [SQL] LATERAL VIEW column alias with dot in name fails to resolve in Spark 4.x
> ------------------------------------------------------------------------------
>
> Key: SPARK-56426
> URL: https://issues.apache.org/jira/browse/SPARK-56426
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.4.4, 4.1.1
> Reporter: Eric Yang
> Priority: Major
> Labels: pull-request-available
>
> *Problem*
> Using a backtick-quoted identifier containing a dot as a LATERAL VIEW column
> alias causes an UNRESOLVED_COLUMN error. The same query works in Spark 3.1.x.
>
> *Reproduction*
>
> {code:java}
> SELECT u.id, `skill.inst` FROM users u LATERAL VIEW OUTER explode(skills)
> skills_table AS `skill.inst`{code}
> *Error*
> {code:java}
> [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column, variable, or function parameter
> with name `skill.inst` cannot be resolved. Did you mean:
> `skills_table`.```skill.inst```{code}
> *Root Cause*
> ResolveGenerate extracts the column alias name via UnresolvedAttribute.name,
> which wraps dot-containing names in backtick characters (e.g. "skill.inst" →
> "`skill.inst`") for display purposes. This corrupted string is then used as
> the actual resolved attribute name, causing the subsequent SELECT-clause
> lookup to fail.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]