You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by ru...@apache.org on 2025/05/21 15:54:39 UTC

(iceberg) branch 1.9.x updated: Core: Revert #12670 to Temporarily Restore Sending Single Snapshot Changes Rather than in Bulk (#13100)

This is an automated email from the ASF dual-hosted git repository.

russellspitzer pushed a commit to branch 1.9.x
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/1.9.x by this push:
     new f40208ae6f Core: Revert #12670 to Temporarily Restore Sending Single Snapshot Changes Rather than in Bulk (#13100)
f40208ae6f is described below

commit f40208ae6fb2f33e578c2637d3dea1db18739f31
Author: Aihua Xu <ai...@gmail.com>
AuthorDate: Wed May 21 08:54:33 2025 -0700

    Core: Revert #12670 to Temporarily Restore Sending Single Snapshot Changes Rather than in Bulk (#13100)
---
 core/src/main/java/org/apache/iceberg/TableMetadata.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/core/src/main/java/org/apache/iceberg/TableMetadata.java b/core/src/main/java/org/apache/iceberg/TableMetadata.java
index 61f3a389fd..3cbba0957c 100644
--- a/core/src/main/java/org/apache/iceberg/TableMetadata.java
+++ b/core/src/main/java/org/apache/iceberg/TableMetadata.java
@@ -1432,14 +1432,12 @@ public class TableMetadata implements Serializable {
     private Builder rewriteSnapshotsInternal(Collection<Long> idsToRemove, boolean suppress) {
       List<Snapshot> retainedSnapshots =
           Lists.newArrayListWithExpectedSize(snapshots.size() - idsToRemove.size());
-      Set<Long> snapshotIdsToRemove = Sets.newHashSet();
-
       for (Snapshot snapshot : snapshots) {
         long snapshotId = snapshot.snapshotId();
         if (idsToRemove.contains(snapshotId)) {
           snapshotsById.remove(snapshotId);
           if (!suppress) {
-            snapshotIdsToRemove.add(snapshotId);
+            changes.add(new MetadataUpdate.RemoveSnapshot(snapshotId));
           }
           removeStatistics(snapshotId);
           removePartitionStatistics(snapshotId);
@@ -1448,10 +1446,6 @@ public class TableMetadata implements Serializable {
         }
       }
 
-      if (!snapshotIdsToRemove.isEmpty()) {
-        changes.add(new MetadataUpdate.RemoveSnapshots(snapshotIdsToRemove));
-      }
-
       this.snapshots = retainedSnapshots;
 
       // remove any refs that are no longer valid