viirya commented on a change in pull request #30245:
URL: https://github.com/apache/spark/pull/30245#discussion_r520089446



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/EquivalentExpressions.scala
##########
@@ -96,8 +151,9 @@ class EquivalentExpressions {
       case other => other.children
     }
 
-    if (!skip && !addExpr(expr)) {
-      childrenToRecurse.foreach(addExprTree)
+    if (!skip && !addFunc(expr)) {
+      childrenToRecurse.foreach(addExprTree(_, addFunc))
+      
commonChildrenToRecurse(expr).filter(_.nonEmpty).foreach(addCommonExprs(_, 
addFunc))

Review comment:
       > childrenToRecurse is an inner method, shall we make 
commonChildrenToRecurse an inner method as well and put it next to 
childrenToRecurse?
   
   @cloud-fan That is what I did initially, but put it outside for review 
comment https://github.com/apache/spark/pull/30245#discussion_r518409583. Both 
work for me. 




----------------------------------------------------------------
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.

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