Package org.apache.calcite.schema.impl
Class AggregateFunctionImpl
java.lang.Object
org.apache.calcite.schema.impl.AggregateFunctionImpl
- All Implemented Interfaces:
AggregateFunction,Function,ImplementableAggFunction
public class AggregateFunctionImpl
extends Object
implements AggregateFunction, ImplementableAggFunction
Implementation of
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.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable AggregateFunctionImplCreates an aggregate function, or returns null.getImplementor(boolean windowContext) Returns implementor that translates the function to linq4j expression.Returns the parameters of this function.getReturnType(RelDataTypeFactory typeFactory) Returns the return type of this function, constructed using the given type factory.
-
Field Details
-
isStatic
public final boolean isStatic -
initMethod
-
addMethod
-
mergeMethod
-
resultMethod
-
valueTypes
-
accumulatorType
-
resultType
-
declaringClass
-
-
Method Details
-
create
Creates an aggregate function, or returns null. -
getParameters
Description copied from interface:FunctionReturns the parameters of this function.- Specified by:
getParametersin interfaceFunction- Returns:
- Parameters; never null
-
getReturnType
Description copied from interface:AggregateFunctionReturns the return type of this function, constructed using the given type factory.- Specified by:
getReturnTypein interfaceAggregateFunction- Parameters:
typeFactory- Type factory
-
getImplementor
Description copied from interface:ImplementableAggFunctionReturns implementor that translates the function to linq4j expression.- Specified by:
getImplementorin interfaceImplementableAggFunction- Parameters:
windowContext- true when aggregate is used in window context- Returns:
- implementor that translates the function to linq4j expression.
-