dongjoon-hyun commented on a change in pull request #29776:
URL: https://github.com/apache/spark/pull/29776#discussion_r489798488



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodegenExpressionCachingSuite.scala
##########
@@ -85,6 +85,36 @@ class CodegenExpressionCachingSuite extends SparkFunSuite {
     assert(instance2.eval(null))
   }
 
+  test("SPARK-32903: GeneratePredicate should eliminate sub-expressions") {
+    Seq(true, false).foreach { enabled =>
+      val leaf1 = ExprWithEvaluatedState()
+      val leaf2 = ExprWithEvaluatedState()
+      val leaf3 = ExprWithEvaluatedState()
+      val leaf4 = ExprWithEvaluatedState()
+
+      val expr1 = And(leaf1, leaf2)
+      val expr2 = And(leaf3, leaf4)
+      val cond = Or(expr1, expr2)

Review comment:
       `expr1` and `expr2` is not reused in the other places.




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