cloud-fan commented on a change in pull request #30852:
URL: https://github.com/apache/spark/pull/30852#discussion_r547723985
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SimplifyConditionalSuite.scala
##########
@@ -215,4 +215,24 @@ class SimplifyConditionalSuite extends PlanTest with
ExpressionEvalHelper with P
If(GreaterThan(Rand(0), UnresolvedAttribute("a")), FalseLiteral,
TrueLiteral),
LessThanOrEqual(Rand(0), UnresolvedAttribute("a")))
}
+
+ test("SPARK-33847: Remove the CaseWhen if elseValue is empty and other
outputs are null") {
+ assertEquivalent(
+ CaseWhen((GreaterThan('a, 1), Literal.create(null, IntegerType)) :: Nil,
Review comment:
ditto, `Seq(GreaterThan('a, 1), GreaterThan(Rand(0), 1)).foreach...`
----------------------------------------------------------------
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]