rdblue commented on a change in pull request #1132:
URL: https://github.com/apache/iceberg/pull/1132#discussion_r444359302



##########
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:
       Why detect non-null here? Couldn't this always pass null because it is 
either null already or will be replaced with 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.

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