Rafferty97 opened a new issue, #6138:
URL: https://github.com/apache/arrow-rs/issues/6138

   # Summary
   
   Three functions in `array/struct_array.rs` use `SchemaBuilder` in the course 
of building a `StructArray`. However, in all cases they just extract the fields 
from the schema and throw out the empty metadata. It seems it would be more 
straightforward to just collect the fields into a `Vec` directly.
   
   I had considered that this might be intentional, perhaps in case the 
implementation of `SchemaBuilder` is ever changed, for example to collect into 
something other than a `Vec`. If so, I'd appreciate a little more context 
because as it stands this abstraction seems more confusing than useful.
   
   # Proposal
   
   In the three mentioned functions, collect into a `Vec<Field>` directly and 
then `.into()` it into a `Fields`. This eliminates the dependency on 
`SchemaBuilder`, making the code easier to read in isolation.


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

Reply via email to