Skip to content

Commit f40208a

Browse files
authored
Core: Revert apache#12670 to Temporarily Restore Sending Single Snapshot Changes Rather than in Bulk (apache#13100)
1 parent 5541cf0 commit f40208a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,14 +1432,12 @@ public Builder removeSnapshots(Collection<Long> idsToRemove) {
14321432
private Builder rewriteSnapshotsInternal(Collection<Long> idsToRemove, boolean suppress) {
14331433
List<Snapshot> retainedSnapshots =
14341434
Lists.newArrayListWithExpectedSize(snapshots.size() - idsToRemove.size());
1435-
Set<Long> snapshotIdsToRemove = Sets.newHashSet();
1436-
14371435
for (Snapshot snapshot : snapshots) {
14381436
long snapshotId = snapshot.snapshotId();
14391437
if (idsToRemove.contains(snapshotId)) {
14401438
snapshotsById.remove(snapshotId);
14411439
if (!suppress) {
1442-
snapshotIdsToRemove.add(snapshotId);
1440+
changes.add(new MetadataUpdate.RemoveSnapshot(snapshotId));
14431441
}
14441442
removeStatistics(snapshotId);
14451443
removePartitionStatistics(snapshotId);
@@ -1448,10 +1446,6 @@ private Builder rewriteSnapshotsInternal(Collection<Long> idsToRemove, boolean s
14481446
}
14491447
}
14501448

1451-
if (!snapshotIdsToRemove.isEmpty()) {
1452-
changes.add(new MetadataUpdate.RemoveSnapshots(snapshotIdsToRemove));
1453-
}
1454-
14551449
this.snapshots = retainedSnapshots;
14561450

14571451
// remove any refs that are no longer valid

0 commit comments

Comments
 (0)