File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,15 @@ class ObjectExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
8383 InternalRow .fromSeq(Seq ()),
8484 """ A method named "nonexisting" is not declared in any enclosing class """ +
8585 " nor any supertype" )
86+
87+ val initializeWithWrongParamType = InitializeJavaBean (
88+ Literal .fromObject(new TestBean ),
89+ Map (" setX" -> Literal (" 1" )))
90+ intercept[Exception ] {
91+ evaluateWithoutCodegen(initializeWithWrongParamType, InternalRow .fromSeq(Seq ()))
92+ }.getMessage.contains(
93+ """ A method named "setX" is not declared in any enclosing class """ +
94+ " nor any supertype" )
8695 }
8796
8897 test(" SPARK-23585: UnwrapOption should support interpreted execution" ) {
@@ -127,3 +136,9 @@ class ObjectExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
127136 " The 0th field 'c0' of input row cannot be null." )
128137 }
129138}
139+
140+ class TestBean extends Serializable {
141+ private var x : Int = 0
142+
143+ def setX (i : Int ): Unit = x = i
144+ }
You can’t perform that action at this time.
0 commit comments