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

Method consume_batch

parquet/src/arrow/array_reader/map_array.rs:96–109  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

94 }
95
96 fn consume_batch(&mut self) -> Result<ArrayRef> {
97 // A MapArray is just a ListArray with a StructArray child
98 // we can therefore just alter the ArrayData
99 let array = self.reader.consume_batch().unwrap();
100 let data = array.to_data();
101 let builder = data.into_builder().data_type(self.data_type.clone());
102
103 // SAFETY - we can assume that ListArrayReader produces valid ListArray
104 // of the expected type, and as such its output can be reinterpreted as
105 // a MapArray without validation
106 Ok(Arc::new(MapArray::from(unsafe {
107 builder.build_unchecked()
108 })))
109 }
110
111 fn skip_records(&mut self, num_records: usize) -> Result<usize> {
112 self.reader.skip_records(num_records)

Callers 2

next_innerMethod · 0.45
next_batchMethod · 0.45

Calls 5

to_dataMethod · 0.45
data_typeMethod · 0.45
into_builderMethod · 0.45
cloneMethod · 0.45
build_uncheckedMethod · 0.45

Tested by

no test coverage detected