| 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 { |