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 ofScalarFunction
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
ReflectiveFunctionBase.ParameterListBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private CallImplementor
implementor
-
Fields inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
method, parameters
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ScalarFunctionImpl(java.lang.reflect.Method method, CallImplementor implementor)
Private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ScalarFunction
create(java.lang.Class<?> clazz, java.lang.String methodName)
CreatesScalarFunction
from given class.static ScalarFunction
create(java.lang.reflect.Method method)
CreatesScalarFunction
from given method.static com.google.common.collect.ImmutableMultimap<java.lang.String,ScalarFunction>
createAll(java.lang.Class<?> clazz)
CreatesScalarFunction
for each method in a given class.private static CallImplementor
createImplementor(java.lang.reflect.Method method)
CallImplementor
getImplementor()
Returns implementor that translates the function to linq4j expression.private static NullPolicy
getNullPolicy(java.lang.reflect.Method m)
RelDataType
getReturnType(RelDataTypeFactory typeFactory)
Returns the return type of this function, constructed using the given type factory.RelDataType
getReturnType(RelDataTypeFactory typeFactory, SqlOperatorBinding opBinding)
-
Methods inherited from class org.apache.calcite.schema.impl.ReflectiveFunctionBase
builder, classHasPublicZeroArgsConstructor, findMethod, 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
-
-
-
-
Field Detail
-
implementor
private final CallImplementor implementor
-
-
Constructor Detail
-
ScalarFunctionImpl
private ScalarFunctionImpl(java.lang.reflect.Method method, CallImplementor implementor)
Private constructor.
-
-
Method Detail
-
createAll
public static com.google.common.collect.ImmutableMultimap<java.lang.String,ScalarFunction> createAll(java.lang.Class<?> clazz)
CreatesScalarFunction
for each method in a given class.
-
create
public static ScalarFunction create(java.lang.Class<?> clazz, java.lang.String methodName)
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
public static ScalarFunction create(java.lang.reflect.Method method)
- Parameters:
method
- method that is used to implement the function- Returns:
- created
ScalarFunction
or null
-
getReturnType
public RelDataType getReturnType(RelDataTypeFactory typeFactory)
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
public CallImplementor 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.
-
createImplementor
private static CallImplementor createImplementor(java.lang.reflect.Method method)
-
getNullPolicy
private static NullPolicy getNullPolicy(java.lang.reflect.Method m)
-
getReturnType
public RelDataType getReturnType(RelDataTypeFactory typeFactory, SqlOperatorBinding opBinding)
-
-