Tan-JiaLiang commented on code in PR #6028:
URL: https://github.com/apache/paimon/pull/6028#discussion_r2269126518


##########
paimon-common/src/main/java/org/apache/paimon/fileindex/FileIndexPredicate.java:
##########
@@ -168,4 +189,39 @@ public FileIndexResult visit(CompoundPredicate predicate) {
             }
         }
     }
+
+    /** TopN test worker. */
+    private static class FileIndexTopNTest implements 
TopNVisitor<FileIndexResult> {
+
+        private final Set<FileIndexReader> readers;
+        private final FileIndexResult result;
+
+        public FileIndexTopNTest(Set<FileIndexReader> readers, FileIndexResult 
result) {
+            this.readers = readers;
+            this.result = result;
+        }
+
+        @Override
+        public FileIndexResult visit(TopN topN) {
+            for (FileIndexReader reader : readers) {
+                FileIndexResult ret = reader.visitTopN(topN, result);
+                if (!REMAIN.equals(ret)) {
+                    ret.remain();

Review Comment:
   We need to trigger the calculation immediately. Because the 
FileIndexEvaluator#evaluate will close the FileIndexPredicate.



-- 
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: issues-unsubscr...@paimon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to