arrow_array::array

Type Alias BinaryViewArray

Source
pub type BinaryViewArray = GenericByteViewArray<BinaryViewType>;
Expand description

A GenericByteViewArray of [u8]

See GenericByteViewArray for format and layout details.

§Example

use arrow_array::BinaryViewArray;
let array = BinaryViewArray::from_iter_values(vec![b"hello" as &[u8], b"world", b"lulu", b"large payload over 12 bytes"]);
assert_eq!(array.value(0), b"hello");
assert_eq!(array.value(3), b"large payload over 12 bytes");

Aliased Type§

struct BinaryViewArray {
    data_type: DataType,
    views: ScalarBuffer<u128>,
    buffers: Vec<Buffer>,
    phantom: PhantomData<BinaryViewType>,
    nulls: Option<NullBuffer>,
}

Fields§

§data_type: DataType§views: ScalarBuffer<u128>§buffers: Vec<Buffer>§phantom: PhantomData<BinaryViewType>§nulls: Option<NullBuffer>

Implementations§

Source§

impl BinaryViewArray

Source

pub fn to_string_view(self) -> Result<StringViewArray, ArrowError>

Convert the BinaryViewArray to StringViewArray If items not utf8 data, validate will fail and error returned.

Source

pub unsafe fn to_string_view_unchecked(self) -> StringViewArray

Convert the BinaryViewArray to StringViewArray

§Safety

Caller is responsible for ensuring that items in array are utf8 data.

Trait Implementations§

Source§

impl From<Vec<&[u8]>> for BinaryViewArray

Source§

fn from(v: Vec<&[u8]>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Option<&[u8]>>> for BinaryViewArray

Source§

fn from(v: Vec<Option<&[u8]>>) -> Self

Converts to this type from the input type.