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
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable AggregateFunctionImpl
Creates 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:Function
Returns the parameters of this function.- Specified by:
getParameters
in interfaceFunction
- Returns:
- Parameters; never null
-
getReturnType
Description copied from interface:AggregateFunction
Returns the return type of this function, constructed using the given type factory.- Specified by:
getReturnType
in interfaceAggregateFunction
- Parameters:
typeFactory
- Type factory
-
getImplementor
Description copied from interface:ImplementableAggFunction
Returns implementor that translates the function to linq4j expression.- Specified by:
getImplementor
in interfaceImplementableAggFunction
- Parameters:
windowContext
- true when aggregate is used in window context- Returns:
- implementor that translates the function to linq4j expression.
-