Skip to content

Commit

Permalink
Core: Remove TableMetadata::Builder::resetMainBranch (apache#12149)
Browse files Browse the repository at this point in the history
Co-authored-by: Sreesh Maheshwar <[email protected]>
  • Loading branch information
smaheshwar-pltr and Sreesh Maheshwar authored Feb 4, 2025
1 parent 507e2a9 commit 1afa0e7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions core/src/main/java/org/apache/iceberg/TableMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ public TableMetadata buildReplacement(

return new Builder(this)
.upgradeFormatVersion(newFormatVersion)
.resetMainBranch()
.removeRef(SnapshotRef.MAIN_BRANCH)
.setCurrentSchema(freshSchema, newLastColumnId.get())
.setDefaultPartitionSpec(freshSpec)
.setDefaultSortOrder(freshSortOrder)
Expand Down Expand Up @@ -1360,16 +1360,6 @@ public Builder removeRef(String name) {
return this;
}

private Builder resetMainBranch() {
this.currentSnapshotId = -1;
SnapshotRef ref = refs.remove(SnapshotRef.MAIN_BRANCH);
if (ref != null) {
changes.add(new MetadataUpdate.RemoveSnapshotRef(SnapshotRef.MAIN_BRANCH));
}

return this;
}

/**
* Set a statistics file for a snapshot.
*
Expand Down

0 comments on commit 1afa0e7

Please sign in to comment.