Class AppendOnlyFirstNFunction

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>
All Implemented Interfaces:
Serializable, org.apache.flink.api.common.functions.Function, org.apache.flink.api.common.functions.RichFunction

public class AppendOnlyFirstNFunction extends AbstractSyncStateTopNFunction
A variant of AppendOnlyTopNFunction to handle first-n case.

The input stream should only contain INSERT messages.

See Also:
  • Constructor Details

    • AppendOnlyFirstNFunction

      public AppendOnlyFirstNFunction(org.apache.flink.api.common.state.StateTtlConfig ttlConfig, InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType, GeneratedRecordComparator sortKeyGeneratedRecordComparator, RowDataKeySelector sortKeySelector, RankType rankType, RankRange rankRange, boolean generateUpdateBefore, boolean outputRankNumber)
  • 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 AbstractSyncStateTopNFunction
      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 context, 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