ArnavBalyan commented on code in PR #6178:
URL: https://github.com/apache/paimon/pull/6178#discussion_r2324655381


##########
paimon-common/src/main/java/org/apache/paimon/fileindex/rangebitmap/RangeBitmapFileIndex.java:
##########
@@ -157,10 +157,10 @@ public FileIndexResult visitGreaterOrEqual(FieldRef 
fieldRef, Object literal) {
         public FileIndexResult visitTopN(TopN topN, FileIndexResult result) {
             List<SortValue> orders = topN.orders();
 
-            // If multiple columns, use first column with allowDuplicates=true
-            boolean useFirstColumn = orders.size() > 1;
+            // If multiple columns, use first column with strict=false (allow 
duplicates)
+            boolean isMultiColumn = orders.size() > 1;
             SortValue sort = orders.get(0); // Always use first column
-            boolean allowDuplicates = useFirstColumn;
+            boolean strict = !isMultiColumn;

Review Comment:
   updated



##########
paimon-common/src/main/java/org/apache/paimon/fileindex/rangebitmap/BitSliceIndexBitmap.java:
##########
@@ -183,16 +178,16 @@ public RoaringBitmap32 topK(
                 e = RoaringBitmap32.andNot(e, getSlice(i));
             } else {
                 e = RoaringBitmap32.and(e, getSlice(i));
-                if (!allowDuplicates) {
+                if (strict) {
                     break;
                 }
-                // If allowDuplicates, continue to include all rows with the 
same value
+                // If not strict, continue to include all rows with the same 
value
             }
         }
 
-        // Return all results if allowDuplicates, otherwise limit to k
+        // Return all results if not strict, otherwise limit to k
         RoaringBitmap32 f = RoaringBitmap32.or(g, e);
-        if (!allowDuplicates) {
+        if (strict) {

Review Comment:
   updated



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