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


##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -63,14 +65,14 @@ 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;
-    }
-
-    PositionSetDeleteFilter<T> filter = new 
PositionSetDeleteFilter<>(rowToPosition, deleteSet);
-    return filter.filter(rows);
+  public static <T> CloseableIterable<T> markDeleted(CloseableIterable<T> 
rows, Predicate<T> isDeleted,
+                                                     Consumer<T> deleteMarker) 
{
+    return CloseableIterable.transform(rows, row -> {
+      if (isDeleted.test(row)) {

Review Comment:
   There is a technique for avoiding costly control hazards caused by if 
statements called predication, where you pass the result value (true/false) 
instead of having an if block. That being said, I am not sure it makes sense to 
overcomplicate things here. Let's keep it as is for now.



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