Github user sunjincheng121 commented on a diff in the pull request: https://github.com/apache/flink/pull/3574#discussion_r108596940 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala --- @@ -729,6 +747,39 @@ object AggregateUtil { (aggFunction, accumulatorRowType, aggResultRowType) } + + + /* + * Function for building the processing logic for aggregating data in row bounded windows + * @param namedAggregates List of calls to aggregate functions and their output field names + * @param inputType Input row type + * @param rowType Type info of row + * @param lowerBound the window boundary + * @return [[org.apache.flink.streaming.api.functions.ProcessFunction]] + */ + private[flink] def createBoundedProcessingOverProcessFunction( + namedAggregates: Seq[CalcitePair[AggregateCall, String]], + inputType: RelDataType, + rowType: RowTypeInfo, + lowerBound: Int): ProcessFunction[Row, Row] = { + + val (aggFields, aggregates) = + transformToAggregateFunctions( + namedAggregates.map(_.getKey), + inputType, + needRetraction = true) + + val aggregationStateType: RowTypeInfo = + createDataSetAggregateBufferDataType(Array(), aggregates, inputType) + + new BoundedProcessingOverRowProcessFunction( + aggregates, + aggFields, lowerBound, + inputType.getFieldCount, + aggregationStateType, FlinkTypeFactory.toInternalRowTypeInfo(inputType)) --- End diff -- Use the new line. `aggregationStateType, FlinkTypeFactory.toInternalRowTypeInfo(inputType) `-> ``` aggregationStateType, FlinkTypeFactory.toInternalRowTypeInfo(inputType) ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---