MCPcopy Create free account
hub / github.com/apache/arrow-rs / lengths

Method lengths

arrow-array/src/array/byte_view_array.rs:457–459  ·  view source on GitHub ↗

Return an iterator over the length of each array element, including null values. Null values length would equal to the underlying bytes length and NOT 0 Example of getting 0 for null values ```rust # use arrow_array::StringViewArray; # use arrow_array::Array; use arrow_data::ByteView; fn lengths_with_zero_for_nulls(view: &StringViewArray) -> impl Iterator { view.lengths() .enumerate

(&self)

Source from the content-addressed store, hash-verified

455 /// }
456 /// ```
457 pub fn lengths(&self) -> impl ExactSizeIterator<Item = u32> + Clone {
458 self.views().iter().map(|v| *v as u32)
459 }
460
461 /// Returns a zero-copy slice of this array with the indicated offset and length.
462 pub fn slice(&self, offset: usize, length: usize) -> Self {

Calls 2

viewsMethod · 0.80
iterMethod · 0.45