amogh-jahagirdar commented on a change in pull request #4082:
URL: https://github.com/apache/iceberg/pull/4082#discussion_r803250465



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -725,6 +728,21 @@ private static SortOrder freshSortOrder(int orderId, 
Schema schema, SortOrder so
     return builder.build();
   }
 
+  private Map<String, SnapshotRef> validateAndCompleteRefs(Map<String, 
SnapshotRef> inputRefs) {

Review comment:
       Ah yes. There is no "completion" as such, since we're always assuming 
that main exists. I think it could be worth at the end of validating the 
references in a loop, we perform one final validation that main reference 
exists in the metadata. Otherwise we fail since the metadata is basically in a 
corrupted state at that point. Regardless, it is still validation so just 
"validateRefs" should be good.
   
   I was going to do this in this PR but that breaks a bunch of tests which 
rely on tableMetadata as the main reference isn't defined in their metadata. 
Once we get some more clarity though I can add that validation and update the 
tests. Thoughts?




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