scovich commented on code in PR #8206:
URL: https://github.com/apache/arrow-rs/pull/8206#discussion_r2292257803


##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -194,32 +197,23 @@ impl VariantArrayBuilder {
 ///
 /// See [`VariantArrayBuilder::variant_builder`] for an example
 pub struct VariantArrayVariantBuilder<'a> {
-    /// was finish called?
-    finished: bool,
-    /// starting offset in the variant_builder's `metadata` buffer
-    metadata_offset: usize,
-    /// starting offset in the variant_builder's `value` buffer
-    value_offset: usize,
-    /// Parent array builder that this variant builder writes to. Buffers
-    /// have been moved into the variant builder, and must be returned on
-    /// drop
-    array_builder: &'a mut VariantArrayBuilder,
-    /// Builder for the in progress variant value, temporarily owns the buffers
-    /// from `array_builder`
-    variant_builder: VariantBuilder,
+    parent_state: ParentState<'a>,

Review Comment:
   NOTE: I finally figured out why my pathfinding PR couldn't get the variant 
array builder to work correctly when storing end-offsets instead of 
start-offsets: It's because I wasn't using a top-level parent state, so 
rollbacks were unreliable. Out of pure luck, the unit test that validates 
nested rollbacks wrote the same number of bytes for the rolled back and 
finalized nested builders, and by storing the starting offset we got lucky to 
observe the correct byte slice.



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