szehon-ho commented on code in PR #4683:
URL: https://github.com/apache/iceberg/pull/4683#discussion_r882052244
##########
data/src/main/java/org/apache/iceberg/data/DeleteFilter.java:
##########
@@ -226,10 +226,16 @@ private CloseableIterable<T>
applyPosDeletes(CloseableIterable<T> records) {
// if there are fewer deletes than a reasonable number to keep in memory,
use a set
if (posDeletes.stream().mapToLong(DeleteFile::recordCount).sum() <
setFilterThreshold) {
- return Deletes.filter(records, this::pos,
Deletes.toPositionIndex(filePath, deletes));
+ PositionDeleteIndex positionIndex = Deletes.toPositionIndex(filePath,
deletes);
+ Predicate<T> isInDeleteSet = record ->
positionIndex.isDeleted(pos(record));
+ return hasColumnIsDeleted ?
+ Deletes.markDeleted(records, isInDeleteSet, this::markRowDeleted) :
Review Comment:
Hm i didnt see markDeleted used anywhere else in code, maybe I missed it?
I thought it would be more symmetric to have Deletes class take in
PositionDeleteIndex (given it returns a PositionDeleteIndex) and Function<T,
Long> rowToPosition (given other methods take it), but just style preference.
--
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]