vvysotskyi commented on a change in pull request #1837: [CALCITE-3835] 
Overloaded table functions fail with an assertion error if param types differ
URL: https://github.com/apache/calcite/pull/1837#discussion_r398469196
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/sql/SqlUtil.java
 ##########
 @@ -676,14 +680,16 @@ public static boolean matchRoutinesByParameterCount(
   }
 
   private static RelDataType bestMatch(List<SqlFunction> sqlFunctions, int i,
-      RelDataTypePrecedenceList precList) {
+      List<String> argNames, RelDataTypePrecedenceList precList) {
     RelDataType bestMatch = null;
     for (SqlFunction function : sqlFunctions) {
       List<RelDataType> paramTypes = function.getParamTypes();
       if (paramTypes == null) {
         continue;
       }
-      final RelDataType paramType = paramTypes.get(i);
+      final RelDataType paramType = argNames != null
+          ? paramTypes.get(function.getParamNames().indexOf(argNames.get(i)))
 
 Review comment:
   I have renamed `filterRoutinesByParameterType()` method and excracted logic 
connected with types and names permutation.

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


With regards,
Apache Git Services

Reply via email to