Class RecordCounter
java.lang.Object
org.apache.flink.table.runtime.operators.aggregate.RecordCounter
- All Implemented Interfaces:
Serializable
The
RecordCounter is used to count the number of input records under the current key.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
RecordCounter
public RecordCounter()
-
-
Method Details
-
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
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.
-