stevenzwu commented on code in PR #13699: URL: https://github.com/apache/iceberg/pull/13699#discussion_r2283621660
########## arrow/src/main/java/org/apache/iceberg/arrow/ArrowSchemaUtil.java: ########## @@ -51,94 +54,134 @@ private ArrowSchemaUtil() {} public static Schema convert(final org.apache.iceberg.Schema schema) { ImmutableList.Builder<Field> fields = ImmutableList.builder(); - for (NestedField f : schema.columns()) { - fields.add(convert(f)); + for (NestedField field : schema.columns()) { Review Comment: nit: Why not call `TypeUtil.visit` on the schema directly like other visitors? it essentially pushes the for loop inside the visitor, which is needed for nested struct anyway. e.g. Spark ``` public static StructType convert(Schema schema) { return (StructType) TypeUtil.visit(schema, new TypeToSparkType()); } ``` -- 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