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


##########
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:
   Nit: The getId() and findColumnName() logic is used multiple times. Could we 
extract it into a helper method?



-- 
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