Class MiniBatchGlobalGroupAggFunction
java.lang.Object
org.apache.flink.table.runtime.operators.bundle.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>
org.apache.flink.table.runtime.operators.aggregate.MiniBatchGlobalGroupAggFunction
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function
public class MiniBatchGlobalGroupAggFunction
extends 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>
Aggregate Function used for the global groupby (without window) aggregate in miniBatch mode.
- See Also:
-
Field Summary
Fields inherited from class org.apache.flink.table.runtime.operators.bundle.MapBundleFunction
ctx -
Constructor Summary
ConstructorsConstructorDescriptionMiniBatchGlobalGroupAggFunction(GeneratedAggsHandleFunction genLocalAggsHandler, GeneratedAggsHandleFunction genGlobalAggsHandler, GeneratedRecordEqualiser genRecordEqualiser, org.apache.flink.table.types.logical.LogicalType[] accTypes, int indexOfCountStar, boolean generateUpdateBefore, long stateRetentionTime) Creates aMiniBatchGlobalGroupAggFunction. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.table.data.RowDataaddInput(org.apache.flink.table.data.RowData previousAcc, org.apache.flink.table.data.RowData input) ThepreviousAccis accumulator, but input is a row in <key, accumulator> schema, the specific generatedlocalAggwill project theinputto accumulator in merge method.voidclose()voidfinishBundle(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) Called when a bundle is finished.voidopen(ExecutionContext ctx)
-
Constructor Details
-
MiniBatchGlobalGroupAggFunction
public MiniBatchGlobalGroupAggFunction(GeneratedAggsHandleFunction genLocalAggsHandler, GeneratedAggsHandleFunction genGlobalAggsHandler, GeneratedRecordEqualiser genRecordEqualiser, org.apache.flink.table.types.logical.LogicalType[] accTypes, int indexOfCountStar, boolean generateUpdateBefore, long stateRetentionTime) Creates aMiniBatchGlobalGroupAggFunction.- Parameters:
genLocalAggsHandler- The generated local aggregate handlergenGlobalAggsHandler- The generated global aggregate handlergenRecordEqualiser- The code generated equaliser used to equal RowData.accTypes- The accumulator types.indexOfCountStar- The index of COUNT(*) in the aggregates. -1 when the input doesn't contain COUNT(*), i.e. doesn't contain UPDATE_BEFORE or DELETE messages. We make sure there is a COUNT(*) if input stream contains UPDATE_BEFORE or DELETE messages.generateUpdateBefore- Whether this operator will generate UPDATE_BEFORE messages.stateRetentionTime- state idle retention time which unit is MILLISECONDS.
-
-
Method Details
-
open
- Overrides:
openin classMapBundleFunction<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
-
addInput
public org.apache.flink.table.data.RowData addInput(@Nullable org.apache.flink.table.data.RowData previousAcc, org.apache.flink.table.data.RowData input) throws Exception ThepreviousAccis accumulator, but input is a row in <key, accumulator> schema, the specific generatedlocalAggwill project theinputto accumulator in merge method.- Specified by:
addInputin classMapBundleFunction<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:
previousAcc- the existing bundle value, maybe nullinput- the given input, not null- Throws:
Exception
-
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 ExceptionDescription copied from class:MapBundleFunctionCalled when a bundle is finished. Transform a bundle to zero, one, or more output elements.- Specified by:
finishBundlein classMapBundleFunction<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
-
close
- Overrides:
closein classMapBundleFunction<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
-