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

Method null_bit_buffer

arrow-array/src/ffi.rs:557–565  ·  view source on GitHub ↗

returns the null bit buffer. Rust implementation uses a buffer that is not part of the array of buffers. The C Data interface's null buffer is part of the array of buffers.

(&self)

Source from the content-addressed store, hash-verified

555 /// Rust implementation uses a buffer that is not part of the array of buffers.
556 /// The C Data interface's null buffer is part of the array of buffers.
557 fn null_bit_buffer(&self) -> Option<Buffer> {
558 // similar to `self.buffer_len(0)`, but without `Result`.
559 // `ffi::ArrowArray` records array offset, we need to add it back to the
560 // buffer length to get the actual buffer length.
561 let length = self.array.len() + self.array.offset();
562 let buffer_len = bit_util::ceil(length, 8);
563
564 unsafe { create_buffer(self.owner.clone(), self.array, 0, buffer_len) }
565 }
566
567 fn dictionary(&self) -> Result<Option<ImportedArrowArray<'_>>> {
568 match (self.array.dictionary(), &self.data_type) {

Calls 5

create_bufferFunction · 0.70
ceilFunction · 0.50
lenMethod · 0.45
offsetMethod · 0.45
cloneMethod · 0.45