CTTY commented on code in PR #17413:
URL: https://github.com/apache/iceberg/pull/17413#discussion_r3770347663


##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -291,6 +291,25 @@ public static List<Types.NestedField> 
ancestorFields(Schema schema, int fieldId)
     return parents;
   }
 
+  /**
+   * Returns whether a field may contain null values.
+   *
+   * <p>A field may be null if it is optional or if any field that contains it 
is optional. A
+   * required field nested in an optional struct is null whenever that struct 
is null. A field that
+   * is not present in the schema may be null because its requirement is 
unknown.
+   *
+   * @param schema The schema that contains the field ID
+   * @param fieldId The field ID to check
+   * @return true if the field may be null, false if it cannot be null
+   */
+  public static boolean isNullable(Schema schema, int fieldId) {

Review Comment:
   Coming from the dev list: 
https://lists.apache.org/thread/93c86nsm4k4zz3yv86mxrjnzw1blogb0 
   
   I think it's valuable to use a different term to describe fields that are 
"effective nullable"
   
   Looks like Xiening also opened a spec change PR to introduce the term 
"nullable": https://github.com/apache/iceberg/pull/17609



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