Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/21770#discussion_r202543135
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -1585,6 +1585,9 @@ case class InitializeJavaBean(beanInstance:
Expression, setters: Map[String, Exp
}
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
+ // Resolves setters before compilation
+ require(resolvedSetters.nonEmpty)
--- End diff --
In the master, [this
test](https://github.com/apache/spark/blob/69993217fc4f5e5e41a297702389e86fe534dc2f/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ObjectExpressionsSuite.scala#L217)
currently depends on the message of janino compilation errors. So, If we used
JDK java compilers, the test could fail (because the compilers throw an
exception with a different message). To fix this, the change check the setters
before compilation.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]