pub struct MapArray { /* private fields */ }
Expand description
A nested array type where each record is a key-value map. Keys should always be non-null, but values can be null.
MapArray is physically a crate::array::ListArray that has a crate::array::StructArray with 2 child fields.
Implementations
sourceimpl MapArray
impl MapArray
sourcepub fn value_type(&self) -> DataType
pub fn value_type(&self) -> DataType
Returns the data type of the map’s values.
sourcepub unsafe fn value_unchecked(&self, i: usize) -> ArrayRef
pub unsafe fn value_unchecked(&self, i: usize) -> ArrayRef
Returns ith value of this map array.
Safety
Caller must ensure that the index is within the array bounds
sourcepub fn value_offsets(&self) -> &[i32]
pub fn value_offsets(&self) -> &[i32]
Returns the offset values in the offsets buffer
sourcepub fn value_length(&self, i: usize) -> i32
pub fn value_length(&self, i: usize) -> i32
Returns the length for value at index i
.
Trait Implementations
sourceimpl Array for MapArray
impl Array for MapArray
sourcefn get_buffer_memory_size(&self) -> usize
fn get_buffer_memory_size(&self) -> usize
Returns the total number of bytes of memory occupied by the buffers owned by this MapArray.
sourcefn get_array_memory_size(&self) -> usize
fn get_array_memory_size(&self) -> usize
Returns the total number of bytes of memory occupied physically by this MapArray.
sourcefn data_ref(&self) -> &ArrayData
fn data_ref(&self) -> &ArrayData
Returns a reference-counted pointer to the underlying data of this array.
sourcefn slice(&self, offset: usize, length: usize) -> ArrayRef
fn slice(&self, offset: usize, length: usize) -> ArrayRef
Returns a zero-copy slice of this array with the indicated offset and length. Read more
sourcefn offset(&self) -> usize
fn offset(&self) -> usize
Returns the offset into the underlying data used by this array(-slice).
Note that the underlying data can be shared by many arrays.
This defaults to 0
. Read more
sourcefn is_null(&self, index: usize) -> bool
fn is_null(&self, index: usize) -> bool
Returns whether the element at index
is null.
When using this function on a slice, the index is relative to the slice. Read more
sourcefn is_valid(&self, index: usize) -> bool
fn is_valid(&self, index: usize) -> bool
Returns whether the element at index
is not null.
When using this function on a slice, the index is relative to the slice. Read more
sourcefn null_count(&self) -> usize
fn null_count(&self) -> usize
Returns the total number of null values in this array. Read more
sourcefn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>
fn to_raw(&self) -> Result<(*const FFI_ArrowArray, *const FFI_ArrowSchema)>
returns two pointers that represent this array in the C Data Interface (FFI)
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