Skip to content

Commit

Permalink
Test error message of interpreted execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Mar 7, 2018
1 parent 0c48a9b commit b8f171e
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -75,6 +75,14 @@ class ObjectExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
val initializeBean = InitializeJavaBean(Literal.fromObject(new java.util.LinkedList[Int]),
Map("add" -> Literal(1)))
checkEvaluation(initializeBean, list, InternalRow.fromSeq(Seq()))

val errMsg = intercept[RuntimeException] {
val initializeWithNonexistingMethod = InitializeJavaBean(
Literal.fromObject(new java.util.LinkedList[Int]),
Map("nonexisting" -> Literal(1)))
evaluate(initializeWithNonexistingMethod, InternalRow.fromSeq(Seq()))
}.getMessage
assert(errMsg.contains("but 0 methods found."))
}

test("SPARK-23585: UnwrapOption should support interpreted execution") {
Expand Down

0 comments on commit b8f171e

Please sign in to comment.