You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/07/10 13:59:06 UTC
[GitHub] [spark] Kimahriman commented on a change in pull request #33281: [SPARK-36073][SQL] EquivalentExpressions fixes and improvements
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org