aokolnychyi commented on a change in pull request #4370:
URL: https://github.com/apache/iceberg/pull/4370#discussion_r831619439
##########
File path: core/src/main/java/org/apache/iceberg/ManifestFilterManager.java
##########
@@ -396,29 +396,33 @@ private ManifestFile
filterManifestWithDeletedFiles(PartitionAndMetricsEvaluator
try {
reader.entries().forEach(entry -> {
F file = entry.file();
- boolean fileDelete = deletePaths.contains(file.path()) ||
+ boolean markedForDelete = deletePaths.contains(file.path()) ||
dropPartitions.contains(file.specId(), file.partition()) ||
(isDelete && entry.sequenceNumber() > 0 &&
entry.sequenceNumber() < minSequenceNumber);
if (entry.status() != ManifestEntry.Status.DELETED) {
- if (fileDelete || evaluator.rowsMightMatch(file)) {
+ if (markedForDelete || evaluator.rowsMightMatch(file)) {
+ boolean allRowsMatch = markedForDelete ||
evaluator.rowsMustMatch(file);
ValidationException.check(
- fileDelete || evaluator.rowsMustMatch(file),
+ allRowsMatch || isDelete, // ignore delete files where some
records may not match the expression
"Cannot delete file where some, but not all, rows match
filter %s: %s",
this.deleteExpression, file.path());
- writer.delete(entry);
-
- CharSequenceWrapper wrapper =
CharSequenceWrapper.wrap(entry.file().path());
- if (deletedPaths.contains(wrapper)) {
- LOG.warn("Deleting a duplicate path from manifest {}: {}",
- manifest.path(), wrapper.get());
- duplicateDeleteCount += 1;
+ if (allRowsMatch) {
+ writer.delete(entry);
Review comment:
Simply moved the existing logic under `if` now.
--
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]