()
| 617 | |
| 618 | #[test] |
| 619 | fn approx_count_distinct_basic() { |
| 620 | let docs: Vec<Vec<u8>> = vec![ |
| 621 | encode(&json!({"region": "us"})), |
| 622 | encode(&json!({"region": "eu"})), |
| 623 | encode(&json!({"region": "us"})), |
| 624 | encode(&json!({"region": "ap"})), |
| 625 | ]; |
| 626 | let refs: Vec<&[u8]> = docs.iter().map(|d| d.as_slice()).collect(); |
| 627 | let result = compute_aggregate_binary("approx_count_distinct", "region", None, &refs); |
| 628 | // HLL may not be exactly 3 but should be close. |
| 629 | if let Value::Integer(n) = result { |
| 630 | assert!((2..=4).contains(&n), "expected ~3 distinct, got {n}"); |
| 631 | } else { |
| 632 | panic!("expected Integer, got {result:?}"); |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | #[test] |
| 637 | fn approx_percentile_basic() { |
nothing calls this directly
no test coverage detected