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 entries(&self) -> &ArrayRef
pub fn entries(&self) -> &ArrayRef
Returns a reference to the StructArray
entries of this map
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(&self) -> &ArrayData
fn data(&self) -> &ArrayData
source§fn slice(&self, offset: usize, length: usize) -> ArrayRef
fn slice(&self, offset: usize, length: usize) -> ArrayRef
source§fn nulls(&self) -> Option<&NullBuffer>
fn nulls(&self) -> Option<&NullBuffer>
source§fn data_ref(&self) -> &ArrayData
fn data_ref(&self) -> &ArrayData
source§fn offset(&self) -> usize
fn offset(&self) -> usize
0
. Read moresource§fn is_null(&self, index: usize) -> bool
fn is_null(&self, index: usize) -> bool
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
index
is not null.
When using this function on a slice, the index is relative to the slice. Read more