java.lang.Object
org.apache.flink.table.runtime.operators.aggregate.RecordCounter
All Implemented Interfaces:
Serializable

public abstract class RecordCounter extends Object implements Serializable
The RecordCounter is used to count the number of input records under the current key.
See Also:
  • 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

      public static RecordCounter of(int indexOfCountStar)
      Creates a RecordCounter depends on the index of count(*). If index is less than zero, returns RecordCounter.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.