datafusion_common::utils

Function linear_search

Source
pub fn linear_search<const SIDE: bool>(
    item_columns: &[ArrayRef],
    target: &[ScalarValue],
    sort_options: &[SortOptions],
) -> Result<usize>
Expand description

This function searches for a tuple of given values (target) among the given rows (item_columns) via a linear scan. It assumes that item_columns is sorted according to sort_options and returns the insertion index of target. Template argument SIDE being true/false means left/right insertion.