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

Function mbr_categorical_attr_stats

nodedb-array/src/tile/mbr.rs:248–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246
247 #[test]
248 fn mbr_categorical_attr_stats() {
249 let mut b = MbrBuilder::new(1, 1);
250 b.fold(&[CoordValue::Int64(0)], &[CellValue::String("a".into())]);
251 b.fold(&[CoordValue::Int64(1)], &[CellValue::String("b".into())]);
252 b.fold(&[CoordValue::Int64(2)], &[CellValue::String("a".into())]);
253 let m = b.build();
254 match &m.attr_stats[0] {
255 AttrStats::Categorical {
256 distinct,
257 null_count,
258 } => {
259 assert_eq!(*distinct, 2);
260 assert_eq!(*null_count, 0);
261 }
262 other => panic!("expected Categorical, got {other:?}"),
263 }
264 }
265}

Callers

nothing calls this directly

Calls 2

foldMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected