rdblue commented on code in PR #5021:
URL: https://github.com/apache/iceberg/pull/5021#discussion_r936919462


##########
core/src/main/java/org/apache/iceberg/TableMetadata.java:
##########
@@ -884,6 +895,17 @@ private Builder(TableMetadata base) {
       this.previousFileLocation = base.metadataFileLocation;
       this.previousFiles = base.previousFiles;
       this.refs = Maps.newHashMap(base.refs);
+      this.statistics =
+          base.statistics.stream()
+              .collect(
+                  Collectors.toMap(
+                      StatisticsFile::snapshotId,
+                      Function.identity(),
+                      (a, b) -> {
+                        throw new IllegalArgumentException(
+                            "Two statistics files for same snapshot");

Review Comment:
   Is it a good idea to reject duplicate stats files? That seems like a way to 
needlessly break a table.
   
   As long as this is in the builder, you'd be able to read but not modify 
metadata. But I'd still prefer to be able to fix this somehow.



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