dimas-b commented on code in PR #5067:
URL: https://github.com/apache/iceberg/pull/5067#discussion_r907664566
##########
api/src/main/java/org/apache/iceberg/Accessors.java:
##########
@@ -56,14 +56,30 @@ static Map<Integer, Accessor<StructLike>> forSchema(Schema
schema) {
}
private static class PositionAccessor implements Accessor<StructLike> {
- private int position;
+ private final int position;
private final Type type;
private final Class<?> javaClass;
PositionAccessor(int pos, Type type) {
this.position = pos;
this.type = type;
- this.javaClass = type.typeId().javaClass();
+
+ switch (type.typeId()) {
+ case MAP:
+ this.javaClass = Map.class;
Review Comment:
Here's an example of type-based `if`s:
https://github.com/apache/iceberg/blob/7c14ab6a42a8d2fc87df5d3f33c9956b3e25aed0/api/src/main/java/org/apache/iceberg/types/Comparators.java#L89-L96
@RussellSpitzer : Do you mean to unify all of the code and use
`type.typeId().javaClass()` or just limit the scope to `Accessors`?
--
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]