ArrowSchemaVisitor's lifecycle methods (before_field, after_field, before_list_element, etc.) currently take &Field. Because the underlying data in Fields is stored as Arc<Field> (FieldRef), callers that need to retain field info across the traversal are forced to clone the entire Field (including its name string, metadata hashmap, and child types).
Changing the signatures to accept &FieldRef would let visitors store a cheap Arc::clone instead.
See: #2301 (comment)
ArrowSchemaVisitor's lifecycle methods (before_field,after_field,before_list_element, etc.) currently take&Field. Because the underlying data inFieldsis stored asArc<Field>(FieldRef), callers that need to retain field info across the traversal are forced to clone the entireField(including its name string, metadata hashmap, and child types).Changing the signatures to accept
&FieldRefwould let visitors store a cheapArc::cloneinstead.See: #2301 (comment)