MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / row_number_partitioned

Function row_number_partitioned

nodedb-query/src/window/eval.rs:115–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

make_rowsFunction · 0.85

Tested by

no test coverage detected