flyrain commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r905365603
##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -90,27 +103,45 @@ public static StructLikeSet
toEqualitySet(CloseableIterable<StructLike> eqDelete
}
public static <T extends StructLike> PositionDeleteIndex
toPositionIndex(CharSequence dataLocation,
-
List<CloseableIterable<T>> deleteFiles) {
+
List<CloseableIterable<T>> deleteFiles,
+
DeleteCounter counter) {
DataFileFilter<T> locationFilter = new DataFileFilter<>(dataLocation);
List<CloseableIterable<Long>> positions = Lists.transform(deleteFiles,
deletes ->
CloseableIterable.transform(locationFilter.filter(deletes), row ->
(Long) POSITION_ACCESSOR.get(row)));
- return toPositionIndex(CloseableIterable.concat(positions));
+ return toPositionIndex(CloseableIterable.concat(positions), counter);
}
- public static PositionDeleteIndex toPositionIndex(CloseableIterable<Long>
posDeletes) {
+ public static PositionDeleteIndex toPositionIndex(CloseableIterable<Long>
posDeletes, DeleteCounter counter) {
try (CloseableIterable<Long> deletes = posDeletes) {
- PositionDeleteIndex positionDeleteIndex = new
BitmapPositionDeleteIndex();
+ BitmapPositionDeleteIndex positionDeleteIndex = new
BitmapPositionDeleteIndex();
deletes.forEach(positionDeleteIndex::delete);
+ counter.increment(positionDeleteIndex.numberOfPositionsDeleted());
Review Comment:
This is not the right way. positionDeleteIndex has all pos deletes for the
data file, but not necessary all deletes are used in a read. We need to do the
same thing as batch eq delete(line 223 in DeleteFilter.java)
--
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]