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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/EquivalentExpressions.scala
##########
@@ -82,21 +82,31 @@ class EquivalentExpressions {
   /**
    * Adds only expressions which are common in each of given expressions, in a 
recursive way.
    * For example, given two expressions `(a + (b + (c + 1)))` and `(d + (e + 
(c + 1)))`,
-   * the common expression `(c + 1)` will be added into `equivalenceMap`.
+   * the common expression `(c + 1)` will be added into `equivalenceMap`. Note 
that if an
+   * expression and its child expressions are all commonly occurred in each of 
given expressions,
+   * we filter out the child expressions. For example, if `((a + b) + c)` and 
`(a + b)` are
+   * common expressions, we only add `((a + b) + c)`.

Review comment:
       Updated the comment.




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