wuchong commented on a change in pull request #14173:
URL: https://github.com/apache/flink/pull/14173#discussion_r529152526



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/rank/RetractableTopNFunction.java
##########
@@ -190,6 +191,19 @@ public void processElement(RowData input, Context ctx, 
Collector<RowData> out) t
                                }
                        }
 
+                       if (!stateRemoved) {
+                               // the input record has not been removed from 
state
+                               // should update the data state
+                               List<RowData> inputs = dataState.get(sortKey);
+                               if (inputs != null) {
+                                       inputs.remove(input);

Review comment:
       Good point.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to