JeonDaehong commented on code in PR #18027:
URL: https://github.com/apache/iceberg/pull/18027#discussion_r4006296002


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnarBatchUtil.java:
##########
@@ -83,6 +91,27 @@ public static Pair<int[], Integer> buildRowIdMapping(
     return liveRowId == batchSize ? null : Pair.of(rowIdMapping, liveRowId);
   }
 
+  // builds the mapping from the deleted positions in the batch range, without 
probing per row
+  private static Pair<int[], Integer> buildRowIdMapping(
+      PositionDeleteIndex deletedPositions,
+      DeleteFilter<InternalRow> deletes,
+      long rowStartPosInBatch,
+      int batchSize) {
+    RowIdMappingBuilder builder = new RowIdMappingBuilder(rowStartPosInBatch, 
batchSize);

Review Comment:
   We tried to optimize performance by checking if the bitmap index is empty 
before processing each batch, but it actually made things 53% slower because 
isEmpty() was doing an expensive full traversal under the hood. We’ve reverted 
the change.There is a cheap $O(1)$ alternative (highLowContainer.size() == 0), 
but since it touches shared methods outside this specific path, we left it out 
of this PR. Let me know if you'd like to pursue that in a follow-up!



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to