amogh-jahagirdar commented on code in PR #15006:
URL: https://github.com/apache/iceberg/pull/15006#discussion_r2834376793
##########
core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java:
##########
@@ -1076,12 +1068,52 @@ private List<ManifestFile> newDeleteFilesAsManifests() {
// this triggers a rewrite of all delete manifests even if there is only
one new delete file
// if there is a relevant use case in the future, the behavior can be
optimized
cachedNewDeleteManifests.clear();
+ // On cache invalidation of delete files, clear the whole summary.
+ // Since the summary contained both data files and DVs, add back the
data files.
+ addedFilesSummary.clear();
Review Comment:
Worth noting that possibly we could add a targeted `clearDeleteFiles` that
is only zeroes/nulls out the delete file state in the summary. Then we'd be
able to not have to add back the data files completely again. Since this is
contained in this method I think it's probably OK as is, but worth considering
in a follow on. The main aspect is correctness on the stats.
I'm also not a fan of the targeted clearDeleteFiles because there may be
more complicated state in the future where it becomes ambiguous to a caller to
what exactly delete file state is in the summary (the exact semantic becomes
tricky to maintain over time)
--
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]