T
- type of collect element.public class CollectAggFunction<T> extends AggregateFunction<Map<T,Integer>,CollectAggFunction.CollectAccumulator<T>>
Modifier and Type | Class and Description |
---|---|
static class |
CollectAggFunction.CollectAccumulator<T>
The initial accumulator for Collect aggregate function.
|
Constructor and Description |
---|
CollectAggFunction(TypeInformation<T> elementType) |
getKind, getRequirements, requiresOver
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isDeterministic
public CollectAggFunction(TypeInformation<T> elementType)
public CollectAggFunction.CollectAccumulator<T> createAccumulator()
UserDefinedAggregateFunction
UserDefinedAggregateFunction
. The
accumulator is used to keep the aggregated values which are needed to compute an aggregation
result.createAccumulator
in class UserDefinedAggregateFunction<Map<T,Integer>,CollectAggFunction.CollectAccumulator<T>>
public void resetAccumulator(CollectAggFunction.CollectAccumulator<T> accumulator)
public void accumulate(CollectAggFunction.CollectAccumulator<T> accumulator, T value) throws Exception
Exception
public void retract(CollectAggFunction.CollectAccumulator<T> accumulator, T value) throws Exception
Exception
public void merge(CollectAggFunction.CollectAccumulator<T> accumulator, Iterable<CollectAggFunction.CollectAccumulator<T>> others) throws Exception
Exception
public Map<T,Integer> getValue(CollectAggFunction.CollectAccumulator<T> accumulator)
AggregateFunction
getValue
in class AggregateFunction<Map<T,Integer>,CollectAggFunction.CollectAccumulator<T>>
accumulator
- the accumulator which contains the current
aggregated resultspublic TypeInformation<Map<T,Integer>> getResultType()
UserDefinedAggregateFunction
TypeInformation
of the UserDefinedAggregateFunction
's result.getResultType
in class UserDefinedAggregateFunction<Map<T,Integer>,CollectAggFunction.CollectAccumulator<T>>
TypeInformation
of the UserDefinedAggregateFunction
's result or
null
if the result type should be automatically inferred.public TypeInformation<CollectAggFunction.CollectAccumulator<T>> getAccumulatorType()
UserDefinedAggregateFunction
TypeInformation
of the UserDefinedAggregateFunction
's accumulator.getAccumulatorType
in class UserDefinedAggregateFunction<Map<T,Integer>,CollectAggFunction.CollectAccumulator<T>>
TypeInformation
of the UserDefinedAggregateFunction
's accumulator
or null
if the accumulator type should be automatically inferred.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.