Kimahriman commented on a change in pull request #33281:
URL: https://github.com/apache/spark/pull/33281#discussion_r667343014
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/SubexpressionEliminationSuite.scala
##########
@@ -323,6 +323,34 @@ class SubexpressionEliminationSuite extends SparkFunSuite
with ExpressionEvalHel
assert(commonExprs.head.expr eq add3)
}
+ test("SPARK-36073: SubExpr elimination should include common child exprs of
conditional " +
+ "expressions") {
+ val add = Add(Literal(1), Literal(2))
+ val ifExpr1 = If(Literal(true), add, Literal(3))
+ val ifExpr3 = If(GreaterThan(add, Literal(4)), Add(ifExpr1, add),
Multiply(ifExpr1, add))
+
+ val equivalence = new EquivalentExpressions
+ equivalence.addExprTree(ifExpr3)
Review comment:
What was the behavior of this?
--
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]