wypoon commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r956525437


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ColumnarBatchReader.java:
##########
@@ -181,8 +181,11 @@ Pair<int[], Integer> 
buildPosDelRowIdMapping(PositionDeleteIndex deletedRowPosit
         if (!deletedRowPositions.isDeleted(originalRowId + 
rowStartPosInBatch)) {
           posDelRowIdMapping[currentRowId] = originalRowId;
           currentRowId++;
-        } else if (hasIsDeletedColumn) {
-          isDeleted[originalRowId] = true;
+        } else {
+          if (hasIsDeletedColumn) {
+            isDeleted[originalRowId] = true;
+          }
+          deletes.incrementDeleteCount();

Review Comment:
   Yes, this is correct.
   The structure of the logic is
   ```
           if (...) {
             // row is not deleted
           } else {
             // row is deleted
             if (hasIsDeletedColumn) { ... }
             deletes.incrementDeleteCount();
           }
   ```
   In the else clause, we increment the counter regardless of 
`hasIsDeletedColumn` because this is the case where the row is deleted.



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