public class AggregateFunctionImpl extends Object implements AggregateFunction, ImplementableAggFunction
AggregateFunction via user-defined class.
The class should implement A init(), A add(A, V), and
R result(A) methods.
All the methods should be either static or instance.
Bonus point: when using non-static implementation, the aggregate object is
reused through the calculation, thus it can have aggregation-related state.| Modifier and Type | Field and Description |
|---|---|
Class<?> |
accumulatorType |
Method |
addMethod |
Class<?> |
declaringClass |
Method |
initMethod |
boolean |
isStatic |
Method |
mergeMethod |
Method |
resultMethod |
Class<?> |
resultType |
com.google.common.collect.ImmutableList<Class<?>> |
valueTypes |
| Modifier and Type | Method and Description |
|---|---|
static AggregateFunctionImpl |
create(Class<?> clazz)
Creates an aggregate function, or returns null.
|
AggImplementor |
getImplementor(boolean windowContext)
Returns implementor that translates the function to linq4j expression.
|
List<FunctionParameter> |
getParameters()
Returns the parameters of this function.
|
RelDataType |
getReturnType(RelDataTypeFactory typeFactory)
Returns the return type of this function, constructed using the given
type factory.
|
public final boolean isStatic
public final Method initMethod
public final Method addMethod
public final Method mergeMethod
public final Method resultMethod
public final com.google.common.collect.ImmutableList<Class<?>> valueTypes
public final Class<?> accumulatorType
public final Class<?> resultType
public final Class<?> declaringClass
public static AggregateFunctionImpl create(Class<?> clazz)
public List<FunctionParameter> getParameters()
FunctiongetParameters in interface Functionpublic RelDataType getReturnType(RelDataTypeFactory typeFactory)
AggregateFunctiongetReturnType in interface AggregateFunctiontypeFactory - Type factorypublic AggImplementor getImplementor(boolean windowContext)
ImplementableAggFunctiongetImplementor in interface ImplementableAggFunctionwindowContext - true when aggregate is used in window contextCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.