pub fn build_compare(
    left: &dyn Array,
    right: &dyn Array
) -> Result<DynComparator>
Expand description

returns a comparison function that compares two values at two different positions between the two arrays. The arrays’ types must be equal.

Example

use arrow::array::{build_compare, Int32Array};

let array1 = Int32Array::from(vec![1, 2]);
let array2 = Int32Array::from(vec![3, 4]);

let cmp = build_compare(&array1, &array2)?;

// 1 (index 0 of array1) is smaller than 4 (index 1 of array2)
assert_eq!(std::cmp::Ordering::Less, (cmp)(0, 1));