rdblue commented on a change in pull request #2651:
URL: https://github.com/apache/iceberg/pull/2651#discussion_r651316782
##########
File path: core/src/main/java/org/apache/iceberg/deletes/Deletes.java
##########
@@ -246,4 +265,79 @@ protected boolean shouldKeep(T posDelete) {
return CHARSEQ_COMPARATOR.compare(dataLocation, (CharSequence)
FILENAME_ACCESSOR.get(posDelete)) == 0;
}
}
+
+ private static class PositionStreamDeleteChecker<T> extends CloseableGroup
implements CloseableIterable<Optional<T>> {
+ private final CloseableIterable<T> rows;
+ private final Function<T, Long> extractPos;
+ private final CloseableIterable<Long> deletePositions;
+
+ private PositionStreamDeleteChecker(CloseableIterable<T> rows, Function<T,
Long> extractPos,
+ CloseableIterable<Long>
deletePositions) {
+ this.rows = rows;
+ this.extractPos = extractPos;
+ this.deletePositions = deletePositions;
+ }
+
+ @Override
+ public CloseableIterator<Optional<T>> iterator() {
+ CloseableIterator<Long> deletePosIterator = deletePositions.iterator();
+
+ CloseableIterator<Optional<T>> iter;
+ if (deletePosIterator.hasNext()) {
Review comment:
+1 for checking whether we need to use the positions.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]