Struct arrow_array::array::MapArray
source · 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 StructArray with 2 child fields.
Implementations§
source§impl 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.
This is a StructArray
containing two fields
Safety
Caller must ensure that the index is within the array bounds
sourcepub fn value(&self, i: usize) -> ArrayRef
pub fn value(&self, i: usize) -> ArrayRef
Returns ith value of this map array.
This is a StructArray
containing two fields
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§
source§impl Array for MapArray
impl Array for MapArray
source§fn 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.
source§fn 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.
source§fn data_ref(&self) -> &ArrayData
fn data_ref(&self) -> &ArrayData
Returns a reference-counted pointer to the underlying data of this array.
source§fn 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
source§fn 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 moresource§fn 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 moresource§fn 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 moresource§fn null_count(&self) -> usize
fn null_count(&self) -> usize
Returns the total number of null values in this array. Read more