Class ProcTimeMiniBatchDeduplicateKeepFirstRowFunction

  • All Implemented Interfaces:
    Serializable, org.apache.flink.api.common.functions.Function

    public class ProcTimeMiniBatchDeduplicateKeepFirstRowFunction
    extends MapBundleFunction<K,​V,​IN,​OUT>
    This function is used to get the first row for every key partition in miniBatch mode.

    The state stores a boolean flag to indicate whether key appears before as an optimization.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long minRetentionTime  
      protected org.apache.flink.api.common.state.ValueState<T> state  
      protected org.apache.flink.api.common.typeinfo.TypeInformation<T> stateType  
    • Field Detail

      • stateType

        protected final org.apache.flink.api.common.typeinfo.TypeInformation<T> stateType
      • minRetentionTime

        protected final long minRetentionTime
      • state

        protected org.apache.flink.api.common.state.ValueState<T> state
    • Constructor Detail

      • ProcTimeMiniBatchDeduplicateKeepFirstRowFunction

        public ProcTimeMiniBatchDeduplicateKeepFirstRowFunction​(org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> serializer,
                                                                long stateRetentionTime)
    • Method Detail

      • addInput

        public org.apache.flink.table.data.RowData addInput​(@Nullable
                                                            org.apache.flink.table.data.RowData value,
                                                            org.apache.flink.table.data.RowData input)
        Description copied from class: MapBundleFunction
        Adds the given input to the given value, returning the new bundle value.
        Specified by:
        addInput in class MapBundleFunction<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData>
        Parameters:
        value - the existing bundle value, maybe null
        input - the given input, not null
      • finishBundle

        public void finishBundle​(Map<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData> buffer,
                                 org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
                          throws Exception
        Description copied from class: MapBundleFunction
        Called when a bundle is finished. Transform a bundle to zero, one, or more output elements.
        Specified by:
        finishBundle in class MapBundleFunction<org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData,​org.apache.flink.table.data.RowData>
        Throws:
        Exception