(
rows: &mut [Vec<Value>],
indices: &[usize],
spec: &WindowFuncSpec,
write_col: usize,
)
| 288 | } |
| 289 | |
| 290 | fn apply_v_ntile( |
| 291 | rows: &mut [Vec<Value>], |
| 292 | indices: &[usize], |
| 293 | spec: &WindowFuncSpec, |
| 294 | write_col: usize, |
| 295 | ) -> Result<(), WindowError> { |
| 296 | let n = usize_arg(spec, 0, 1).max(1); |
| 297 | let total = indices.len(); |
| 298 | if total == 0 { |
| 299 | return Ok(()); |
| 300 | } |
| 301 | for (pos, &i) in indices.iter().enumerate() { |
| 302 | let bucket = (pos * n / total) + 1; |
| 303 | set_cell(rows, i, write_col, Value::Integer(bucket as i64)); |
| 304 | } |
| 305 | Ok(()) |
| 306 | } |
| 307 | |
| 308 | fn apply_v_percent_rank( |
| 309 | rows: &mut [Vec<Value>], |
no test coverage detected