cloud-fan commented on a change in pull request #33142:
URL: https://github.com/apache/spark/pull/33142#discussion_r660906173



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubexpressionEliminationSuite.scala
##########
@@ -315,15 +311,17 @@ class SubexpressionEliminationSuite extends SparkFunSuite 
with ExpressionEvalHel
     val add1 = Add(Literal(1), Literal(2))
     val add2 = Add(Literal(2), Literal(3))
     val add3 = Add(add1, add2)
-    val condition = (GreaterThan(add3, Literal(3)), add3) :: Nil
+    val condition = (Literal(true), add3) :: Nil

Review comment:
       This is a long-standing issue, discussed in 
https://github.com/apache/spark/pull/32559/files#r633911273
   
   If the condition is `GreaterThan(add3, Literal(3)`, then `add1` and `add2` 
will be treated as common subexpressions, similar to 
https://github.com/apache/spark/pull/33142/files#diff-27f45b563969445dc46c8586c8f45c59cd1a583d400bc69457ea6f2e3c94f202R178
   
   This is because the first condition of `CaseWhen` is part of 
`childrenToRecurse`




-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to