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

Method into_parts

arrow-array/src/array/union_array.rs:382–406  ·  view source on GitHub ↗
(
        self,
    )

Source from the content-addressed store, hash-verified

380 /// ```
381 #[allow(clippy::type_complexity)]
382 pub fn into_parts(
383 self,
384 ) -> (
385 UnionFields,
386 ScalarBuffer<i8>,
387 Option<ScalarBuffer<i32>>,
388 Vec<ArrayRef>,
389 ) {
390 let Self {
391 data_type,
392 type_ids,
393 offsets,
394 mut fields,
395 } = self;
396 match data_type {
397 DataType::Union(union_fields, _) => {
398 let children = union_fields
399 .iter()
400 .map(|(type_id, _)| fields[type_id as usize].take().unwrap())
401 .collect();
402 (union_fields, type_ids, offsets, children)
403 }
404 _ => unreachable!(),
405 }
406 }
407
408 /// Computes the logical nulls for a sparse union, optimized for when there's a lot of fields without nulls
409 fn mask_sparse_skip_without_nulls(&self, nulls: Vec<(i8, NullBuffer)>) -> BooleanBuffer {

Callers 3

fromMethod · 0.45
into_partsFunction · 0.45

Calls 3

collectMethod · 0.80
iterMethod · 0.45
takeMethod · 0.45

Tested by 2

into_partsFunction · 0.36