(
rows: &mut [(String, serde_json::Value)],
indices: &[usize],
spec: &WindowFuncSpec,
)
| 38 | } |
| 39 | |
| 40 | pub(super) fn apply_lag( |
| 41 | rows: &mut [(String, serde_json::Value)], |
| 42 | indices: &[usize], |
| 43 | spec: &WindowFuncSpec, |
| 44 | ) { |
| 45 | let field = col_arg(spec, 0); |
| 46 | let offset = usize_arg(spec, 1, 1); |
| 47 | let default = default_arg(spec, 2); |
| 48 | |
| 49 | for (pos, &i) in indices.iter().enumerate() { |
| 50 | let val = if pos >= offset { |
| 51 | get_field(&rows[indices[pos - offset]].1, field) |
| 52 | } else { |
| 53 | default.clone() |
| 54 | }; |
| 55 | set_window_col(&mut rows[i].1, &spec.alias, val); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | pub(super) fn apply_lead( |
| 60 | rows: &mut [(String, serde_json::Value)], |
no test coverage detected