Struct arrow_array::array::GenericBinaryArray
source · [−]pub struct GenericBinaryArray<OffsetSize: OffsetSizeTrait> { /* private fields */ }
Expand description
See BinaryArray
and LargeBinaryArray
for storing
binary data.
Implementations
sourceimpl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> GenericBinaryArray<OffsetSize>
sourcepub const fn get_data_type() -> DataType
👎Deprecated: please use Self::DATA_TYPE
instead
pub const fn get_data_type() -> DataType
Self::DATA_TYPE
insteadGet the data type of the array.
sourcepub fn value_length(&self, i: usize) -> OffsetSize
pub fn value_length(&self, i: usize) -> OffsetSize
Returns the length for value at index i
.
sourcepub fn value_data(&self) -> Buffer
pub fn value_data(&self) -> Buffer
Returns a clone of the value data buffer
sourcepub fn value_offsets(&self) -> &[OffsetSize]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn value_offsets(&self) -> &[OffsetSize]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the offset values in the offsets buffer
sourcepub unsafe fn value_unchecked(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub unsafe fn value_unchecked(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the element at index i
as bytes slice
Safety
Caller is responsible for ensuring that the index is within the bounds of the array
sourcepub fn value(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn value(&self, i: usize) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
sourcepub fn from_vec(v: Vec<&[u8]>) -> Self
pub fn from_vec(v: Vec<&[u8]>) -> Self
Creates a GenericBinaryArray from a vector of byte slices
See also Self::from_iter_values
sourcepub fn from_opt_vec(v: Vec<Option<&[u8]>>) -> Self
pub fn from_opt_vec(v: Vec<Option<&[u8]>>) -> Self
Creates a GenericBinaryArray from a vector of Optional (null) byte slices
sourcepub fn from_iter_values<Ptr, I>(iter: I) -> Selfwhere
Ptr: AsRef<[u8]>,
I: IntoIterator<Item = Ptr>,
pub fn from_iter_values<Ptr, I>(iter: I) -> Selfwhere
Ptr: AsRef<[u8]>,
I: IntoIterator<Item = Ptr>,
Creates a GenericBinaryArray
based on an iterator of values without nulls
sourcepub fn take_iter<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&'_ [u8]>> + 'a
pub fn take_iter<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&'_ [u8]>> + 'a
Returns an iterator that returns the values of array.value(i)
for an iterator with each element i
sourcepub unsafe fn take_iter_unchecked<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&'_ [u8]>> + 'a
pub unsafe fn take_iter_unchecked<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a
) -> impl Iterator<Item = Option<&'_ [u8]>> + 'a
Returns an iterator that returns the values of array.value(i)
for an iterator with each element i
Safety
caller must ensure that the indexes in the iterator are less than the array.len()
sourcepub fn iter(&self) -> GenericBinaryIter<'_, OffsetSize>
pub fn iter(&self) -> GenericBinaryIter<'_, OffsetSize>
constructs a new iterator
Trait Implementations
sourceimpl<OffsetSize: OffsetSizeTrait> Array for GenericBinaryArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> Array for GenericBinaryArray<OffsetSize>
sourcefn data_ref(&self) -> &ArrayData
fn data_ref(&self) -> &ArrayData
sourcefn slice(&self, offset: usize, length: usize) -> ArrayRef
fn slice(&self, offset: usize, length: usize) -> ArrayRef
sourcefn offset(&self) -> usize
fn offset(&self) -> usize
0
. Read moresourcefn is_null(&self, index: usize) -> bool
fn is_null(&self, index: usize) -> bool
index
is null.
When using this function on a slice, the index is relative to the slice. Read moresourcefn is_valid(&self, index: usize) -> bool
fn is_valid(&self, index: usize) -> bool
index
is not null.
When using this function on a slice, the index is relative to the slice. Read moresourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
sourcefn get_buffer_memory_size(&self) -> usize
fn get_buffer_memory_size(&self) -> usize
sourcefn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
get_buffer_memory_size()
and
includes the overhead of the data structures that contain the pointers to the various buffers. Read more