Class GroupTableAggFunction

java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>
org.apache.flink.table.runtime.operators.aggregate.GroupTableAggFunction
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

public class GroupTableAggFunction extends org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>
Aggregate Function used for the groupby (without window) table aggregate.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.flink.streaming.api.functions.KeyedProcessFunction

    org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context, org.apache.flink.streaming.api.functions.KeyedProcessFunction.OnTimerContext
  • Constructor Summary

    Constructors
    Constructor
    Description
    GroupTableAggFunction(GeneratedTableAggsHandleFunction genAggsHandler, org.apache.flink.table.types.logical.LogicalType[] accTypes, int indexOfCountStar, boolean generateUpdateBefore, boolean incrementalUpdate, long stateRetentionTime)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    open(org.apache.flink.api.common.functions.OpenContext openContext)
     
    void
    processElement(org.apache.flink.table.data.RowData input, org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>.org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
     

    Methods inherited from class org.apache.flink.streaming.api.functions.KeyedProcessFunction

    onTimer

    Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction

    getIterationRuntimeContext, getRuntimeContext, setRuntimeContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GroupTableAggFunction

      public GroupTableAggFunction(GeneratedTableAggsHandleFunction genAggsHandler, org.apache.flink.table.types.logical.LogicalType[] accTypes, int indexOfCountStar, boolean generateUpdateBefore, boolean incrementalUpdate, long stateRetentionTime)
      Parameters:
      genAggsHandler - The code generated function used to handle table aggregates.
      accTypes - The accumulator types.
      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.
      generateUpdateBefore - Whether this operator will generate UPDATE_BEFORE messages.
      incrementalUpdate - Whether to update acc result incrementally.
      stateRetentionTime - state idle retention time which unit is MILLISECONDS.
  • Method Details

    • open

      public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws Exception
      Specified by:
      open in interface org.apache.flink.api.common.functions.RichFunction
      Overrides:
      open in class org.apache.flink.api.common.functions.AbstractRichFunction
      Throws:
      Exception
    • processElement

      public void processElement(org.apache.flink.table.data.RowData input, org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>.org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) throws Exception
      Specified by:
      processElement in class org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>
      Throws:
      Exception
    • close

      public void close() throws Exception
      Specified by:
      close in interface org.apache.flink.api.common.functions.RichFunction
      Overrides:
      close in class org.apache.flink.api.common.functions.AbstractRichFunction
      Throws:
      Exception