(
rows: &mut [Vec<Value>],
indices: &[usize],
column_index: &HashMap<String, usize>,
spec: &WindowFuncSpec,
write_col: usize,
)
| 226 | } |
| 227 | |
| 228 | fn apply_v_rank( |
| 229 | rows: &mut [Vec<Value>], |
| 230 | indices: &[usize], |
| 231 | column_index: &HashMap<String, usize>, |
| 232 | spec: &WindowFuncSpec, |
| 233 | write_col: usize, |
| 234 | ) { |
| 235 | if indices.is_empty() { |
| 236 | return; |
| 237 | } |
| 238 | let mut current_rank = 1usize; |
| 239 | set_cell(rows, indices[0], write_col, Value::Integer(1)); |
| 240 | for pos in 1..indices.len() { |
| 241 | if !order_keys_equal_v( |
| 242 | rows, |
| 243 | indices[pos - 1], |
| 244 | indices[pos], |
| 245 | column_index, |
| 246 | &spec.order_by, |
| 247 | ) { |
| 248 | current_rank = pos + 1; |
| 249 | } |
| 250 | set_cell( |
| 251 | rows, |
| 252 | indices[pos], |
| 253 | write_col, |
| 254 | Value::Integer(current_rank as i64), |
| 255 | ); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | fn apply_v_dense_rank( |
| 260 | rows: &mut [Vec<Value>], |
no test coverage detected