public class MiniBatchGroupAggFunction extends MapBundleFunction<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>
This function buffers input row in heap HashMap, and aggregates them when minibatch invoked.
ctx| Constructor and Description |
|---|
MiniBatchGroupAggFunction(GeneratedAggsHandleFunction genAggsHandler,
GeneratedRecordEqualiser genRecordEqualiser,
org.apache.flink.table.types.logical.LogicalType[] accTypes,
org.apache.flink.table.types.logical.RowType inputType,
int indexOfCountStar,
boolean generateUpdateBefore,
long stateRetentionTime)
Creates a
MiniBatchGroupAggFunction. |
| Modifier and Type | Method and Description |
|---|---|
List<org.apache.flink.table.data.RowData> |
addInput(List<org.apache.flink.table.data.RowData> value,
org.apache.flink.table.data.RowData input)
Adds the given input to the given value, returning the new bundle value.
|
void |
close() |
void |
finishBundle(Map<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>> buffer,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> 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 generateUpdateBefore, long stateRetentionTime)
MiniBatchGroupAggFunction.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.public void open(ExecutionContext ctx) throws Exception
open in class MapBundleFunction<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>Exceptionpublic List<org.apache.flink.table.data.RowData> addInput(@Nullable List<org.apache.flink.table.data.RowData> value, org.apache.flink.table.data.RowData input) throws Exception
MapBundleFunctionaddInput in class MapBundleFunction<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>value - the existing bundle value, maybe nullinput - the given input, not nullExceptionpublic void finishBundle(Map<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>> buffer, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) throws Exception
MapBundleFunctionfinishBundle in class MapBundleFunction<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>Exceptionpublic void close()
throws Exception
close in class MapBundleFunction<org.apache.flink.table.data.RowData,List<org.apache.flink.table.data.RowData>,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>ExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.