danielcweeks commented on code in PR #13699: URL: https://github.com/apache/iceberg/pull/13699#discussion_r2248978982
########## arrow/src/main/java/org/apache/iceberg/arrow/ArrowSchemaUtil.java: ########## @@ -51,94 +54,133 @@ 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()) { + fields.add(TypeUtil.visit(field.type(), new IcebergToArrowTypeConverter(field))); Review Comment: Rather than operate field-by-field like this, it would make more sense for the schema visitor to take the passed in schema and convert to perform the complete conversion that way. This approach is mixing the patterns, but the visitor pattern covers this as well. That would make this a straightforward: ```java return TypeUtil.visit(schema, new IcebertToArrowTypeConvertor(schema)); ``` -- 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