Skip to content

Commit 1afa0e7

Browse files
smaheshwar-pltrSreesh Maheshwar
andauthored
Core: Remove TableMetadata::Builder::resetMainBranch (apache#12149)
Co-authored-by: Sreesh Maheshwar <[email protected]>
1 parent 507e2a9 commit 1afa0e7

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

core/src/main/java/org/apache/iceberg/TableMetadata.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ public TableMetadata buildReplacement(
750750

751751
return new Builder(this)
752752
.upgradeFormatVersion(newFormatVersion)
753-
.resetMainBranch()
753+
.removeRef(SnapshotRef.MAIN_BRANCH)
754754
.setCurrentSchema(freshSchema, newLastColumnId.get())
755755
.setDefaultPartitionSpec(freshSpec)
756756
.setDefaultSortOrder(freshSortOrder)
@@ -1360,16 +1360,6 @@ public Builder removeRef(String name) {
13601360
return this;
13611361
}
13621362

1363-
private Builder resetMainBranch() {
1364-
this.currentSnapshotId = -1;
1365-
SnapshotRef ref = refs.remove(SnapshotRef.MAIN_BRANCH);
1366-
if (ref != null) {
1367-
changes.add(new MetadataUpdate.RemoveSnapshotRef(SnapshotRef.MAIN_BRANCH));
1368-
}
1369-
1370-
return this;
1371-
}
1372-
13731363
/**
13741364
* Set a statistics file for a snapshot.
13751365
*

0 commit comments

Comments
 (0)