scovich commented on PR #7843:
URL: https://github.com/apache/arrow-rs/pull/7843#issuecomment-3032781836

   > Honestly, now that the nested builders store their bytes in a separate 
vec, I would have expected rollback safety for free. But I guess we're still 
storing _something_ in the parent vec. I would imagine that's easily addressed 
by having the constructor grab a marker, which `finish` advances; then `drop` 
can simply truncate the vec to that mark. Seems simpler than safely poisoning 
it, and safer than relying on callers to maintain an invisible (and unusual) 
error handling invariant?
   
   Looking at the code, I think the bad behavior comes from the `pending` 
concept that the list and object builders employ. In a sense, they are 
unconditionally finalizing the builders (any subsequent method call checks for 
a pending builder)... but the finalization is only partial if the builder 
didn't actually finalize. Meanwhile, the variant builder itself lacks any such 
"pending" mechanism, which likely allows a different set of problems. In fact, 
it looks like the variant builder allows to "append" any number of variant 
values -- almost a column-oriented builder concept, but lacking any mechanism 
for tracking boundaries between offsets.


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