rdblue commented on a change in pull request #2320:
URL: https://github.com/apache/iceberg/pull/2320#discussion_r599992514
##########
File path: data/src/main/java/org/apache/iceberg/data/DeleteFilter.java
##########
@@ -137,11 +139,43 @@ protected long pos(T record) {
CloseableIterable.transform(CloseableIterable.concat(deleteRecords),
Record::copy),
deleteSchema.asStruct());
- filteredRecords = Deletes.filter(filteredRecords,
- record -> projectRow.wrap(asStructLike(record)), deleteSet);
+ Predicate<T> isInDeleteSet = record ->
deleteSet.contains(projectRow.wrap(asStructLike(record)));
+ isInDeleteSets.add(isInDeleteSet);
}
- return filteredRecords;
+ return isInDeleteSets;
+ }
+
+ public CloseableIterable<T> findEqualityDeleteRows(CloseableIterable<T>
records) {
+ // Predicate to test whether a row has been deleted by equality deletions.
+ Predicate<T> deletedRows = applyEqDeletes().stream()
+ .reduce(Predicate::or)
+ .orElse(t -> false);
+
+ Filter<T> deletedRowsFilter = new Filter<T>() {
+ @Override
+ protected boolean shouldKeep(T item) {
+ return deletedRows.test(item);
+ }
+ };
+ return deletedRowsFilter.filter(records);
Review comment:
If there are no delete predicates, this should return
`CloseableIterable.empty`.
--
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]