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.
(
item_columns: &[ArrayRef],
target: &[ScalarValue],
compare_fn: F,
mut low: usize,
high: usize,
)
| 219 | /// `low` and ends at the index `high`. The boolean-valued function `compare_fn` |
| 220 | /// specifies the stopping criterion. |
| 221 | pub fn search_in_slice<F>( |
| 222 | item_columns: &[ArrayRef], |
| 223 | target: &[ScalarValue], |
| 224 | compare_fn: F, |
| 225 | mut low: usize, |
| 226 | high: usize, |
| 227 | ) -> Result<usize> |
| 228 | where |
| 229 | F: Fn(&[ScalarValue], &[ScalarValue]) -> Result<bool>, |
| 230 | { |
| 231 | while low < high { |
| 232 | let val = get_row_at_idx(item_columns, low)?; |
| 233 | if !compare_fn(&val, target)? { |
| 234 | break; |
| 235 | } |
| 236 | low += 1; |
| 237 | } |
| 238 | Ok(low) |
| 239 | } |
| 240 | |
| 241 | /// Given a list of 0 or more already sorted columns, finds the |
| 242 | /// partition ranges that would partition equally across columns. |
no test coverage detected
searching dependent graphs…