stevenzwu commented on code in PR #4539:
URL: https://github.com/apache/iceberg/pull/4539#discussion_r854716842


##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -73,6 +74,16 @@ public static <T> CloseableIterable<T> 
filter(CloseableIterable<T> rows, Functio
     return filter.filter(rows);
   }
 
+  public static <T> CloseableIterable<T> marker(CloseableIterable<T> rows, 
Function<T, Long> rowToPosition,
+                                                PositionDeleteIndex deleteSet, 
Consumer<T> markDeleted) {
+    if (deleteSet.isEmpty()) {
+      return rows;
+    }
+
+    PositionSetDeleteMarker<T> deleteMarker = new 
PositionSetDeleteMarker<>(rowToPosition, deleteSet, markDeleted);
+    return deleteMarker.filter(rows);

Review Comment:
   since `PositionSetDeleteMarker` always return true, we are not actually 
doing filter. it seems that we are mainly leverage the filter to traverse the 
iterable and get the side effect of calling `markDeleted` with matched rows. 
The semantics is a little odd to me. Maybe we don't need to introduce 
`PositionSetDeleteMarker` filter?



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