@Internal public final class UserDefinedFunctionHelper extends Object
UserDefinedFunction
. The purpose of this class is
to keep the user-facing APIs clean and offer methods/constants from here.
It contains methods for instantiating, validating and extracting types during function registration in a catalog.
Modifier and Type | Field and Description |
---|---|
static String |
AGGREGATE_ACCUMULATE |
static String |
AGGREGATE_MERGE |
static String |
AGGREGATE_RESET |
static String |
AGGREGATE_RETRACT |
static String |
ASYNC_TABLE_EVAL |
static String |
SCALAR_EVAL |
static String |
TABLE_AGGREGATE_ACCUMULATE |
static String |
TABLE_AGGREGATE_EMIT |
static String |
TABLE_AGGREGATE_EMIT_RETRACT |
static String |
TABLE_AGGREGATE_RETRACT |
static String |
TABLE_EVAL |
Modifier and Type | Method and Description |
---|---|
static <T,ACC> TypeInformation<ACC> |
getAccumulatorTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static <T,ACC> TypeInformation<ACC> |
getAccumulatorTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction,
TypeInformation<ACC> scalaType)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static <T,ACC> TypeInformation<T> |
getReturnTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static <T,ACC> TypeInformation<T> |
getReturnTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction,
TypeInformation<T> scalaType)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static <T> TypeInformation<T> |
getReturnTypeOfTableFunction(TableFunction<T> tableFunction)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static <T> TypeInformation<T> |
getReturnTypeOfTableFunction(TableFunction<T> tableFunction,
TypeInformation<T> scalaType)
Tries to infer the TypeInformation of an AggregateFunction's accumulator type.
|
static UserDefinedFunction |
instantiateFunction(Class<? extends UserDefinedFunction> functionClass)
Instantiates a
UserDefinedFunction assuming a default constructor. |
static void |
prepareInstance(ReadableConfig config,
UserDefinedFunction function)
Prepares a
UserDefinedFunction instance for usage in the API. |
static void |
validateClass(Class<? extends UserDefinedFunction> functionClass)
Validates a
UserDefinedFunction class for usage in the API. |
public static final String SCALAR_EVAL
public static final String TABLE_EVAL
public static final String AGGREGATE_ACCUMULATE
public static final String AGGREGATE_RETRACT
public static final String AGGREGATE_MERGE
public static final String AGGREGATE_RESET
public static final String TABLE_AGGREGATE_ACCUMULATE
public static final String TABLE_AGGREGATE_RETRACT
public static final String TABLE_AGGREGATE_EMIT
public static final String TABLE_AGGREGATE_EMIT_RETRACT
public static final String ASYNC_TABLE_EVAL
public static <T,ACC> TypeInformation<T> getReturnTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction)
aggregateFunction
- The AggregateFunction for which the accumulator type is inferred.public static <T,ACC> TypeInformation<T> getReturnTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction, TypeInformation<T> scalaType)
aggregateFunction
- The AggregateFunction for which the accumulator type is inferred.scalaType
- The implicitly inferred type of the accumulator type.public static <T,ACC> TypeInformation<ACC> getAccumulatorTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction)
aggregateFunction
- The AggregateFunction for which the accumulator type is inferred.public static <T,ACC> TypeInformation<ACC> getAccumulatorTypeOfAggregateFunction(UserDefinedAggregateFunction<T,ACC> aggregateFunction, TypeInformation<ACC> scalaType)
aggregateFunction
- The AggregateFunction for which the accumulator type is inferred.scalaType
- The implicitly inferred type of the accumulator type.public static <T> TypeInformation<T> getReturnTypeOfTableFunction(TableFunction<T> tableFunction)
tableFunction
- The TableFunction for which the accumulator type is inferred.public static <T> TypeInformation<T> getReturnTypeOfTableFunction(TableFunction<T> tableFunction, TypeInformation<T> scalaType)
tableFunction
- The TableFunction for which the accumulator type is inferred.scalaType
- The implicitly inferred type of the accumulator type.public static UserDefinedFunction instantiateFunction(Class<? extends UserDefinedFunction> functionClass)
UserDefinedFunction
assuming a default constructor.public static void prepareInstance(ReadableConfig config, UserDefinedFunction function)
UserDefinedFunction
instance for usage in the API.public static void validateClass(Class<? extends UserDefinedFunction> functionClass)
UserDefinedFunction
class for usage in the API.
Note: This is an initial validation to indicate common errors early. The concrete
signature validation happens in the code generation when the actual DataType
s for
arguments and result are known.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.