chenjunjiedada commented on a change in pull request #830: URL: https://github.com/apache/iceberg/pull/830#discussion_r441581208
########## File path: parquet/src/main/java/org/apache/iceberg/parquet/PruneColumns.java ########## @@ -45,13 +44,16 @@ public Type message(MessageType message, List<Type> fields) { for (int i = 0; i < fields.size(); i += 1) { Type originalField = message.getType(i); Type field = fields.get(i); - if (selectedIds.contains(getId(originalField))) { - builder.addField(originalField); - fieldCount += 1; - } else if (field != null) { - builder.addField(field); - fieldCount += 1; - hasChange = true; + Integer fieldId = getId(originalField); + if (fieldId != null) { + if (selectedIds.contains(fieldId)) { Review comment: Make sense to me. Updated. ########## File path: parquet/src/main/java/org/apache/iceberg/parquet/PruneColumns.java ########## @@ -71,11 +73,14 @@ public Type struct(GroupType struct, List<Type> fields) { for (int i = 0; i < fields.size(); i += 1) { Type originalField = struct.getType(i); Type field = fields.get(i); - if (selectedIds.contains(getId(originalField))) { - filteredFields.add(originalField); - } else if (field != null) { - filteredFields.add(originalField); - hasChange = true; + Integer fieldId = getId(originalField); + if (fieldId != null) { Review comment: Done. ---------------------------------------------------------------- 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