Package org.apache.pinot.common.function
Class FunctionRegistry
- java.lang.Object
-
- org.apache.pinot.common.function.FunctionRegistry
-
public class FunctionRegistry extends Object
Registry for scalar functions.TODO: Merge FunctionRegistry and FunctionDefinitionRegistry to provide one single registry for all functions.
-
-
Method Summary
Modifier and Type Method Description static booleancontainsFunction(String functionName)Returnstrueif the given function name is registered,falseotherwise.static FunctionInfogetFunctionInfo(String functionName, int numParameters)Returns theFunctionInfoassociated with the given function name and number of parameters, ornullif there is no matching method.static Map<String,List<org.apache.calcite.schema.Function>>getRegisteredCalciteFunctionMap()static Set<String>getRegisteredCalciteFunctionNames()static Collection<org.apache.calcite.schema.Function>getRegisteredCalciteFunctions(String name)static voidinit()Initializes the FunctionRegistry.static voidregisterFunction(Method method, boolean nullableParameters)Registers a method with the name of the method.static voidregisterFunction(String functionName, Method method, boolean nullableParameters)Registers a method with the given function name.
-
-
-
Method Detail
-
init
public static void init()
Initializes the FunctionRegistry. NOTE: This method itself is a NO-OP, but can be used to explicitly trigger the static block of registering the scalar functions via reflection.
-
registerFunction
public static void registerFunction(Method method, boolean nullableParameters)
Registers a method with the name of the method.
-
registerFunction
public static void registerFunction(String functionName, Method method, boolean nullableParameters)
Registers a method with the given function name.
-
getRegisteredCalciteFunctionMap
public static Map<String,List<org.apache.calcite.schema.Function>> getRegisteredCalciteFunctionMap()
-
getRegisteredCalciteFunctions
public static Collection<org.apache.calcite.schema.Function> getRegisteredCalciteFunctions(String name)
-
containsFunction
public static boolean containsFunction(String functionName)
Returnstrueif the given function name is registered,falseotherwise.
-
getFunctionInfo
@Nullable public static FunctionInfo getFunctionInfo(String functionName, int numParameters)
Returns theFunctionInfoassociated with the given function name and number of parameters, ornullif there is no matching method. This method should be called after the FunctionRegistry is initialized and all methods are already registered.
-
-