agavra commented on code in PR #9602:
URL: https://github.com/apache/pinot/pull/9602#discussion_r996506789


##########
pinot-common/src/main/java/org/apache/pinot/common/function/FunctionRegistry.java:
##########
@@ -140,8 +133,30 @@ public static boolean containsFunction(String 
functionName) {
    */
   @Nullable
   public static FunctionInfo getFunctionInfo(String functionName, int 
numParameters) {
-    Map<Integer, FunctionInfo> functionInfoMap = 
FUNCTION_INFO_MAP.get(canonicalize(functionName));
-    return functionInfoMap != null ? functionInfoMap.get(numParameters) : null;
+    Collection<Map.Entry<String, Function>> allFunctions = 
FUNCTION_MAP.range(canonicalize(functionName), true);
+    if (allFunctions.isEmpty()) {
+      return null;
+    }
+
+    List<Function> matchingFunctions = allFunctions
+        .stream()
+        .map(Map.Entry::getValue)
+        .filter(fun -> fun.getParameters().size() == numParameters)
+        .collect(Collectors.toList());

Review Comment:
   getting function info happens once (per function) per query, right? not on 
every invocation of it? I'll remove it just in case, but I'd be shocked if 
things that happen once per query were a bottleneck



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


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

Reply via email to