vegarsti commented on code in PR #9006:
URL: https://github.com/apache/arrow-rs/pull/9006#discussion_r2628504010
##########
arrow-ipc/src/reader.rs:
##########
@@ -322,6 +332,32 @@ impl RecordBatchDecoder<'_> {
self.create_array_from_builder(builder)
}
+ fn create_list_view_array(
+ &self,
+ field_node: &FieldNode,
+ data_type: &DataType,
+ buffers: &[Buffer],
+ child_array: ArrayRef,
+ ) -> Result<ArrayRef, ArrowError> {
+ let null_buffer = (field_node.null_count() >
0).then_some(buffers[0].clone());
+ let length = field_node.length() as usize;
+ let child_data = child_array.into_data();
+
+ let mut builder = match data_type {
+ ListView(_) | LargeListView(_) =>
ArrayData::builder(data_type.clone())
+ .len(length)
+ .add_buffer(buffers[1].clone()) // offsets
+ .add_buffer(buffers[2].clone()) // sizes
+ .add_child_data(child_data)
+ .null_bit_buffer(null_buffer),
+ _ => unreachable!("Cannot create listview array from {:?}",
data_type),
Review Comment:
Since this function can return an error, should this be an error instead of
unreachable?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]