flyrain commented on code in PR #4588:
URL: https://github.com/apache/iceberg/pull/4588#discussion_r905361152
##########
core/src/main/java/org/apache/iceberg/deletes/Deletes.java:
##########
@@ -75,8 +75,21 @@ public static <T> CloseableIterable<T>
markDeleted(CloseableIterable<T> rows, Pr
});
}
- public static <T> CloseableIterable<T> filterDeleted(CloseableIterable<T>
rows, Predicate<T> isDeleted) {
- return CloseableIterable.filter(rows, isDeleted.negate());
+ // This returns the remaining rows (the ones that are not deleted) while
counting the deleted ones
+ public static <T> CloseableIterable<T> filterDeleted(CloseableIterable<T>
rows, Predicate<T> isDeleted,
+ DeleteCounter counter) {
+ Filter<T> remainingRowsFilter = new Filter<T>() {
+ @Override
+ protected boolean shouldKeep(T item) {
+ boolean deleted = isDeleted.test(item);
+ if (deleted) {
+ counter.increment();
+ }
+ return !deleted;
Review Comment:
The same perf concern here.
--
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]