gortiz commented on code in PR #12302:
URL: https://github.com/apache/pinot/pull/12302#discussion_r1478499714


##########
pinot-common/src/main/java/org/apache/pinot/common/function/FunctionRegistry.java:
##########
@@ -94,83 +155,196 @@ private FunctionRegistry() {
   public static void init() {
   }
 
+  @VisibleForTesting
+  public static void registerFunction(Method method) {
+    registerFunction(method, Collections.singleton(method.getName()), false, 
false);
+  }
+
+  @VisibleForTesting
+  public static Set<String> getRegisteredCalciteFunctionNames() {
+    return getFunctionMap().map().keySet();
+  }
+
+  /**
+   * Returns {@code true} if the given function name is registered, {@code 
false} otherwise.
+   */
+  public static boolean containsFunction(String functionName) {
+    return getFunctionMap().containsKey(functionName, CASE_SENSITIVITY);
+  }
+
   /**
-   * Registers a method with the name of the method.
+   * Returns the {@link FunctionInfo} associated with the given function name 
and number of parameters, or {@code null}
+   * if there is no matching method. This method should be called after the 
FunctionRegistry is initialized and all
+   * methods are already registered.
    */
-  public static void registerFunction(Method method, boolean 
nullableParameters, boolean isPlaceholder,
-      boolean isVarArg) {
-    registerFunction(method.getName(), method, nullableParameters, 
isPlaceholder, isVarArg);
+  @Nullable
+  public static FunctionInfo getFunctionInfo(String functionName, int 
numParams) {
+    return getFunctionInfoFromCalciteNamedMap(functionName, numParams);
   }
 
   /**
-   * Registers a method with the given function name.
+   * Returns the {@link FunctionInfo} associated with the given function name 
and number of parameters, or {@code null}

Review Comment:
   The Javadoc here is not correct, right? Isn't `#getFunctionInfo(String, 
int)` (declared above) the one that `Returns the FunctionInfo associated with 
the given function name and number of parameters` ?



-- 
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: commits-unsubscr...@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to