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

Method from

arrow-array/src/array/struct_array.rs:413–436  ·  view source on GitHub ↗
(data: ArrayData)

Source from the content-addressed store, hash-verified

411
412impl From<ArrayData> for StructArray {
413 fn from(data: ArrayData) -> Self {
414 let (data_type, len, nulls, offset, _buffers, child_data) = data.into_parts();
415
416 let parent_offset = offset;
417 let parent_len = len;
418
419 let fields = child_data
420 .into_iter()
421 .map(|cd| {
422 if parent_offset != 0 || parent_len != cd.len() {
423 make_array(cd.slice(parent_offset, parent_len))
424 } else {
425 make_array(cd)
426 }
427 })
428 .collect();
429
430 Self {
431 len,
432 data_type,
433 nulls,
434 fields,
435 }
436 }
437}
438
439impl From<StructArray> for ArrayData {

Callers

nothing calls this directly

Calls 15

collectMethod · 0.80
child_dataMethod · 0.80
firstMethod · 0.80
make_arrayFunction · 0.70
into_partsMethod · 0.45
into_iterMethod · 0.45
lenMethod · 0.45
sliceMethod · 0.45
nullsMethod · 0.45
iterMethod · 0.45
to_dataMethod · 0.45
build_uncheckedMethod · 0.45

Tested by

no test coverage detected