[
https://issues.apache.org/jira/browse/SPARK-46640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dongjoon Hyun closed SPARK-46640.
---------------------------------
> RemoveRedundantAliases does not account for SubqueryExpression when removing
> aliases
> ------------------------------------------------------------------------------------
>
> Key: SPARK-46640
> URL: https://issues.apache.org/jira/browse/SPARK-46640
> Project: Spark
> Issue Type: Bug
> Components: Optimizer
> Affects Versions: 4.0.0
> Reporter: Nikhil Sheoran
> Assignee: Nikhil Sheoran
> Priority: Minor
> Labels: pull-request-available
> Fix For: 3.5.1, 4.0.0
>
>
> `RemoveRedundantAliases{{{}`{}}} does not take into account the outer
> attributes of a `SubqueryExpression` aliases, potentially removing them if it
> thinks they are redundant.
> This can cause scenarios where a subquery expression has conditions like `a#x
> = a#x` i.e. both the attribute names and the expression ID(s) are the same.
> This can then lead to conflicting expression ID(s) error.
> In `RemoveRedundantAliases`, we have an excluded AttributeSet argument
> denoting the references for which we should not remove aliases. For a query
> with a subquery expression, adding the references of this subquery in the
> excluded set prevents such rewrite from happening.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]