We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3829aaa commit 9fc152cCopy full SHA for 9fc152c
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
@@ -325,13 +325,11 @@ case class Invoke(
325
326
@transient lazy val method = targetObject.dataType match {
327
case ObjectType(cls) =>
328
- val m = cls.getMethods.find { m =>
329
- m.getName == encodedFunctionName && m.getParameterCount == arguments.length
330
- }
331
- if (m.isEmpty) {
332
- sys.error(s"Couldn't find $encodedFunctionName on $cls")
333
- } else {
334
- m
+ try {
+ Some(cls.getMethod(encodedFunctionName, argClasses: _*))
+ } catch {
+ case _: NoSuchMethodException =>
+ sys.error(s"Couldn't find $encodedFunctionName on $cls")
335
}
336
case _ => None
337
0 commit comments