rdblue commented on a change in pull request #1132: URL: https://github.com/apache/iceberg/pull/1132#discussion_r444508849
########## File path: core/src/main/java/org/apache/iceberg/avro/PruneColumns.java ########## @@ -247,8 +255,9 @@ private static Schema copyRecord(Schema record, List<Schema.Field> newFields) { } private static Schema.Field copyField(Schema.Field field, Schema newSchema, Integer fieldId) { + // do not copy over non-null default values as the file is expected to have values for fields in the file schema Schema.Field copy = new Schema.Field(field.name(), - newSchema, field.doc(), field.defaultVal(), field.order()); + newSchema, field.doc(), hasNonNullDefault(field) ? null : field.defaultVal(), field.order()); Review comment: If the schema is an option schema, then its default should be null. That means that we would need to reorder the options to allow that default, I think. ---------------------------------------------------------------- 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. 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