dianfu commented on a change in pull request #7201: [FLINK-7208] [table]
Optimize Min/MaxWithRetractAggFunction with DataView
URL: https://github.com/apache/flink/pull/7201#discussion_r238940699
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
##########
@@ -1437,36 +1437,30 @@ object AggregateUtil {
case collect: SqlAggFunction if collect.getKind == SqlKind.COLLECT =>
aggregates(index) = new
CollectAggFunction(FlinkTypeFactory.toTypeInfo(relDataType))
- accTypes(index) = aggregates(index).getAccumulatorType
case udagg: AggSqlFunction =>
aggregates(index) = udagg.getFunction
- accTypes(index) = udagg.accType
case unSupported: SqlAggFunction =>
throw new TableException(s"Unsupported Function:
'${unSupported.getName}'")
}
}
+ accTypes(index) =
getAccumulatorTypeOfAggregateFunction(aggregates(index))
}
val accSpecs = new Array[Seq[DataViewSpec[_]]](aggregateCalls.size)
// create accumulator type information for every aggregate function
aggregates.zipWithIndex.foreach { case (agg, index) =>
Review comment:
Without this change, we need to add `accTypes(index) =
aggregates(index).getAccumulatorType` for every built-in agg which uses
`DataView` in the future. I think this change makes the logical more simple and
clear.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services