rdblue commented on code in PR #5268:
URL: https://github.com/apache/iceberg/pull/5268#discussion_r929192438


##########
api/src/main/java/org/apache/iceberg/io/CloseableIterable.java:
##########
@@ -84,6 +113,20 @@ protected boolean shouldKeep(E item) {
     }, iterable);
   }
 
+  static <E> CloseableIterable<E> filter(MetricsContext.Counter<?> counter, 
CloseableIterable<E> iterable,
+      Predicate<E> pred) {

Review Comment:
   Should there be a version that increments a `skip` counter?
   
   I'd also prefer to add the counter support directly in `FilterIterator` 
rather than using a predicate. There is no guarantee that the predicate is 
called only once per value. Putting the increment logic inside 
`FilterIterator#advance` is better.



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