Shekharrajak opened a new issue, #12288:
URL: https://github.com/apache/iceberg/issues/12288
### Query engine
JAVA API
### Question
Using JAVA API I would like to find out how many datafiles are deleted in my
delete API and in current snapshot (comparing with previous snapshot).
Can anyone share how it is achievable ? Please review my code, and comment
if it is a good way of doing the same, if there is no API:
```
Snapshot snapshot = table.snapshot(latestSnapshotId);
List<ManifestFile> manifestFiles =
snapshot.allManifests(table.io());
for (ManifestFile manifest : manifestFiles) {
try (ManifestReader<DataFile> reader =
ManifestFiles.read(manifest, table.io())) {
for (DataFile file : reader) {
if (manifest.hasDeletedFiles()) { // This ensures
we're checking deleted files
LOGGER.info("Deleted DataFile: {}, Partition:
{}, Manifest: {}",
file.path(), file.partition(),
manifest.path());
}
}
}
}
```
--
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]