nastra commented on code in PR #17413:
URL: https://github.com/apache/iceberg/pull/17413#discussion_r3680842497
##########
core/src/main/java/org/apache/iceberg/StatsUtil.java:
##########
@@ -317,6 +324,20 @@ static Types.StructType fieldStatsStruct(
return Types.StructType.of(fields);
}
+ /** Return whether a field may be null, either because it or any ancestor is
optional. */
+ private static boolean isNullable(Schema schema, Map<Integer, Integer>
parentIndex, int id) {
+ Integer currentId = id;
+ while (currentId != null) {
+ if (schema.findField(currentId).isOptional()) {
+ return true;
+ }
+
+ currentId = parentIndex.get(currentId);
+ }
+
+ return false;
+ }
Review Comment:
yep, I've unified the functionality already into `TypeUtil.isNullable()`
--
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]