aokolnychyi commented on a change in pull request #1335:
URL: https://github.com/apache/iceberg/pull/1335#discussion_r470034727



##########
File path: core/src/main/java/org/apache/iceberg/mapping/MappedFields.java
##########
@@ -37,21 +38,21 @@ public static MappedFields of(List<MappedField> fields) {
   }
 
   private final List<MappedField> fields;
-  private final Map<String, Integer> nameToId;
-  private final Map<Integer, MappedField> idToField;
+  private transient Map<String, Integer> nameToId;
+  private transient Map<Integer, MappedField> idToField;
 
   private MappedFields(List<MappedField> fields) {
     this.fields = ImmutableList.copyOf(fields);
-    this.nameToId = indexIds(fields);
-    this.idToField = indexFields(fields);
+    lazyNameToId();

Review comment:
       I kept the initialization in place. It triggers validation. Otherwise, 
some tests fail.




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

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