rdblue commented on a change in pull request #1963:
URL: https://github.com/apache/iceberg/pull/1963#discussion_r579889665



##########
File path: 
core/src/main/java/org/apache/iceberg/avro/AvroWithPartnerByStructureVisitor.java
##########
@@ -161,4 +186,17 @@ public T map(P sMap, Schema map, T value) {
   public T primitive(P type, Schema primitive) {
     return null;
   }
+
+  // ---------------------------------- Helpers 
---------------------------------------------
+
+  private Deque<String> fieldNames = Lists.newLinkedList();
+  private Deque<Schema> parentSchemas = Lists.newLinkedList();

Review comment:
       What about creating a fake `Schema.Field` to pass to the before/after 
method instead? Another alternative is to pass the field information to the 
method, like this:
   
   ```java
     public beforeField(int fieldId, String name, Schema type);
     public afterField(int fieldId, String name, Schema type);
     public beforeListElement(int elementId, Schema elementType);
     public beforeMapKey(int keyId, Schema keyType);
     public beforeMapValue(int valueId, Schema valueType);
   ```
   
   I think some variation on this would be better. We want to avoid keeping 
additional state in all visitors.




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