Class MiniBatchGroupAggFunction
-
- All Implemented Interfaces:
Serializable
,Function
public class MiniBatchGroupAggFunction extends MapBundleFunction<RowData,List<RowData>,RowData,RowData>
Aggregate Function used for the groupby (without window) aggregate in miniBatch mode.This function buffers input row in heap HashMap, and aggregates them when minibatch invoked.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.flink.table.runtime.operators.bundle.MapBundleFunction
ctx
-
-
Constructor Summary
Constructors Constructor Description MiniBatchGroupAggFunction(GeneratedAggsHandleFunction genAggsHandler, GeneratedRecordEqualiser genRecordEqualiser, LogicalType[] accTypes, RowType inputType, int indexOfCountStar, boolean generateUpdateBefore, long stateRetentionTime)
Creates aMiniBatchGroupAggFunction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<RowData>
addInput(List<RowData> value, RowData input)
Adds the given input to the given value, returning the new bundle value.void
close()
void
finishBundle(Map<RowData,List<RowData>> buffer, Collector<RowData> out)
Called when a bundle is finished.void
open(ExecutionContext ctx)
-
-
-
Constructor Detail
-
MiniBatchGroupAggFunction
public MiniBatchGroupAggFunction(GeneratedAggsHandleFunction genAggsHandler, GeneratedRecordEqualiser genRecordEqualiser, LogicalType[] accTypes, RowType inputType, int indexOfCountStar, boolean generateUpdateBefore, long stateRetentionTime)
Creates aMiniBatchGroupAggFunction
.- Parameters:
genAggsHandler
- The code generated function used to handle aggregates.genRecordEqualiser
- The code generated equaliser used to equal RowData.accTypes
- The accumulator types.inputType
- The input row type.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.stateRetentionTime
- state idle retention time which unit is MILLISECONDS.
-
-
Method Detail
-
open
public void open(ExecutionContext ctx) throws Exception
-
addInput
public List<RowData> addInput(@Nullable List<RowData> value, RowData input) throws Exception
Description copied from class:MapBundleFunction
Adds the given input to the given value, returning the new bundle value.
-
finishBundle
public void finishBundle(Map<RowData,List<RowData>> buffer, Collector<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 classMapBundleFunction<RowData,List<RowData>,RowData,RowData>
- Throws:
Exception
-
-