jeyhunkarimov commented on code in PR #24290:
URL: https://github.com/apache/flink/pull/24290#discussion_r1485282227


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/aggregate/MiniBatchGlobalGroupAggFunction.java:
##########
@@ -193,7 +193,7 @@ public void finishBundle(Map<RowData, RowData> buffer, 
Collector<RowData> out)
 
                 // if this was not the first row and we have to emit 
retractions
                 if (!firstRow) {
-                    if (!equaliser.equals(prevAggValue, newAggValue)) {
+                    if (stateRetentionTime > 0 || 
!equaliser.equals(prevAggValue, newAggValue)) {

Review Comment:
   IMO, this logic should be ideally embedded in `globalAgg`. Since both 
`prevAggValue ` and `newAggValue ` are derived from `globalAgg` and since 
`globalAgg` has knowledge about ttl (`globalAgg.open(new 
PerKeyStateDataViewStore(ctx.getRuntimeContext(), ttlConfig))`) it should be 
better to have all the necessary logic in one place. WDYT?
   



-- 
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]

Reply via email to