()
| 489 | |
| 490 | #[test] |
| 491 | fn count_distinct() { |
| 492 | let d1 = encode(&json!({"v": "a"})); |
| 493 | let d2 = encode(&json!({"v": "b"})); |
| 494 | let d3 = encode(&json!({"v": "a"})); |
| 495 | let docs: Vec<&[u8]> = vec![&d1, &d2, &d3]; |
| 496 | assert_eq!( |
| 497 | compute_aggregate_binary("count_distinct", "v", None, &docs), |
| 498 | Value::Integer(2) |
| 499 | ); |
| 500 | } |
| 501 | |
| 502 | #[test] |
| 503 | fn string_agg() { |