zhangfengcdt commented on code in PR #2831:
URL: https://github.com/apache/sedona/pull/2831#discussion_r3111965842


##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/FunctionResolver.scala:
##########
@@ -82,14 +82,10 @@ object FunctionResolver {
         if (ambiguousMatches.length == 1) {
           function
         } else {
-          // Detected ambiguous matches, throw exception
-          val candidateTypesMsg = ambiguousMatches
-            .map { case (function, _) =>
-              "  (" + function.sparkInputTypes.mkString(", ") + ")"
-            }
-            .mkString("\n")
-          throw new IllegalArgumentException(
-            "Ambiguous function call. Candidates are: \n" + candidateTypesMsg)
+          // Multiple candidates match equally (e.g., null inputs matching 
both Geometry and
+          // Geography overloads). Prefer the first candidate — for null 
inputs all overloads
+          // return null, so the choice is irrelevant.
+          ambiguousMatches.head._1
         }

Review Comment:
   Silent first-candidate selection only fires when every argument is NullType; 
otherwise throws IllegalArgumentException with a candidate-list message.



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to