shrirangmhalgi commented on code in PR #58753:
URL: https://github.com/apache/spark/pull/58753#discussion_r3994517257


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/DeduplicateRelations.scala:
##########
@@ -29,6 +29,13 @@ import org.apache.spark.sql.internal.SQLConf
 object DeduplicateRelations extends Rule[LogicalPlan] {
   type ExprIdMap = mutable.HashMap[Class[_], mutable.HashSet[Long]]
 
+  /** Renews `right` against expression IDs collected from `left`. */
+  private[sql] def deduplicateRight(left: LogicalPlan, right: LogicalPlan): 
LogicalPlan = {

Review Comment:
   (non-blocking): This calls `renewDuplicatedRelations` directly, skipping 
`apply()`'s top-level dispatch for Union/Merge/Join cases. For self-dedup 
(`deduplicateRight(plan, plan)`) this is correct since we just want ID renewal. 
The equivalence test covers `Project`-based plans -- would it be worth adding a 
case with a nested Union inside the plan to confirm the two paths match?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to