| 213 | |
| 214 | #[test] |
| 215 | fn mbr_numeric_attr_stats() { |
| 216 | let mut b = MbrBuilder::new(1, 1); |
| 217 | b.fold(&[CoordValue::Int64(0)], &[CellValue::Float64(1.5)]); |
| 218 | b.fold(&[CoordValue::Int64(1)], &[CellValue::Float64(3.5)]); |
| 219 | b.fold(&[CoordValue::Int64(2)], &[CellValue::Null]); |
| 220 | let m = b.build(); |
| 221 | match &m.attr_stats[0] { |
| 222 | AttrStats::Numeric { |
| 223 | min, |
| 224 | max, |
| 225 | null_count, |
| 226 | } => { |
| 227 | assert_eq!(*min, 1.5); |
| 228 | assert_eq!(*max, 3.5); |
| 229 | assert_eq!(*null_count, 1); |
| 230 | } |
| 231 | other => panic!("expected Numeric, got {other:?}"), |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | #[test] |
| 236 | fn mbr_all_null_attr() { |