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

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   As discussed by @scovich @PinkCrow007 and I on 
https://github.com/apache/arrow-rs/pull/7653#discussion_r2147015818 we need to 
figure out how to build nested objects
   
   
   **Describe the solution you'd like**
   I would like some way to create an nested structures such as lists of structs
   
   For example
   ```json
   [
     {
      "first_name": "Jiaying",
     "last_name": "Li"
    },
      {
       "first_name": "Malthe",
       "last_name": "Karbo"
    }
   ]
   ```
   
   
   
   **Describe alternatives you've considered**
   One way would be to add `new_list` and `new_struct` methods to the existing 
`ListBuilder` and `StructBuilder`, something like
   
   ```rust
   let mut builder = VariantBuilder::new();
   
   // create overall list
   let mut list = builder.new_list();
   
   // create first object
   mut let obj = list.new_object(); // NOTE this is on the `list` builder not 
the overall builder
   obj.set("first_name", "Jiaying");
   obj.set("last_name", "Li");
   obj.finish(); // finish the first object
   
   // create second object
   mut let obj = list.new_object(); // NOTE this is on the `list` builder not 
the overall builder
   obj.set("first_name", "Malthe");
   obj.set("last_name", "Karbo");
   obj.finish(); // finish the first object
   
    
   // finish the overall list
   list.finish()
   
   let (metadata, value) = builder.fiinish();
   
   ```
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


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