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

Method create_list_view_array

arrow-ipc/src/reader.rs:341–363  ·  view source on GitHub ↗
(
        &self,
        field_node: &FieldNode,
        data_type: &DataType,
        buffers: &[Buffer],
        child_array: ArrayRef,
    )

Source from the content-addressed store, hash-verified

339 }
340
341 fn create_list_view_array(
342 &self,
343 field_node: &FieldNode,
344 data_type: &DataType,
345 buffers: &[Buffer],
346 child_array: ArrayRef,
347 ) -> Result<ArrayRef, ArrowError> {
348 assert!(matches!(data_type, ListView(_) | LargeListView(_)));
349
350 let null_buffer = (field_node.null_count() > 0).then_some(buffers[0].clone());
351 let length = field_node.length() as usize;
352 let child_data = child_array.into_data();
353
354 self.create_array_from_builder(
355 ArrayData::builder(data_type.clone())
356 .len(length)
357 .add_buffer(buffers[1].clone()) // offsets
358 .add_buffer(buffers[2].clone()) // sizes
359 .add_child_data(child_data)
360 .null_bit_buffer(null_buffer)
361 .null_count(field_node.null_count() as usize),
362 )
363 }
364
365 fn create_struct_array(
366 &self,

Callers 1

create_arrayMethod · 0.80

Calls 9

add_child_dataMethod · 0.80
add_bufferMethod · 0.80
null_countMethod · 0.45
cloneMethod · 0.45
lengthMethod · 0.45
into_dataMethod · 0.45
null_bit_bufferMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected