diff --git a/arrow-ord/src/sort.rs b/arrow-ord/src/sort.rs index e2ac52998db0..a46875844968 100644 --- a/arrow-ord/src/sort.rs +++ b/arrow-ord/src/sort.rs @@ -806,9 +806,10 @@ mod tests { mod build_arrays_helper { use crate::sort::tests::get_same_lists_length; use arrow_array::{ - ArrayRef, ArrowPrimitiveType, Decimal128Array, Decimal256Array, FixedSizeBinaryArray, - FixedSizeListArray, GenericBinaryArray, GenericListArray, LargeStringArray, - OffsetSizeTrait, PrimitiveArray, StringArray, StringViewArray, + ArrayRef, ArrowPrimitiveType, BinaryArray, Decimal128Array, Decimal256Array, + FixedSizeBinaryArray, FixedSizeListArray, GenericListArray, + LargeBinaryArray, LargeStringArray, OffsetSizeTrait, PrimitiveArray, StringArray, + StringViewArray, }; use arrow_buffer::i256; use std::sync::Arc; @@ -848,20 +849,14 @@ mod tests { } pub fn binary_arrays(data: Vec>>) -> Vec { - // Generic size binary array - fn generic_binary_array( - data: &[Option>], - ) -> Arc> { - Arc::new(GenericBinaryArray::::from_opt_vec( - data.iter() - .map(|binary| binary.as_ref().map(Vec::as_slice)) - .collect(), - )) - } + let binary_data = data + .iter() + .map(|binary| binary.as_ref().map(Vec::as_slice)) + .collect::>(); let mut arrays = vec![ - generic_binary_array::(&data) as ArrayRef, - generic_binary_array::(&data) as ArrayRef, + Arc::new(BinaryArray::from_opt_vec(binary_data.clone())) as ArrayRef, + Arc::new(LargeBinaryArray::from_opt_vec(binary_data)) as ArrayRef, ]; if let Some(first_length) = get_same_lists_length(&data) { @@ -883,7 +878,6 @@ mod tests { where OffsetSize: OffsetSizeTrait, T: ArrowPrimitiveType, - PrimitiveArray: From>>, { Arc::new(GenericListArray::::from_iter_primitive::(data.to_vec())) } @@ -894,7 +888,6 @@ mod tests { ) -> ArrayRef where T: ArrowPrimitiveType, - PrimitiveArray: From>>, { Arc::new(FixedSizeListArray::from_iter_primitive::( data.to_vec(), @@ -905,7 +898,6 @@ mod tests { pub fn primitive_list_arrays(data: Vec>>>) -> Vec where T: ArrowPrimitiveType, - PrimitiveArray: From>>, { let mut arrays = vec![ primitive_generic_list_array::(&data),