walterddr commented on code in PR #12302:
URL: https://github.com/apache/pinot/pull/12302#discussion_r1478978457
##########
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:
good catch. this was a copied javadoc. should've changed. but didn't when i
merged it with https://github.com/walterddr/pinot/pull/92
--
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]