maropu commented on a change in pull request #32519:
URL: https://github.com/apache/spark/pull/32519#discussion_r630787080



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
##########
@@ -151,7 +151,7 @@ trait InvokeLike extends Expression with NonSQLExpression {
   final def findMethod(cls: Class[_], functionName: String, argClasses: 
Seq[Class[_]]): Method = {
     val method = MethodUtils.getMatchingAccessibleMethod(cls, functionName, 
argClasses: _*)
     if (method == null) {
-      sys.error(s"Couldn't find $functionName on $cls")
+      throw QueryExecutionErrors.methodNotDeclaredError(functionName)

Review comment:
       This file has one more `sys.error`? 
https://github.com/apache/spark/blob/1bcc51223141236d0f785c65de4c69f13a257033/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala#L488
   
   The change looks fine for consistency.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to