RussellSpitzer commented on a change in pull request #1744:
URL: https://github.com/apache/iceberg/pull/1744#discussion_r521722895
##########
File path: core/src/main/java/org/apache/iceberg/avro/PruneColumns.java
##########
@@ -90,12 +92,18 @@ public Schema record(Schema record, List<String> names,
List<Schema> fields) {
} else if (fieldSchema != null) {
hasChange = true;
filteredFields.add(copyField(field, fieldSchema, fieldId));
+ } else if (emptyStructIds.contains(fieldId)) {
+ // This field does not require any known sub-fields but is required in
the projection so keep it without
Review comment:
This is the pruning Side fix to Bug 1, Basically making sure we add the
parents of any fields in the projection even if none of their real (in the
file) fields are projected.
For example without this fix
```
From (A, B { C } )
Project (A, B { D.Optional })
Returns
(A)
```
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]