scovich opened a new pull request, #8206:
URL: https://github.com/apache/arrow-rs/pull/8206

   # Which issue does this PR close?
   
   - Closes https://github.com/apache/arrow-rs/issues/8205
   
   # Rationale for this change
   
   `VariantArrayBuilder` had a very complex choreography with the 
`VariantBuilder` API, that required lots of manual drop glue to deal with 
ownership transfers between it and the `VariantArrayVariantBuilder` it 
delegates the actual work to. Rework the whole thing to use a (now-reusable) 
`MetadataBuilder` and `ValueBuilder`, with rollbacks largely handled by 
`ParentState` -- just like the other builders in the parquet-variant crate.
   
   # What changes are included in this PR?
   
   Four changes (curated as four commits that reviewers may want to examine 
individually):
   1. Make a bunch of parquet-variant builder infrastructure public, so that 
`VariantArrayBuilder` can access it from the parquet-variant-compute crate.
   2. Make `MetadataBuilder` reusable. Its `finish` method appends the bytes of 
a new serialized metadata dictionary to the underlying buffer and resets the 
remaining builder state. The builder is thus ready to create a brand new 
metadata dictionary whose serialized bytes will also be appended to the 
underlying buffer once finished.
   3. Rework `VariantArrayBuilder` to use `MetadataBuilder` and `ValueBuilder`, 
coordinated via `ParentState`. This is the main feature of the PR and also the 
most complicated/subtle.
   4. Delete now-unused code that had been added previously in order to support 
the old implementation of `VariantArrayBuilder`.
   
   
   # Are these changes tested?
   
   Existing variant array builder tests cover the change.
   
   # Are there any user-facing changes?
   
   A lot of builder-related types and methods from the parquet-variant crate 
are now public.


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to