amogh-jahagirdar commented on code in PR #12026:
URL: https://github.com/apache/iceberg/pull/12026#discussion_r1925494932


##########
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:
   >This will also not fail missing required fields that have defaults. 
Instead, the UnsupportedOperationException for default support is thrown.
   
   Ah I see the intent behind this, if we have missing required field that is 
set with defaults we do want to fall through to the new unsupported operation 
failure. I think it makes sense to indicate a different failure, and in that 
case the first check should check `field.initialDefaul() != null` 



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