(
rows: &mut [Vec<Value>],
indices: &[usize],
column_index: &HashMap<String, usize>,
spec: &WindowFuncSpec,
write_col: usize,
)
| 417 | } |
| 418 | |
| 419 | fn apply_v_lead( |
| 420 | rows: &mut [Vec<Value>], |
| 421 | indices: &[usize], |
| 422 | column_index: &HashMap<String, usize>, |
| 423 | spec: &WindowFuncSpec, |
| 424 | write_col: usize, |
| 425 | ) -> Result<(), WindowError> { |
| 426 | let offset = usize_arg(spec, 1, 1); |
| 427 | let default = default_arg_value(spec, 2); |
| 428 | let values = collect_arg_values(rows, indices, column_index, spec); |
| 429 | for (pos, &i) in indices.iter().enumerate() { |
| 430 | let val = if pos + offset < indices.len() { |
| 431 | values[pos + offset].clone() |
| 432 | } else { |
| 433 | default.clone() |
| 434 | }; |
| 435 | set_cell(rows, i, write_col, val); |
| 436 | } |
| 437 | Ok(()) |
| 438 | } |
| 439 | |
| 440 | fn apply_v_nth_value( |
| 441 | rows: &mut [Vec<Value>], |
no test coverage detected