dbtsai commented on a change in pull request #29603:
URL: https://github.com/apache/spark/pull/29603#discussion_r480779334
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/SimplifyConditionalSuite.scala
##########
@@ -166,29 +166,37 @@ class SimplifyConditionalSuite extends PlanTest with
ExpressionEvalHelper with P
)
}
- test("simplify if when then clause is null and else clause is boolean") {
+ test("simplify if when one clause is null and another is boolean") {
val p = IsNull('a)
val nullLiteral = Literal(null, BooleanType)
assertEquivalent(If(p, nullLiteral, FalseLiteral), And(p, nullLiteral))
assertEquivalent(If(p, nullLiteral, TrueLiteral), Or(IsNotNull('a),
nullLiteral))
+ assertEquivalent(If(p, FalseLiteral, nullLiteral), And(IsNotNull('a),
nullLiteral))
+ assertEquivalent(If(p, TrueLiteral, nullLiteral), Or(IsNull('a),
nullLiteral))
Review comment:
minor, make it consistent with the first test. Either we use `p` for
`IsNull('a)` or in first test, we use `IsNull('a)`.
----------------------------------------------------------------
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]