wuchong commented on a change in pull request #10823: 
[FLINK-15497][table-planner-blink] Reduce outputs when rank number is not 
required in Retractable topN
URL: https://github.com/apache/flink/pull/10823#discussion_r368262485
 
 

 ##########
 File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/runtime/operators/rank/RetractableTopNFunction.java
 ##########
 @@ -374,10 +381,10 @@ private void retractRecordWithoutRowNumber(
                        } else if (findsSortKey) {
                                long count = entry.getValue();
                                long tmpRank = curRank + count;
-                               if (isInRankEnd(tmpRank)) {
+                               if (tmpRank < rankEnd) {
 
 Review comment:
   Could you add some comments on this? IIUC, this is for padding the last 
entry because we retract a entry from the top-n. 
   Besides, could you improve the local field name of `tmpRank`? It's not easy 
to understand what the rank it is.

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


With regards,
Apache Git Services

Reply via email to