jnturton commented on code in PR #2638:
URL: https://github.com/apache/drill/pull/2638#discussion_r971630497


##########
exec/java-exec/src/main/java/org/apache/drill/exec/resolver/DefaultFunctionResolver.java:
##########
@@ -58,27 +56,20 @@ public DrillFuncHolder getBestMatch(List<DrillFuncHolder> 
methods, FunctionCall
       }
     }
 
-    if (bestcost < 0) {
+    if (bestcost == Float.POSITIVE_INFINITY) {
       //did not find a matched func implementation, either w/ or w/o implicit 
casts
       //TODO: raise exception here?
       return null;
-    } else {
-      if (AssertionUtil.isAssertionsEnabled() && bestMatchAlternatives.size() 
> 0) {
-        /*
-         * There are other alternatives to the best match function which could 
have been selected
-         * Log the possible functions and the chose implementation and raise 
an exception
-         */
-        logger.error("Chosen function impl: " + bestmatch.toString());
-
-        // printing the possible matches
-        logger.error("Printing all the possible functions that could have 
matched: ");
-        for (DrillFuncHolder holder: bestMatchAlternatives) {
-          logger.error(holder.toString());
-        }
+    }
+    if (bestMatchAlternatives.size() > 0) {

Review Comment:
   @vvysotskyi do you think it would be better to introduce a deterministic way 
of choosing between multiple functions of the same cost, so that query results 
are consistent, or to raise an error? To me the first route seems better...
   
   Footnotes. I think it will seldom be the case that two functions with equal 
casting cost will be found, but nothing precludes it. As always users still 
have the ability to use explicit casts to manually control which function is 
used.



-- 
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: dev-unsubscr...@drill.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to