luoyuxia commented on code in PR #19727:
URL: https://github.com/apache/flink/pull/19727#discussion_r927605133
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/generated/AggsHandleFunction.java:
##########
@@ -36,4 +36,10 @@ public interface AggsHandleFunction extends
AggsHandleFunctionBase {
* @return the final result (saved in a row) of the current accumulators.
*/
RowData getValue() throws Exception;
+
+ /**
+ * Set window size for the aggregate function. Some aggregate functions
may requires the size of
+ * current window to do calculation.
+ */
Review Comment:
done.
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/agg/AggsHandlerCodeGenerator.scala:
##########
@@ -320,6 +326,7 @@ class AggsHandlerCodeGenerator(
initialAggregateInformation(aggInfoList)
// generates all methods body first to add necessary reuse code to context
+ val setWindowSizeCode = if (isWindowSizeNeeded) genSetWindowSize() else ""
Review Comment:
Based on the current implementation, we will always call method
`setWindowSize`, so we can't generate the code to throw exception . But I add
some comments for this method `genSetWindowSize`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]