flyrain commented on code in PR #4683:
URL: https://github.com/apache/iceberg/pull/4683#discussion_r868223409


##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -63,13 +65,23 @@ public static <T> CloseableIterable<T> 
filter(CloseableIterable<T> rows, Functio
     return equalityFilter.filter(rows);
   }
 
-  public static <T> CloseableIterable<T> filter(CloseableIterable<T> rows, 
Function<T, Long> rowToPosition,
-                                                PositionDeleteIndex deleteSet) 
{
-    if (deleteSet.isEmpty()) {
-      return rows;
-    }
+  public static <T> CloseableIterable<T> markDeleted(CloseableIterable<T> 
rows, Predicate<T> isDeleted,
+                                                     Consumer<T> markDeleted) {
+    return CloseableIterable.transform(rows, row -> {
+      if (isDeleted.test(row)) {
+        markDeleted.accept(row);
+      }
+      return row;
+    });
+  }
 
-    PositionSetDeleteFilter<T> filter = new 
PositionSetDeleteFilter<>(rowToPosition, deleteSet);
+  public static <T> CloseableIterable<T> filter(CloseableIterable<T> rows, 
Predicate<T> shouldKeep) {

Review Comment:
   That's a good point. I had the same concern. However, we've discussed what 
should be considered as APIs in one of the community sync. we agreed that only 
consider the public things in the API module as APIs. cc @rdblue. With that, it 
should be OK to change this public method?



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