(
rows: &mut [Vec<Value>],
indices: &[usize],
column_index: &HashMap<String, usize>,
spec: &WindowFuncSpec,
write_col: usize,
)
| 396 | } |
| 397 | |
| 398 | fn apply_v_lag( |
| 399 | rows: &mut [Vec<Value>], |
| 400 | indices: &[usize], |
| 401 | column_index: &HashMap<String, usize>, |
| 402 | spec: &WindowFuncSpec, |
| 403 | write_col: usize, |
| 404 | ) -> Result<(), WindowError> { |
| 405 | let offset = usize_arg(spec, 1, 1); |
| 406 | let default = default_arg_value(spec, 2); |
| 407 | let values = collect_arg_values(rows, indices, column_index, spec); |
| 408 | for (pos, &i) in indices.iter().enumerate() { |
| 409 | let val = if pos >= offset { |
| 410 | values[pos - offset].clone() |
| 411 | } else { |
| 412 | default.clone() |
| 413 | }; |
| 414 | set_cell(rows, i, write_col, val); |
| 415 | } |
| 416 | Ok(()) |
| 417 | } |
| 418 | |
| 419 | fn apply_v_lead( |
| 420 | rows: &mut [Vec<Value>], |
no test coverage detected