Package org.apache.calcite.schema.impl
Class ScalarFunctionImpl
java.lang.Object
org.apache.calcite.schema.impl.ReflectiveFunctionBase
org.apache.calcite.schema.impl.ScalarFunctionImpl
- All Implemented Interfaces:
Function,ImplementableFunction,ScalarFunction
public class ScalarFunctionImpl
extends ReflectiveFunctionBase
implements ScalarFunction, ImplementableFunction
Implementation of
ScalarFunction.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
ReflectiveFunctionBase.ParameterListBuilder -
Field Summary
Fields inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
method, parameters -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable ScalarFunctionCreatesScalarFunctionfrom given class.static ScalarFunctionCreatesScalarFunctionfrom given method.static com.google.common.collect.ImmutableMultimap<String,ScalarFunction> Deprecated.static ScalarFunctioncreateUnsafe(Method method) Creates unsafe version ofScalarFunctionfrom any method.Returns a map of all functions based on the methods in a given class.Returns implementor that translates the function to linq4j expression.getReturnType(RelDataTypeFactory typeFactory) Returns the return type of this function, constructed using the given type factory.getReturnType(RelDataTypeFactory typeFactory, SqlOperatorBinding opBinding) Methods inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
builder, getParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.schema.Function
getParameters
-
Method Details
-
createAll
@Deprecated public static com.google.common.collect.ImmutableMultimap<String,ScalarFunction> createAll(Class<?> clazz) Deprecated.CreatesScalarFunctionfor each method in a given class. -
functions
public static com.google.common.collect.ImmutableMultimap<String,Function> functions(Class<?> clazz) Returns a map of all functions based on the methods in a given class. It is keyed by method names and maps to bothScalarFunctionandTableFunction. -
create
CreatesScalarFunctionfrom given class.If a method of the given name is not found, or it does not suit, returns
null.- Parameters:
clazz- class that is used to implement the functionmethodName- Method name (typically "eval")- Returns:
- created
ScalarFunctionor null
-
create
- Parameters:
method- method that is used to implement the function- Returns:
- created
ScalarFunctionor null
-
createUnsafe
Creates unsafe version ofScalarFunctionfrom any method. The method does not need to be static or belong to a class with default constructor. It is the responsibility of the underlying engine to initialize the UDF object that contain the method.- Parameters:
method- method that is used to implement the function
-
getReturnType
Description copied from interface:ScalarFunctionReturns the return type of this function, constructed using the given type factory.- Specified by:
getReturnTypein interfaceScalarFunction- Parameters:
typeFactory- Type factory
-
getImplementor
Description copied from interface:ImplementableFunctionReturns implementor that translates the function to linq4j expression.- Specified by:
getImplementorin interfaceImplementableFunction- Returns:
- implementor that translates the function to linq4j expression.
-
getReturnType
-