public class MiniBatchGroupAggFunction extends MapBundleFunction<BaseRow,List<BaseRow>,BaseRow,BaseRow>
This function buffers input row in heap HashMap, and aggregates them when minibatch invoked.
ctx| 构造器和说明 |
|---|
MiniBatchGroupAggFunction(GeneratedAggsHandleFunction genAggsHandler,
GeneratedRecordEqualiser genRecordEqualiser,
org.apache.flink.table.types.logical.LogicalType[] accTypes,
org.apache.flink.table.types.logical.RowType inputType,
int indexOfCountStar,
boolean generateRetraction)
Creates a
MiniBatchGroupAggFunction. |
| 限定符和类型 | 方法和说明 |
|---|---|
List<BaseRow> |
addInput(List<BaseRow> value,
BaseRow input)
Adds the given input to the given value, returning the new bundle value.
|
void |
close() |
void |
finishBundle(Map<BaseRow,List<BaseRow>> buffer,
org.apache.flink.util.Collector<BaseRow> out)
Called when a bundle is finished.
|
void |
open(ExecutionContext ctx) |
public MiniBatchGroupAggFunction(GeneratedAggsHandleFunction genAggsHandler, GeneratedRecordEqualiser genRecordEqualiser, org.apache.flink.table.types.logical.LogicalType[] accTypes, org.apache.flink.table.types.logical.RowType inputType, int indexOfCountStar, boolean generateRetraction)
MiniBatchGroupAggFunction.genAggsHandler - The code generated function used to handle aggregates.genRecordEqualiser - The code generated equaliser used to equal BaseRow.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.generateRetraction - Whether this operator will generate retraction.public void open(ExecutionContext ctx) throws Exception
public List<BaseRow> addInput(@Nullable List<BaseRow> value, BaseRow input) throws Exception
MapBundleFunctionpublic void finishBundle(Map<BaseRow,List<BaseRow>> buffer, org.apache.flink.util.Collector<BaseRow> out) throws Exception
MapBundleFunctionfinishBundle 在类中 MapBundleFunction<BaseRow,List<BaseRow>,BaseRow,BaseRow>ExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.