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


##########
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,
+                "Missing required field: %s (%s)",

Review Comment:
   Previously, the error message for a missing required field only showed the 
field ID. I updated it to match the other formats and to provide the full 
column name, which is more friendly.
   
   This will also not fail missing required fields that have defaults. Instead, 
the `UnsupportedOperationException` for default support is thrown.



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

Reply via email to