(
rows: &mut [Vec<Value>],
indices: &[usize],
column_index: &HashMap<String, usize>,
spec: &WindowFuncSpec,
write_col: usize,
)
| 257 | } |
| 258 | |
| 259 | fn apply_v_dense_rank( |
| 260 | rows: &mut [Vec<Value>], |
| 261 | indices: &[usize], |
| 262 | column_index: &HashMap<String, usize>, |
| 263 | spec: &WindowFuncSpec, |
| 264 | write_col: usize, |
| 265 | ) { |
| 266 | if indices.is_empty() { |
| 267 | return; |
| 268 | } |
| 269 | let mut current_rank = 1usize; |
| 270 | set_cell(rows, indices[0], write_col, Value::Integer(1)); |
| 271 | for pos in 1..indices.len() { |
| 272 | if !order_keys_equal_v( |
| 273 | rows, |
| 274 | indices[pos - 1], |
| 275 | indices[pos], |
| 276 | column_index, |
| 277 | &spec.order_by, |
| 278 | ) { |
| 279 | current_rank += 1; |
| 280 | } |
| 281 | set_cell( |
| 282 | rows, |
| 283 | indices[pos], |
| 284 | write_col, |
| 285 | Value::Integer(current_rank as i64), |
| 286 | ); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | fn apply_v_ntile( |
| 291 | rows: &mut [Vec<Value>], |
no test coverage detected