findepi commented on code in PR #5450:
URL: https://github.com/apache/iceberg/pull/5450#discussion_r952482365
##########
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:
When working on Trino stats support in Hive and Delta we found out that
ability to remove stats is useful. We need a way to remove statistics from a
table, for example if we detect that application that wrote stats did it
incorrectly, or when stats are correct, but a query engine makes wrong
conclusions using those stats and plans are bad in practice.
@rdblue how would you want to model this?
--
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]