Skip to content

Commit 8b0401c

Browse files
committed
added a test case
1 parent 3501420 commit 8b0401c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceNullWithFalseInPredicateSuite.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ class ReplaceNullWithFalseInPredicateSuite extends PlanTest {
4848
testJoin(originalCond = Literal(null, BooleanType), expectedCond = FalseLiteral)
4949
}
5050

51+
test("Not expected type - replaceNullWithFalse") {
52+
val e = intercept[IllegalArgumentException] {
53+
testFilter(originalCond = Literal(null, IntegerType), expectedCond = FalseLiteral)
54+
}.getMessage
55+
assert(e.contains("but got the type `int` in `CAST(NULL AS INT)"))
56+
}
57+
5158
test("replace null in branches of If") {
5259
val originalCond = If(
5360
UnresolvedAttribute("i") > Literal(10),

0 commit comments

Comments
 (0)