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


##########
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:
   Maybe just use this method from `CloseableIterable` to traverse? it returns 
the same object after applying the `Consumer` function.
   
   ```
     static <I, O> CloseableIterable<O> transform(CloseableIterable<I> 
iterable, Function<I, O> transform) {
   ```



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