pub struct MapArray { /* private fields */ }
Expand description
An array representing a (key, value), both of arbitrary logical types.
Implementations
sourceimpl<'a> MapArray
impl<'a> MapArray
sourcepub fn iter(
&'a self
) -> ZipValidity<'a, Box<dyn Array + 'static, Global>, MapValuesIter<'a>>ⓘ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>, MapValuesIter<'a>>ⓘ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) -> MapValuesIter<'a>
pub fn values_iter(&'a self) -> MapValuesIter<'a>
Returns an iterator of Box<dyn Array>
sourceimpl MapArray
impl MapArray
sourcepub fn try_new(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<MapArray, ArrowError>
pub fn try_new(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> Result<MapArray, ArrowError>
Returns a new MapArray
.
Errors
This function errors iff:
- the offsets are not monotonically increasing
- The last offset is not equal to the field’ length
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::Map
- The fields’
data_type
is not equal to the inner field ofdata_type
- The validity is not
None
and its length is different fromoffsets.len() - 1
.
sourcepub fn new(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> MapArray
pub fn new(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> MapArray
Creates a new MapArray
.
Panics
- the offsets are not monotonically increasing
- The last offset is not equal to the field’ length.
- The
data_type
’s physical type is notcrate::datatypes::PhysicalType::Map
, - The validity is not
None
and its length is different fromoffsets.len() - 1
.
sourcepub fn from_data(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> MapArray
pub fn from_data(
data_type: DataType,
offsets: Buffer<i32>,
field: Arc<dyn Array + 'static>,
validity: Option<Bitmap>
) -> MapArray
Alias for new
Trait Implementations
sourceimpl Array for MapArray
impl Array for MapArray
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> IntoIterator for &'a MapArray
impl<'a> IntoIterator for &'a MapArray
type IntoIter = ZipValidity<'a, Box<dyn Array + 'static, Global>, MapValuesIter<'a>>
type IntoIter = ZipValidity<'a, Box<dyn Array + 'static, Global>, MapValuesIter<'a>>
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl !RefUnwindSafe for MapArray
impl Send for MapArray
impl Sync for MapArray
impl Unpin for MapArray
impl !UnwindSafe for MapArray
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<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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more