public class CountAggFunction extends AggregateFunction<Long,CountAggFunction.CountAccumulator>
Modifier and Type | Class and Description |
---|---|
static class |
CountAggFunction.CountAccumulator
The initial accumulator for count aggregate function.
|
Constructor and Description |
---|
CountAggFunction() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(CountAggFunction.CountAccumulator acc) |
void |
accumulate(CountAggFunction.CountAccumulator acc,
Long value) |
CountAggFunction.CountAccumulator |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
Long |
getValue(CountAggFunction.CountAccumulator acc)
Called every time when an aggregation result should be materialized.
|
void |
merge(CountAggFunction.CountAccumulator acc,
Iterable<CountAggFunction.CountAccumulator> its) |
void |
retract(CountAggFunction.CountAccumulator acc) |
void |
retract(CountAggFunction.CountAccumulator acc,
Long value) |
getKind, getTypeInference
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRequirements, isDeterministic
public void accumulate(CountAggFunction.CountAccumulator acc, Long value)
public void accumulate(CountAggFunction.CountAccumulator acc)
public void retract(CountAggFunction.CountAccumulator acc, Long value)
public void retract(CountAggFunction.CountAccumulator acc)
public Long getValue(CountAggFunction.CountAccumulator acc)
AggregateFunction
getValue
in class AggregateFunction<Long,CountAggFunction.CountAccumulator>
acc
- the accumulator which contains the current intermediate resultspublic void merge(CountAggFunction.CountAccumulator acc, Iterable<CountAggFunction.CountAccumulator> its)
public CountAggFunction.CountAccumulator createAccumulator()
ImperativeAggregateFunction
ImperativeAggregateFunction
.
The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
createAccumulator
in class ImperativeAggregateFunction<Long,CountAggFunction.CountAccumulator>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.