amogh-jahagirdar commented on code in PR #6634:
URL: https://github.com/apache/iceberg/pull/6634#discussion_r1083658719
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -551,10 +555,19 @@ public void commit(TableMetadata underlyingBase,
TableMetadata metadata) {
}
// track the intermediate snapshot ids for rewriting the snapshot log
- // an id is intermediate if it isn't the base snapshot id and it is
replaced by a new current
- Long oldId = currentId(current);
- if (oldId != null && !oldId.equals(currentId(metadata)) &&
!oldId.equals(currentId(base))) {
- intermediateSnapshotIds.add(oldId);
+ // an id is intermediate if it isn't the head of the branch in base and
it is replaced by a new head of the branch in current
Review Comment:
Thanks @rdblue that makes a lot of sense, my previous logic was a more
complex way of just capturing the new snapshots across all the branches but we
can quite simply just get that by diffing the set of snapshots that were
committed and the pre-transaction snapshots.
--
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]