pub struct Array { /* private fields */ }Expand description
A column of values, in Arrow’s layout.
Implementations§
Source§impl Array
impl Array
Sourcepub fn of(vector: &Vector) -> Result<Self>
pub fn of(vector: &Vector) -> Result<Self>
The Arrow array a vector becomes.
The vector is flattened first, so a constant, a sequence and a dictionary all arrive here as the values they stand for. Arrow has a run end encoding and a dictionary array of its own and they are worth having later, but an export that sometimes hands back a dictionary is an export every reader has to have two paths for, and the reader is the one we are trying to make cheap.
§Errors
For a type with no Arrow counterpart, and for a vector whose values are not the layout its type says they are.
Sourcepub fn empty(data_type: DataType) -> Self
pub fn empty(data_type: DataType) -> Self
An array of this type with no values in it.
A variable width type still gets its offsets buffer, holding the single zero that says the first value would start at the beginning. Arrow’s rule is that offsets are one longer than the array, and an array of nothing is the case where forgetting it is easiest and where a reader that trusts the rule reads past the end.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
How many of them are null.
Sourcepub fn validity(&self) -> Option<&[u8]>
pub fn validity(&self) -> Option<&[u8]>
The validity bitmap, or nothing when nothing is null.
Nothing is what Arrow means by a null pointer in the first buffer slot, and it is the case
worth keeping rather than materializing: a reader that sees it can skip the per value check
for the whole array, which is the same reason Validity::AllValid exists on our side.