Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0.0
Description
`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.
Attachments
Issue Links
- links to