harshmotw-db commented on code in PR #7783:
URL: https://github.com/apache/arrow-rs/pull/7783#discussion_r2168244070


##########
parquet-variant/src/variant_buffer_manager.rs:
##########
@@ -0,0 +1,124 @@
+use arrow_schema::ArrowError;
+
+pub trait VariantBufferManager {

Review Comment:
   I think it's reasonable to return the whole slice, and have the Variant 
builder choose to write data wherever it chooses to. The trait was originally 
created for [this PR](https://github.com/delta-io/delta-kernel-rs/pull/1030) 
where bytes are often being shifted to make way for headers etc. Let me know if 
you disagree or would recommend a different simple alternative.
   
   As for why the methods are separate, I think you are generally correct and 
they could be combined. In the original PR, I was calling 
`ensure_value_buffer_size` only occasionally but that was because I was 
performing size checks in the variant library before calling the method and 
that check could be moved into the method.



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