Package org.apache.flink.table.functions
Class ImperativeAggregateFunction<T,ACC>
- java.lang.Object
-
- org.apache.flink.table.functions.UserDefinedFunction
-
- org.apache.flink.table.functions.ImperativeAggregateFunction<T,ACC>
-
- Type Parameters:
T- final result type of the aggregationACC- intermediate result type during the aggregation
- All Implemented Interfaces:
Serializable,FunctionDefinition
- Direct Known Subclasses:
AggregateFunction,TableAggregateFunction
@PublicEvolving public abstract class ImperativeAggregateFunction<T,ACC> extends UserDefinedFunction
Base class for user-definedAggregateFunctionandTableAggregateFunction.This class is used for unified handling of imperative aggregating functions. Concrete implementations should extend from
AggregateFunctionorTableAggregateFunction.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ImperativeAggregateFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract ACCcreateAccumulator()Creates and initializes the accumulator for thisImperativeAggregateFunction.org.apache.flink.api.common.typeinfo.TypeInformation<ACC>getAccumulatorType()Deprecated.This method uses the old type system and is based on the old reflective extraction logic.org.apache.flink.api.common.typeinfo.TypeInformation<T>getResultType()Deprecated.This method uses the old type system and is based on the old reflective extraction logic.-
Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction
close, functionIdentifier, getTypeInference, open, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.functions.FunctionDefinition
getKind, getRequirements, isDeterministic, supportsConstantFolding
-
-
-
-
Method Detail
-
createAccumulator
public abstract ACC createAccumulator()
Creates and initializes the accumulator for thisImperativeAggregateFunction.The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
- Returns:
- the accumulator with the initial value
-
getResultType
@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<T> getResultType()
Deprecated.This method uses the old type system and is based on the old reflective extraction logic. The method will be removed in future versions and is only called when using the deprecatedTableEnvironment.registerFunction(...)method. The new reflective extraction logic (possibly enriched withDataTypeHintandFunctionHint) should be powerful enough to cover most use cases. For advanced users, it is possible to overrideUserDefinedFunction.getTypeInference(DataTypeFactory).Returns theTypeInformationof theImperativeAggregateFunction's result.- Returns:
- The
TypeInformationof theImperativeAggregateFunction's result ornullif the result type should be automatically inferred.
-
getAccumulatorType
@Deprecated public org.apache.flink.api.common.typeinfo.TypeInformation<ACC> getAccumulatorType()
Deprecated.This method uses the old type system and is based on the old reflective extraction logic. The method will be removed in future versions and is only called when using the deprecatedTableEnvironment.registerFunction(...)method. The new reflective extraction logic (possibly enriched withDataTypeHintandFunctionHint) should be powerful enough to cover most use cases. For advanced users, it is possible to overrideUserDefinedFunction.getTypeInference(DataTypeFactory).Returns theTypeInformationof theImperativeAggregateFunction's accumulator.- Returns:
- The
TypeInformationof theImperativeAggregateFunction's accumulator ornullif the accumulator type should be automatically inferred.
-
-