Skip to content
Prev Previous commit
Next Next commit
fix test failures
  • Loading branch information
kiszk committed Apr 4, 2018
commit 0530dcc2c32eb7ebcd86d66ede6f3fad9a6f797f
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ case class StaticInvoke(
returnNullable: Boolean = true) extends InvokeLike {

val objectName = staticObject.getName.stripSuffix("$")
val argClasses = ScalaReflection.expressionJavaClasses(arguments)
val cls = if (staticObject.getName == objectName) {
staticObject
} else {
Expand All @@ -228,6 +227,7 @@ case class StaticInvoke(
override def nullable: Boolean = needNullCheck || returnNullable
override def children: Seq[Expression] = arguments

lazy val argClasses = ScalaReflection.expressionJavaClasses(arguments)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make this lazy. This is because StaticInvoke is also called before dataType is resolved.
For example, test.org.apache.spark.sql.JavaDatasetSuite.test was failed without lazy.

@transient lazy val method = cls.getDeclaredMethod(functionName, argClasses : _*)

override def eval(input: InternalRow): Any = {
Expand Down