szehon-ho commented on code in PR #5632:
URL: https://github.com/apache/iceberg/pull/5632#discussion_r977903306


##########
core/src/main/java/org/apache/iceberg/ManifestReader.java:
##########
@@ -126,15 +138,12 @@ protected ManifestReader(
       specId = Integer.parseInt(specProperty);
     }
 
-    if (specsById != null) {
-      this.spec = specsById.get(specId);
+    if (specsById != null && specsById.containsKey(specId)) {

Review Comment:
   Not sure why we need to add this  extra case here?  This spec id is for sure 
read from file (not the one you passed in), so all assumptions should still 
hold right?



##########
core/src/main/java/org/apache/iceberg/ManifestReader.java:
##########
@@ -101,20 +100,33 @@ private String fileClass() {
 
   protected ManifestReader(
       InputFile file,
+      int specId,
       Map<Integer, PartitionSpec> specsById,
       InheritableMetadata inheritableMetadata,
       FileType content) {
     this.file = file;
     this.inheritableMetadata = inheritableMetadata;
     this.content = content;
 
+    if (specsById != null && specsById.containsKey(specId)) {

Review Comment:
   Curious, specsById.containsKey(specId) should always be true, shouldnt it?  
Does it break if we remove 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]

Reply via email to