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


##########
core/src/main/java/org/apache/iceberg/V2Metadata.java:
##########
@@ -30,6 +30,24 @@
 class V2Metadata {
   private V2Metadata() {}
 
+  private static int validContentId(ManifestContent content) {
+    Preconditions.checkArgument(
+        content == ManifestContent.DATA || content == ManifestContent.DELETES,
+        "Unsupported manifest content type for v2: %s",
+        content);
+    return content.id();
+  }
+
+  private static int validContentId(FileContent content) {

Review Comment:
   This should not return the ID because that makes this method responsible for 
symbol-to-ID translation as well as validation. We prefer that methods do one 
thing: in this case, check the content ID and throw an exception if it is not 
allowed.



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