prodeezy commented on a change in pull request #695: [WIP] Cherrypick snapshot
feature
URL: https://github.com/apache/incubator-iceberg/pull/695#discussion_r364998585
##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -391,17 +401,34 @@ public TableMetadata addStagedSnapshot(Snapshot
snapshot) {
}
public TableMetadata replaceCurrentSnapshot(Snapshot snapshot) {
- List<Snapshot> newSnapshots = ImmutableList.<Snapshot>builder()
- .addAll(snapshots)
- .add(snapshot)
- .build();
- List<HistoryEntry> newSnapshotLog = ImmutableList.<HistoryEntry>builder()
- .addAll(snapshotLog)
- .add(new SnapshotLogEntry(snapshot.timestampMillis(),
snapshot.snapshotId()))
- .build();
- return new TableMetadata(null, uuid, location,
- snapshot.timestampMillis(), lastColumnId, schema, defaultSpecId,
specs, properties,
- snapshot.snapshotId(), newSnapshots, newSnapshotLog,
addPreviousFile(file, lastUpdatedMillis));
+ // there can be operations (viz. rollback, cherrypick) where an existing
snapshot could be replacing current
Review comment:
Also, now that the deprecated Rollback api's impl also translates to
ManageSnaphots api.. that too doesn't implement commit(), ergo doesn't have to
call `setCurrentSnapshotTo()` (it earlier used -
`ops.commit(base.rollbackTo())` ) .
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]