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>
impl<OffsetSize: OffsetSizeTrait> GenericStringArray<OffsetSize>
Sourcepub fn num_chars(&self, i: usize) -> usize
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.
Sourcepub fn take_iter<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a,
) -> impl Iterator<Item = Option<&'a str>>
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
Sourcepub unsafe fn take_iter_unchecked<'a>(
&'a self,
indexes: impl Iterator<Item = Option<usize>> + 'a,
) -> impl Iterator<Item = Option<&'a str>>
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()
Sourcepub fn try_from_binary(
v: GenericBinaryArray<OffsetSize>,
) -> Result<Self, ArrowError>
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>
impl<OffsetSize: OffsetSizeTrait> From<GenericByteArray<GenericBinaryType<OffsetSize>>> for GenericStringArray<OffsetSize>
Source§fn from(v: GenericBinaryArray<OffsetSize>) -> Self
fn from(v: GenericBinaryArray<OffsetSize>) -> Self
Converts to this type from the input type.
Source§impl<OffsetSize: OffsetSizeTrait> From<GenericListArray<OffsetSize>> for GenericStringArray<OffsetSize>
impl<OffsetSize: OffsetSizeTrait> From<GenericListArray<OffsetSize>> for GenericStringArray<OffsetSize>
Source§fn from(v: GenericListArray<OffsetSize>) -> Self
fn from(v: GenericListArray<OffsetSize>) -> Self
Converts to this type from the input type.