arrow_array::array

Type Alias GenericStringArray

Source
pub type GenericStringArray<OffsetSize> = GenericByteArray<GenericStringType<OffsetSize>>;
Expand description

A GenericByteArray for storing str

Aliased Type§

struct GenericStringArray<OffsetSize> {
    data_type: DataType,
    value_offsets: OffsetBuffer<<GenericStringType<OffsetSize> as ByteArrayType>::Offset>,
    value_data: Buffer,
    nulls: Option<NullBuffer>,
}

Fields§

§data_type: DataType§value_offsets: OffsetBuffer<<GenericStringType<OffsetSize> as ByteArrayType>::Offset>§value_data: Buffer§nulls: Option<NullBuffer>

Implementations§

Source§

impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>

Source

pub fn num_chars(&self, i: usize) -> usize

Returns the number of Unicode Scalar Value in the string at index i.

§Performance

This function has O(n) time complexity where n is the string length. If you can make sure that all chars in the string are in the range U+0x0000 ~ U+0x007F, please use the function value_length which has O(1) time complexity.

Source

pub fn take_iter<'a>( &'a self, indexes: impl Iterator<Item = Option<usize>> + 'a, ) -> impl Iterator<Item = Option<&'a str>>

Returns an iterator that returns the values of array.value(i) for an iterator with each element i

Source

pub unsafe fn take_iter_unchecked<'a>( &'a self, indexes: impl Iterator<Item = Option<usize>> + 'a, ) -> impl Iterator<Item = Option<&'a str>>

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

Source

pub fn try_from_binary( v: GenericBinaryArray<OffsetSize>, ) -> Result<Self, ArrowError>

Fallibly creates a GenericStringArray from a GenericBinaryArray returning an error if GenericBinaryArray contains invalid UTF-8 data

Trait Implementations§

Source§

impl<OffsetSize: OffsetSizeTrait> From<GenericByteArray<GenericBinaryType<OffsetSize>>> for GenericStringArray<OffsetSize>

Source§

fn from(v: GenericBinaryArray<OffsetSize>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> From<GenericListArray<OffsetSize>> for GenericStringArray<OffsetSize>

Source§

fn from(v: GenericListArray<OffsetSize>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> From<Vec<&str>> for GenericStringArray<OffsetSize>

Source§

fn from(v: Vec<&str>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> From<Vec<Option<&str>>> for GenericStringArray<OffsetSize>

Source§

fn from(v: Vec<Option<&str>>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> From<Vec<Option<String>>> for GenericStringArray<OffsetSize>

Source§

fn from(v: Vec<Option<String>>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> From<Vec<String>> for GenericStringArray<OffsetSize>

Source§

fn from(v: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl<OffsetSize: OffsetSizeTrait> PartialEq for GenericStringArray<OffsetSize>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, O: OffsetSizeTrait> StringArrayType<'a> for &'a GenericStringArray<O>

Source§

fn is_ascii(&self) -> bool

Returns true if all data within this string array is ASCII
Source§

fn iter(&self) -> ArrayIter<Self>

Constructs a new iterator