Get the (start, stop, step) args for the range and generate_series function. If any of the arguments is NULL, returns None.
(
start_array: Option<&Int64Array>,
stop: Option<i64>,
step_array: Option<&Int64Array>,
idx: usize,
)
| 523 | /// Get the (start, stop, step) args for the range and generate_series function. |
| 524 | /// If any of the arguments is NULL, returns None. |
| 525 | fn retrieve_range_args( |
| 526 | start_array: Option<&Int64Array>, |
| 527 | stop: Option<i64>, |
| 528 | step_array: Option<&Int64Array>, |
| 529 | idx: usize, |
| 530 | ) -> Option<(i64, i64, i64)> { |
| 531 | // Default start value is 0 if not provided |
| 532 | let start = |
| 533 | start_array.map_or(Some(0), |arr| arr.is_valid(idx).then(|| arr.value(idx)))?; |
| 534 | let stop = stop?; |
| 535 | // Default step value is 1 if not provided |
| 536 | let step = |
| 537 | step_array.map_or(Some(1), |arr| arr.is_valid(idx).then(|| arr.value(idx)))?; |
| 538 | Some((start, stop, step)) |
| 539 | } |
| 540 | |
| 541 | /// Reserve space for `count` more elements, returning an error when the |
| 542 | /// allocation would overflow `Vec`'s capacity limit or the allocator |
no test coverage detected
searching dependent graphs…