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

Method slice

arrow-array/src/array/list_array.rs:392–399  ·  view source on GitHub ↗

Returns a zero-copy slice of this array with the indicated offset and length. Notes: this method does *NOT* slice the underlying values array or modify the values in the offsets buffer. See [`Self::values`] and [`Self::offsets`] for more information.

(&self, offset: usize, length: usize)

Source from the content-addressed store, hash-verified

390 /// the values in the offsets buffer. See [`Self::values`] and
391 /// [`Self::offsets`] for more information.
392 pub fn slice(&self, offset: usize, length: usize) -> Self {
393 Self {
394 data_type: self.data_type.clone(),
395 nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)),
396 values: self.values.clone(),
397 value_offsets: self.value_offsets.slice(offset, length),
398 }
399 }
400
401 /// Creates a [`GenericListArray`] from an iterator of primitive values
402 /// # Example

Callers 6

value_uncheckedMethod · 0.45
valueMethod · 0.45
test_list_array_sliceFunction · 0.45

Calls 2

cloneMethod · 0.45
as_refMethod · 0.45

Tested by 4

test_list_array_sliceFunction · 0.36