pub struct ViewBuffer {
pub views: Vec<u128>,
pub buffers: Vec<Buffer>,
}Expand description
A buffer of view type byte arrays that can be converted into
GenericByteViewArray
Note this does not reuse GenericByteViewBuilder due to the need to call pad_nulls
and reuse the existing logic for Vec in the parquet crate
Fields§
§views: Vec<u128>§buffers: Vec<Buffer>Implementations§
Source§impl ViewBuffer
impl ViewBuffer
pub fn is_empty(&self) -> bool
pub fn append_block(&mut self, block: Buffer) -> u32
Sourcepub unsafe fn append_view_unchecked(
&mut self,
block: u32,
offset: u32,
len: u32,
)
pub unsafe fn append_view_unchecked( &mut self, block: u32, offset: u32, len: u32, )
§Safety
This method is only safe when:
blockis a valid index, i.e., the return value ofappend_blockoffsetandoffset + lenare valid indices into the buffer- The
(offset, offset + len)is valid value for the native type.
Sourcepub unsafe fn append_raw_view_unchecked(&mut self, view: &u128)
pub unsafe fn append_raw_view_unchecked(&mut self, view: &u128)
Directly append a view to the view array. This is used when we create a StringViewArray from a dictionary whose values are StringViewArray.
§Safety
The view must be a valid view as per the ByteView spec.
Sourcepub fn into_array(
self,
null_buffer: Option<Buffer>,
data_type: &ArrowType,
) -> ArrayRef
pub fn into_array( self, null_buffer: Option<Buffer>, data_type: &ArrowType, ) -> ArrayRef
Converts this into an [ArrayRef] with the provided data_type and null_buffer
Trait Implementations§
Source§impl Debug for ViewBuffer
impl Debug for ViewBuffer
Source§impl Default for ViewBuffer
impl Default for ViewBuffer
Source§fn default() -> ViewBuffer
fn default() -> ViewBuffer
Returns the “default value” for a type. Read more
Source§impl ValuesBuffer for ViewBuffer
impl ValuesBuffer for ViewBuffer
Source§fn pad_nulls(
&mut self,
read_offset: usize,
values_read: usize,
levels_read: usize,
valid_mask: &[u8],
)
fn pad_nulls( &mut self, read_offset: usize, values_read: usize, levels_read: usize, valid_mask: &[u8], )
If a column contains nulls, more level data may be read than value data, as null
values are not encoded. Therefore, first the levels data is read, the null count
determined, and then the corresponding number of values read to a
ValuesBuffer. Read moreAuto Trait Implementations§
impl Freeze for ViewBuffer
impl RefUnwindSafe for ViewBuffer
impl Send for ViewBuffer
impl Sync for ViewBuffer
impl Unpin for ViewBuffer
impl UnwindSafe for ViewBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more