()
| 113 | |
| 114 | #[test] |
| 115 | fn row_number_partitioned() { |
| 116 | let mut rows = make_rows(); |
| 117 | let spec = WindowFuncSpec { |
| 118 | alias: "rn".into(), |
| 119 | func_name: "row_number".into(), |
| 120 | args: vec![], |
| 121 | partition_by: vec![SqlExpr::Column("dept".into())], |
| 122 | order_by: vec![], |
| 123 | frame: WindowFrame::default(), |
| 124 | }; |
| 125 | evaluate_window_functions(&mut rows, &[spec]); |
| 126 | assert_eq!(rows[0].1["rn"], json!(1)); |
| 127 | assert_eq!(rows[2].1["rn"], json!(3)); |
| 128 | assert_eq!(rows[3].1["rn"], json!(1)); |
| 129 | assert_eq!(rows[4].1["rn"], json!(2)); |
| 130 | } |
| 131 | |
| 132 | #[test] |
| 133 | fn running_sum() { |
nothing calls this directly
no test coverage detected