rdblue commented on code in PR #5450:
URL: https://github.com/apache/iceberg/pull/5450#discussion_r953990153
##########
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:
That sounds good to me. Is `SetStatistics` intended to be idempotent? That
would make sense so that we don't need both remove and set if we want to
replace.
--
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]