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 ScalarFunction
CreatesScalarFunction
from given class.static ScalarFunction
CreatesScalarFunction
from given method.static com.google.common.collect.ImmutableMultimap<String,
ScalarFunction> Deprecated.static ScalarFunction
createUnsafe
(Method method) Creates unsafe version ofScalarFunction
from 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, getParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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.CreatesScalarFunction
for 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 bothScalarFunction
andTableFunction
. -
create
CreatesScalarFunction
from 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
ScalarFunction
or null
-
create
- Parameters:
method
- method that is used to implement the function- Returns:
- created
ScalarFunction
or null
-
createUnsafe
Creates unsafe version ofScalarFunction
from 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:ScalarFunction
Returns the return type of this function, constructed using the given type factory.- Specified by:
getReturnType
in interfaceScalarFunction
- Parameters:
typeFactory
- Type factory
-
getImplementor
Description copied from interface:ImplementableFunction
Returns implementor that translates the function to linq4j expression.- Specified by:
getImplementor
in interfaceImplementableFunction
- Returns:
- implementor that translates the function to linq4j expression.
-
getReturnType
-