tustvold commented on code in PR #5735:
URL: https://github.com/apache/arrow-rs/pull/5735#discussion_r1593994711
##########
arrow-data/src/byte_view.rs:
##########
@@ -32,6 +32,18 @@ pub struct ByteView {
}
impl ByteView {
+ /// Try to create a [`ByteView`] from the provided `v`
+ ///
+ /// If `v` instead contains the binary data inline, returns an `Err`
containing it
+ #[inline]
+ pub fn try_new(v: &u128) -> Result<Self, &[u8]> {
Review Comment:
> represent in Rust anywhere the different layouts of the u128s in
ByteViewArrays
Correct, it represents the non-inlined case where you have a view, and not
just a short inlined byte array.
This is consistent with the terminology used in the docs -
https://arrow.apache.org/docs/format/Columnar.html#variable-size-binary-view-layout
And with the terminology for ListView and LargeListView, where a view
represents a view into a separate buffer of data
> this API helps here by encapsulating that check for certain cases
What cases does it not encapsulate?
--
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]