wypoon commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r889381963
##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -212,7 +244,7 @@ public PositionDeleteIndex deletedRowPositions() {
if (deleteRowPositions == null) {
List<CloseableIterable<Record>> deletes = Lists.transform(posDeletes,
this::openPosDeletes);
- deleteRowPositions = Deletes.toPositionIndex(filePath, deletes);
+ deleteRowPositions = Deletes.toPositionIndex(filePath, deletes, counter);
Review Comment:
Actually, this eventually calls
`Deletes.toPositionIndex(CloseableIterable<Long>, DeleteCounter)` where we do
```
PositionDeleteIndex positionDeleteIndex = new
BitmapPositionDeleteIndex();
deletes.forEach(positionDeleteIndex::delete);
counter.increment(((BitmapPositionDeleteIndex)
positionDeleteIndex).numberOfPositionsDeleted());
return positionDeleteIndex;
```
That method is called by other callers besides this. I think it is best to
do the `counter.increment(positionDeleteIndex.numberOfPositionsDeleted())`
right where `PositionDeleteIndex#delete` is called. I think the bookkeeping is
easier (to reason about) that way.
--
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]