public class ScalarFunctionImpl extends ReflectiveFunctionBase implements ScalarFunction, ImplementableFunction
ScalarFunction.ReflectiveFunctionBase.ParameterListBuildermethod, parameters| Modifier and Type | Method and Description |
|---|---|
static @Nullable ScalarFunction |
create(Class<?> clazz,
String methodName)
Creates
ScalarFunction from given class. |
static ScalarFunction |
create(Method method)
Creates
ScalarFunction from given method. |
static com.google.common.collect.ImmutableMultimap<String,ScalarFunction> |
createAll(Class<?> clazz)
Deprecated.
|
static ScalarFunction |
createUnsafe(Method method)
Creates unsafe version of
ScalarFunction from any method. |
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.
|
CallImplementor |
getImplementor()
Returns implementor that translates the function to linq4j expression.
|
RelDataType |
getReturnType(RelDataTypeFactory typeFactory)
Returns the return type of this function, constructed using the given
type factory.
|
RelDataType |
getReturnType(RelDataTypeFactory typeFactory,
SqlOperatorBinding opBinding) |
builder, getParametersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetParameters@Deprecated public static com.google.common.collect.ImmutableMultimap<String,ScalarFunction> createAll(Class<?> clazz)
ScalarFunction for each method in
a given class.public static com.google.common.collect.ImmutableMultimap<String,Function> functions(Class<?> clazz)
ScalarFunction
and TableFunction.public static @Nullable ScalarFunction create(Class<?> clazz, String methodName)
ScalarFunction from given class.
If a method of the given name is not found or it does not suit,
returns null.
clazz - class that is used to implement the functionmethodName - Method name (typically "eval")ScalarFunction or nullpublic static ScalarFunction create(Method method)
method - method that is used to implement the functionScalarFunction or nullpublic static ScalarFunction createUnsafe(Method method)
ScalarFunction 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.method - method that is used to implement the functionpublic RelDataType getReturnType(RelDataTypeFactory typeFactory)
ScalarFunctiongetReturnType in interface ScalarFunctiontypeFactory - Type factorypublic CallImplementor getImplementor()
ImplementableFunctiongetImplementor in interface ImplementableFunctionpublic RelDataType getReturnType(RelDataTypeFactory typeFactory, SqlOperatorBinding opBinding)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.