findepi commented on code in PR #5450:
URL: https://github.com/apache/iceberg/pull/5450#discussion_r954191965


##########
core/src/main/java/org/apache/iceberg/MetadataUpdate.java:
##########
@@ -178,6 +178,46 @@ public void applyTo(TableMetadata.Builder metadataBuilder) 
{
     }
   }
 
+  class SetStatistics implements MetadataUpdate {
+    private final long snapshotId;
+    private final StatisticsFile statisticsFile;
+
+    public SetStatistics(long snapshotId, StatisticsFile statisticsFile) {
+      this.snapshotId = snapshotId;
+      this.statisticsFile = statisticsFile;
+    }
+
+    public long snapshotId() {
+      return snapshotId;
+    }
+
+    public StatisticsFile statisticsFile() {
+      return statisticsFile;
+    }
+
+    @Override
+    public void applyTo(TableMetadata.Builder metadataBuilder) {
+      metadataBuilder.setStatistics(snapshotId, statisticsFile);
+    }
+  }
+
+  class RemoveStatistics implements MetadataUpdate {

Review Comment:
   Yes, `SetStatistics` should be idempotent and also should allow replacing an 
existing stat file, so we don't need remove when we want to set.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to