nastra commented on code in PR #17391:
URL: https://github.com/apache/iceberg/pull/17391#discussion_r3671294308
##########
core/src/test/java/org/apache/iceberg/FileGenerationUtil.java:
##########
@@ -207,6 +211,44 @@ public static Metrics generateRandomMetrics(
originalTypes);
}
+ // collects leaf primitive fields, recursing through struct/list/map
+ static List<Types.NestedField> leafFields(Schema schema) {
Review Comment:
I don't think we need this custom visitor. You should be able to achieve the
same thing by using `TypeUtil.indexById(schema.asStruct())` and then just
filtering on the field type
```
for (Types.NestedField field :
TypeUtil.indexById(schema.asStruct()).values()) {
if (field.type().isPrimitiveType()) {
// ...
}
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]