amogh-jahagirdar commented on code in PR #12026: URL: https://github.com/apache/iceberg/pull/12026#discussion_r1925479680
########## orc/src/main/java/org/apache/iceberg/orc/ORCSchemaUtil.java: ########## @@ -326,13 +327,20 @@ private static TypeDescription buildOrcProjection( orcType = originalType.clone(); } } else { + Types.NestedField field = root.findField(fieldId); if (isRequired) { - throw new IllegalArgumentException( + Preconditions.checkArgument( + field.initialDefault() != null, Review Comment: Minor: Do we even need to check that the field.initialDefault() != null? That also technically is valid but just seems like an indirect way of expressing the check. If we're in this block (the field does not exist in the file) and the field is required, couldn't we just throw the IllegalArgumentException? ``` Preconditions.checkArgument(!isRequired, ""Missing required field: %s (%s)", ...) ``` Let me know if I'm missing anything. Agree with including the full column name though, that's a good improvement. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org