dimas-b commented on code in PR #5067:
URL: https://github.com/apache/iceberg/pull/5067#discussion_r907727228


##########
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:
   Ok, I added a test case for empty structs and rebased. 
   
   Putting specific java types into `TypeID` does not look too difficult, but 
there is some non-trivial logic about that in `ManifestFileUtil` and 
`BaseDataReader`. I can certain handle that in a follow-up PR. It seems 
reasonable to put specific java types into `TypeID`.



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

Reply via email to