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

Method consume_batch

parquet/src/arrow/array_reader/list_view_array.rs:71–91  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

69 }
70
71 fn consume_batch(&mut self) -> Result<ArrayRef> {
72 let array = self.inner.consume_batch()?;
73 if array.is_empty() {
74 return Ok(new_empty_array(&self.data_type));
75 }
76
77 // Convert ListArray to ListViewArray
78 let list_array = array.as_list::<OffsetSize>();
79
80 let list_view_array =
81 Arc::new(GenericListViewArray::<OffsetSize>::from(list_array.clone()));
82
83 // Ensure the data type is correct
84 assert_eq!(
85 list_view_array.data_type(),
86 &self.data_type,
87 "Converted array type does not match expected type"
88 );
89
90 Ok(list_view_array)
91 }
92
93 fn skip_records(&mut self, num_records: usize) -> Result<usize> {
94 self.inner.skip_records(num_records)

Callers

nothing calls this directly

Calls 3

new_empty_arrayFunction · 0.85
is_emptyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected