Class RecordCounter
- java.lang.Object
-
- org.apache.flink.table.runtime.operators.aggregate.RecordCounter
-
- All Implemented Interfaces:
Serializable
public abstract class RecordCounter extends Object implements Serializable
TheRecordCounteris used to count the number of input records under the current key.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RecordCounter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static RecordCounterof(int indexOfCountStar)Creates aRecordCounterdepends on the index of count(*).abstract booleanrecordCountIsZero(org.apache.flink.table.data.RowData acc)We store the counter in the accumulator.
-
-
-
Method Detail
-
recordCountIsZero
public abstract boolean recordCountIsZero(org.apache.flink.table.data.RowData acc)
We store the counter in the accumulator. If the counter is not zero, which means we aggregated at least one record for current key.- Returns:
- true if input record count is zero, false if not.
-
of
public static RecordCounter of(int indexOfCountStar)
Creates aRecordCounterdepends on the index of count(*). If index is less than zero, returnsRecordCounter.AccumulationRecordCounter, otherwise,RecordCounter.RetractionRecordCounter.- Parameters:
indexOfCountStar- The index of COUNT(*) in the aggregates. -1 when the input doesn't contain COUNT(*), i.e. doesn't contain retraction messages. We make sure there is a COUNT(*) if input stream contains retraction.
-
-