rdblue commented on code in PR #6004:
URL: https://github.com/apache/iceberg/pull/6004#discussion_r1002768579
##########
core/src/main/java/org/apache/iceberg/avro/BuildAvroProjection.java:
##########
@@ -102,9 +102,17 @@ public Schema record(Schema record, List<String> names,
Iterable<Schema.Field> s
} else {
Preconditions.checkArgument(
- field.isOptional() ||
MetadataColumns.metadataFieldIds().contains(field.fieldId()),
- "Missing required field: %s",
+ (field.isRequired() && field.initialDefault() != null)
+ || field.isOptional()
+ ||
MetadataColumns.metadataFieldIds().contains(field.fieldId()),
+ "Missing required field that doesn't have a default value: %s",
field.name());
+ // If the field from Iceberg schema has initial default value, we just
pass and don't
Review Comment:
Style: In Iceberg, don't use personal pronouns like "I" or "we" in
documentation or comments because it makes documentation harder to understand
(who is "we"?) and longer. Instead, be direct:
> If the field has an initial default value, do not project it in the read
schema. The default will be added in the Iceberg `ValueReader`.
--
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]