huaxiangsun commented on code in PR #12771:
URL: https://github.com/apache/iceberg/pull/12771#discussion_r2083543648


##########
parquet/src/main/java/org/apache/iceberg/parquet/Parquet.java:
##########
@@ -401,6 +405,22 @@ public <D> FileAppender<D> build() throws IOException {
         Preconditions.checkState(fileAADPrefix == null, "AAD prefix set with 
null encryption key");
       }
 
+      Map<String, String> colNameToParquetPathMap =
+          type.getColumns().stream()
+              .filter(col -> col.getPrimitiveType().getId() != null)
+              .filter(
+                  col -> {
+                    int fieldId = col.getPrimitiveType().getId().intValue();
+                    return schema.findColumnName(fieldId) != null;
+                  })
+              .collect(
+                  Collectors.toMap(
+                      col -> {
+                        int fieldId = 
col.getPrimitiveType().getId().intValue();
+                        return schema.findColumnName(fieldId);

Review Comment:
   Thanks @huaxingao for the review. I thought about it when I was working on a 
patch. The logic there is essentially findColumnName(). The getId() is to 
access the the field in the col. In my opinion, there is not much to extract. I 
can merge two filters call into one, will upload a new patch. What do you 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.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

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