cloud-fan commented on a change in pull request #23057: [SPARK-26078][SQL]
Dedup self-join attributes on IN subqueries
URL: https://github.com/apache/spark/pull/23057#discussion_r241305806
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
##########
@@ -54,10 +54,7 @@ object RewritePredicateSubquery extends Rule[LogicalPlan]
with PredicateHelper {
val aliasMap = AttributeMap(duplicates.map { dup =>
dup -> Alias(dup, dup.toString)()
}.toSeq)
- val aliasedExpressions = right.output.map { ref =>
- aliasMap.getOrElse(ref, ref)
- }
- val newRight = Project(aliasedExpressions, right)
+ val newRight = rewriteDedupPlan(right, aliasMap)
val newJoinCond = joinCond.map { condExpr =>
Review comment:
not related to your PR, but is this corrected? The duplicated attributes in
join condition may refer to left or right child, how can we blindly replace
them with new attributes from right side?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]