Skip to main content

offset_span_len

Function offset_span_len 

Source
pub fn offset_span_len<O: ArrowNativeType>(offsets: &OffsetBuffer<O>) -> usize
Expand description

Returns the number of values covered by an offset buffer.

Slicing a variable-length array narrows its offsets but retains its entire values buffer. Use this span to size output buffers: it counts child elements for lists and bytes for strings/binary arrays, including values in null rows. An empty array still has one offset and therefore a span of zero.