datafusion_common::utils

Function search_in_slice

Source
pub fn search_in_slice<F>(
    item_columns: &[ArrayRef],
    target: &[ScalarValue],
    compare_fn: F,
    low: usize,
    high: usize,
) -> Result<usize>
where F: Fn(&[ScalarValue], &[ScalarValue]) -> Result<bool>,
Expand description

This function searches for a tuple of given values (target) among a slice of the given rows (item_columns) via a linear scan. The slice starts at the index low and ends at the index high. The boolean-valued function compare_fn specifies the stopping criterion.