()
| 194 | |
| 195 | #[test] |
| 196 | fn cume_dist_distinct_keys() { |
| 197 | let mut rows = numbered(5); |
| 198 | let spec = WindowFuncSpec { |
| 199 | alias: "cd".into(), |
| 200 | func_name: "cume_dist".into(), |
| 201 | args: vec![], |
| 202 | partition_by: vec![], |
| 203 | order_by: vec![(SqlExpr::Column("n".into()), true)], |
| 204 | frame: WindowFrame::default(), |
| 205 | }; |
| 206 | evaluate_window_functions(&mut rows, &[spec]); |
| 207 | assert_eq!(rows[0].1["cd"], json!(0.2)); |
| 208 | assert_eq!(rows[1].1["cd"], json!(0.4)); |
| 209 | assert_eq!(rows[2].1["cd"], json!(0.6)); |
| 210 | assert_eq!(rows[3].1["cd"], json!(0.8)); |
| 211 | assert_eq!(rows[4].1["cd"], json!(1.0)); |
| 212 | } |
| 213 | |
| 214 | #[test] |
| 215 | fn cume_dist_with_peers() { |
nothing calls this directly
no test coverage detected