diff --git a/arrow-arith/src/arithmetic.rs b/arrow-arith/src/arithmetic.rs index 9d6ab5379bcc..755b9df212fc 100644 --- a/arrow-arith/src/arithmetic.rs +++ b/arrow-arith/src/arithmetic.rs @@ -103,13 +103,13 @@ fn math_checked_divide_op_on_iters( left: impl Iterator>, right: impl Iterator>, op: F, - nulls: Option, + nulls: Option, ) -> Result, ArrowError> where T: ArrowNumericType, F: Fn(T::Native, T::Native) -> Result, { - let buffer = if null_bit_buffer.is_some() { + let buffer = if nulls.is_some() { let values = left.zip(right).map(|(left, right)| { if let (Some(l), Some(r)) = (left, right) { op(l, r) @@ -272,17 +272,16 @@ where } // Create the combined `Bitmap` - let nulls = NullBuffer::union(left.nulls(), right.nulls()); + let nulls = arrow_buffer::NullBuffer::union(left.nulls(), right.nulls()); let lanes = T::lanes(); let buffer_size = left.len() * std::mem::size_of::(); let mut result = arrow_buffer::MutableBuffer::new(buffer_size).with_bitset(buffer_size, false); - match &null_bit_buffer { + match &nulls { Some(b) => { - // combine_option_bitmap returns a slice or new buffer starting at 0 - let valid_chunks = b.bit_chunks(0, left.len()); + let valid_chunks = b.inner().bit_chunks(); // process data in chunks of 64 elements since we also get 64 bits of validity information at a time @@ -602,7 +601,7 @@ where ))); } - let nulls = NullBuffer::union(left.nulls(), right.nulls()); + let nulls = arrow_buffer::NullBuffer::union(left.nulls(), right.nulls()); // Safety justification: Since the inputs are valid Arrow arrays, all values are // valid indexes into the dictionary (which is verified during construction) diff --git a/arrow-arith/src/boolean.rs b/arrow-arith/src/boolean.rs index a73987323eb7..eaef1378258b 100644 --- a/arrow-arith/src/boolean.rs +++ b/arrow-arith/src/boolean.rs @@ -335,7 +335,7 @@ pub fn is_null(input: &dyn Array) -> Result { pub fn is_not_null(input: &dyn Array) -> Result { let len = input.len(); - let output = match input.data_ref().nulls() { + let output = match input.nulls() { None => { let len_bytes = ceil(len, 8); MutableBuffer::new(len_bytes) diff --git a/arrow-array/src/array/dictionary_array.rs b/arrow-array/src/array/dictionary_array.rs index ee58a485c71c..ef8e695784b4 100644 --- a/arrow-array/src/array/dictionary_array.rs +++ b/arrow-array/src/array/dictionary_array.rs @@ -294,7 +294,7 @@ impl DictionaryArray { /// Returns a clone of the value type of this list. pub fn value_type(&self) -> DataType { - self.values.data_ref().data_type().clone() + self.values.data_type().clone() } /// The length of the dictionary is the length of the keys array. diff --git a/arrow-array/src/array/fixed_size_binary_array.rs b/arrow-array/src/array/fixed_size_binary_array.rs index 062961a20abb..af51ff787722 100644 --- a/arrow-array/src/array/fixed_size_binary_array.rs +++ b/arrow-array/src/array/fixed_size_binary_array.rs @@ -425,7 +425,7 @@ impl From for FixedSizeBinaryArray { .len(v.len()) .offset(v.offset()) .add_buffer(child_data.buffers()[0].slice(child_data.offset())) - .nulls(v.data_ref().nulls().cloned()); + .nulls(v.nulls().cloned()); let data = unsafe { builder.build_unchecked() }; Self::from(data) diff --git a/arrow-array/src/array/fixed_size_list_array.rs b/arrow-array/src/array/fixed_size_list_array.rs index 7d65927cdeec..0910e2944f76 100644 --- a/arrow-array/src/array/fixed_size_list_array.rs +++ b/arrow-array/src/array/fixed_size_list_array.rs @@ -76,7 +76,7 @@ impl FixedSizeListArray { /// Returns a clone of the value type of this list. pub fn value_type(&self) -> DataType { - self.values.data_ref().data_type().clone() + self.values.data_type().clone() } /// Returns ith value of this list array. diff --git a/arrow-array/src/array/list_array.rs b/arrow-array/src/array/list_array.rs index dca256008db2..c7e2a817ba33 100644 --- a/arrow-array/src/array/list_array.rs +++ b/arrow-array/src/array/list_array.rs @@ -85,7 +85,7 @@ impl GenericListArray { /// Returns a clone of the value type of this list. pub fn value_type(&self) -> DataType { - self.values.data_ref().data_type().clone() + self.values.data_type().clone() } /// Returns ith value of this list array. diff --git a/arrow-array/src/array/null_array.rs b/arrow-array/src/array/null_array.rs index fba6e41e871d..3d65e9e9ebad 100644 --- a/arrow-array/src/array/null_array.rs +++ b/arrow-array/src/array/null_array.rs @@ -97,7 +97,7 @@ impl Array for NullArray { /// Returns the total number of null values in this array. /// The null count of a `NullArray` always equals its length. fn null_count(&self) -> usize { - self.data_ref().len() + self.len() } }