amogh-jahagirdar commented on a change in pull request #4006:
URL: https://github.com/apache/iceberg/pull/4006#discussion_r795119072
##########
File path: core/src/main/java/org/apache/iceberg/RemoveSnapshots.java
##########
@@ -451,4 +519,26 @@ private void deleteDataFiles(Set<ManifestFile>
manifestsToScan, Set<ManifestFile
return CloseableIterable.withNoopClose(snapshot.allManifests());
}
}
+
+ private class SnapshotTimestampComparator implements Comparator<Snapshot> {
+
+ @Override
+ public int compare(Snapshot o1, Snapshot o2) {
+ if (o1.timestampMillis() < o2.timestampMillis()) {
+ return -1;
+ }
+ else if (o1.timestampMillis() > o2.timestampMillis()) {
+ return 1;
+ }
+ else {
+ if (o1.snapshotId() > o2.snapshotId()) {
+ return -1;
+ }
+ else if (o1.snapshotId() < o2.snapshotId()) {
+ return 1;
+ }
+ return 0;
+ }
+ }
Review comment:
If we end up doing this, I think this should be reversed. The latest
snapshot should be at the top of the heap.
--
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]