mihaibudiu commented on code in PR #5340:
URL: https://github.com/apache/calcite/pull/5340#discussion_r4319184315
##########
core/src/main/java/org/apache/calcite/sql/SqlUtil.java:
##########
@@ -766,6 +767,30 @@ private static Iterator<SqlOperator>
filterRoutinesByParameterTypeAndName(
});
}
+ /** Looks up a parameter name in a list of formal parameter names,
+ * case-insensitively.
+ *
+ * <p>Argument names from the parser are subject to unquoted casing (for
+ * example, {@code x => 1} becomes {@code X => 1}), while formal parameter
+ * names declared via {@link org.apache.calcite.linq4j.function.Parameter}
+ * annotations or reflection retain their case. Parameter names must
+ * therefore always be matched case-insensitively, consistent with
+ * {@link SqlCallBinding#operands()}.
+ *
+ * @param paramNames list of formal parameter names
+ * @param argName argument name to look up
+ * @return index of the first matching parameter, or -1 if not found
+ */
+ public static int lookupParamName(List<String> paramNames, String argName) {
Review Comment:
I think caseInsensitive should be in the name of the function
##########
core/src/main/java/org/apache/calcite/sql/SqlUtil.java:
##########
@@ -766,6 +767,30 @@ private static Iterator<SqlOperator>
filterRoutinesByParameterTypeAndName(
});
}
+ /** Looks up a parameter name in a list of formal parameter names,
+ * case-insensitively.
+ *
+ * <p>Argument names from the parser are subject to unquoted casing (for
Review Comment:
this paragraph only confuses things
--
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]