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

Method finish

arrow-array/src/builder/generic_bytes_builder.rs:201–212  ·  view source on GitHub ↗

Builds the [`GenericByteArray`] and reset this builder.

(&mut self)

Source from the content-addressed store, hash-verified

199
200 /// Builds the [`GenericByteArray`] and reset this builder.
201 pub fn finish(&mut self) -> GenericByteArray<T> {
202 let array_type = T::DATA_TYPE;
203 let array_builder = ArrayDataBuilder::new(array_type)
204 .len(self.len())
205 .add_buffer(std::mem::take(&mut self.offsets_builder).into())
206 .add_buffer(std::mem::take(&mut self.value_builder).into())
207 .nulls(self.null_buffer_builder.finish());
208
209 self.offsets_builder.push(self.next_offset());
210 let array_data = unsafe { array_builder.build_unchecked() };
211 GenericByteArray::from(array_data)
212 }
213
214 /// Builds the [`GenericByteArray`] without resetting the builder.
215 pub fn finish_cloned(&self) -> GenericByteArray<T> {

Calls 7

takeFunction · 0.85
add_bufferMethod · 0.80
nullsMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45
next_offsetMethod · 0.45
build_uncheckedMethod · 0.45