pub struct ListArray<O> where
O: Offset, { /* private fields */ }
Expand description
An Array
semantically equivalent to Vec<Option<Vec<Option<T>>>>
with Arrow’s in-memory.
Implementations
sourceimpl<'a, O> ListArray<O> where
O: Offset,
impl<'a, O> ListArray<O> where
O: Offset,
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Array + 'static, Global>, ListValuesIter<'a, ListArray<O>>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I> Iterator for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, type Item = Option<T>;
pub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Array + 'static, Global>, ListValuesIter<'a, ListArray<O>>>ⓘNotable traits for ZipValidity<'a, T, I>impl<'a, T, I> Iterator for ZipValidity<'a, T, I> where
I: Iterator<Item = T>, type Item = Option<T>;
I: Iterator<Item = T>, type Item = Option<T>;
Returns an iterator of Option<Box<dyn Array>>
sourcepub fn values_iter(&'a self) -> ListValuesIter<'a, ListArray<O>>ⓘNotable traits for ListValuesIter<'a, A>impl<'a, A> Iterator for ListValuesIter<'a, A> where
A: IterableListArray, type Item = Box<dyn Array + 'static, Global>;
pub fn values_iter(&'a self) -> ListValuesIter<'a, ListArray<O>>ⓘNotable traits for ListValuesIter<'a, A>impl<'a, A> Iterator for ListValuesIter<'a, A> where
A: IterableListArray, type Item = Box<dyn Array + 'static, Global>;
A: IterableListArray, type Item = Box<dyn Array + 'static, Global>;
Returns an iterator of Box<dyn Array>
sourceimpl<O> ListArray<O> where
O: Offset,
impl<O> ListArray<O> where
O: Offset,
sourcepub fn try_new(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<ListArray<O>, ArrowError>
pub fn try_new(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<ListArray<O>, ArrowError>
Creates a new ListArray
.
Errors
This function returns an error iff:
- the offsets are not monotonically increasing
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len() - 1
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
Implementation
This function is O(N)
- checking monotinicity is O(N)
sourcepub fn new(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> ListArray<O>
pub fn new(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> ListArray<O>
Creates a new ListArray
.
Panics
This function panics iff:
- the offsets are not monotonically increasing
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len() - 1
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
Implementation
This function is O(N)
- checking monotinicity is O(N)
sourceimpl<O> ListArray<O> where
O: Offset,
impl<O> ListArray<O> where
O: Offset,
sourcepub unsafe fn try_new_unchecked(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<ListArray<O>, ArrowError>
pub unsafe fn try_new_unchecked(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<ListArray<O>, ArrowError>
Creates a new ListArray
.
Errors
This function returns an error iff:
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len() - 1
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
Safety
This function is unsafe iff:
- the offsets are not monotonically increasing
Implementation
This function is O(1)
sourcepub unsafe fn new_unchecked(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> ListArray<O>
pub unsafe fn new_unchecked(
data_type: DataType,
offsets: Buffer<O>,
values: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> ListArray<O>
Creates a new ListArray
.
Panics
This function panics iff:
- The last offset is not equal to the values’ length.
- the validity’s length is not equal to
offsets.len() - 1
. - The
data_type
’scrate::datatypes::PhysicalType
is not equal to eithercrate::datatypes::PhysicalType::List
orcrate::datatypes::PhysicalType::LargeList
. - The
data_type
’s inner field’s data type is not equal tovalues.data_type
.
Safety
This function is unsafe iff:
- the offsets are not monotonically increasing
Implementation
This function is O(1)
sourceimpl<O> ListArray<O> where
O: Offset,
impl<O> ListArray<O> where
O: Offset,
sourceimpl<O> ListArray<O> where
O: Offset,
impl<O> ListArray<O> where
O: Offset,
Trait Implementations
sourceimpl<O> Array for ListArray<O> where
O: Offset,
impl<O> Array for ListArray<O> where
O: Offset,
sourcefn data_type(&self) -> &DataType
fn data_type(&self) -> &DataType
The DataType
of the Array
. In combination with Array::as_any
, this can be
used to downcast trait objects (dyn Array
) to concrete arrays. Read more
sourceunsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> Box<dyn Array + 'static, Global>
unsafe fn slice_unchecked(
&self,
offset: usize,
length: usize
) -> Box<dyn Array + 'static, Global>
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
sourceimpl<'a, O> From<GrowableList<'a, O>> for ListArray<O> where
O: Offset,
impl<'a, O> From<GrowableList<'a, O>> for ListArray<O> where
O: Offset,
sourcefn from(val: GrowableList<'a, O>) -> ListArray<O>
fn from(val: GrowableList<'a, O>) -> ListArray<O>
Performs the conversion.
sourceimpl<O, M> From<MutableListArray<O, M>> for ListArray<O> where
O: Offset,
M: MutableArray,
impl<O, M> From<MutableListArray<O, M>> for ListArray<O> where
O: Offset,
M: MutableArray,
sourcefn from(other: MutableListArray<O, M>) -> ListArray<O>
fn from(other: MutableListArray<O, M>) -> ListArray<O>
Performs the conversion.
sourceimpl<'a, O> IntoIterator for &'a ListArray<O> where
O: Offset,
impl<'a, O> IntoIterator for &'a ListArray<O> where
O: Offset,
type IntoIter = ZipValidity<'a, Box<dyn Array + 'static, Global>, ListValuesIter<'a, ListArray<O>>>
type IntoIter = ZipValidity<'a, Box<dyn Array + 'static, Global>, ListValuesIter<'a, ListArray<O>>>
Which kind of iterator are we turning this into?
sourceimpl<O> IterableListArray for ListArray<O> where
O: Offset,
impl<O> IterableListArray for ListArray<O> where
O: Offset,
sourceimpl ListFromIter for ListArray<i64>
impl ListFromIter for ListArray<i64>
sourceunsafe fn from_iter_primitive_trusted_len<T, P, I>(
iter: I,
data_type: DataType
) -> ListArray<i64> where
T: NativeType,
P: IntoIterator<Item = Option<T>>,
I: IntoIterator<Item = Option<P>>,
unsafe fn from_iter_primitive_trusted_len<T, P, I>(
iter: I,
data_type: DataType
) -> ListArray<i64> where
T: NativeType,
P: IntoIterator<Item = Option<T>>,
I: IntoIterator<Item = Option<P>>,
Create a list-array from an iterator. Used in groupby agg-list Read more
sourceunsafe fn from_iter_bool_trusted_len<I, P>(iter: I) -> ListArray<i64> where
I: IntoIterator<Item = Option<P>>,
P: IntoIterator<Item = Option<bool>>,
unsafe fn from_iter_bool_trusted_len<I, P>(iter: I) -> ListArray<i64> where
I: IntoIterator<Item = Option<P>>,
P: IntoIterator<Item = Option<bool>>,
Create a list-array from an iterator. Used in groupby agg-list Read more
sourceunsafe fn from_iter_utf8_trusted_len<I, P, Ref>(
iter: I,
n_elements: usize
) -> ListArray<i64> where
I: IntoIterator<Item = Option<P>>,
P: IntoIterator<Item = Option<Ref>>,
Ref: AsRef<str>,
unsafe fn from_iter_utf8_trusted_len<I, P, Ref>(
iter: I,
n_elements: usize
) -> ListArray<i64> where
I: IntoIterator<Item = Option<P>>,
P: IntoIterator<Item = Option<Ref>>,
Ref: AsRef<str>,
Create a list-array from an iterator. Used in groupby agg-list Read more
sourceimpl ValueSize for ListArray<i64>
impl ValueSize for ListArray<i64>
sourcefn get_values_size(&self) -> usize
fn get_values_size(&self) -> usize
Useful for a Utf8 or a List to get underlying value size. During a rechunk this is handy Read more
impl ArrowArray for ListArray<i64>
Auto Trait Implementations
impl<O> !RefUnwindSafe for ListArray<O>
impl<O> Send for ListArray<O>
impl<O> Sync for ListArray<O>
impl<O> Unpin for ListArray<O>
impl<O> !UnwindSafe for ListArray<O>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<A> IsValid for A where
A: ArrowArray,
impl<A> IsValid for A where
A: ArrowArray,
sourceunsafe fn is_valid_unchecked(&self, i: usize) -> bool
unsafe fn is_valid_unchecked(&self, i: usize) -> bool
Safety Read more
sourceunsafe fn is_null_unchecked(&self, i: usize) -> bool
unsafe fn is_null_unchecked(&self, i: usize) -> bool
Safety Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<A> PolarsArray for A where
A: Array + ?Sized,
impl<A> PolarsArray for A where
A: Array + ?Sized,
fn has_validity(&self) -> bool
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more