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

Function read_float64_with_nulls

nodedb-columnar/src/reader/block_decode.rs:445–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

443
444 #[test]
445 fn read_float64_with_nulls() {
446 let segment = write_test_segment(100);
447 let reader = SegmentReader::open(&segment).expect("open");
448
449 let col = reader.read_column(2).expect("read score column");
450 // Score column uses AlpFastLanesLz4 → decoded as Float64.
451 let (values, valid) = match &col {
452 DecodedColumn::Float64 { values, valid } => (values.as_slice(), valid.as_slice()),
453 other => panic!("expected Float64, got {other:?}"),
454 };
455
456 // Float64 column: every 5th row is null (rows 0,5,10,...,95 = 20 nulls).
457 assert_eq!(valid.len(), 100);
458 let null_count = valid.iter().filter(|&&v| !v).count();
459 assert_eq!(null_count, 20);
460
461 // Row 1: score = 1 * 0.5 = 0.5
462 assert!(valid[1]);
463 assert!((values[1] - 0.5).abs() < 0.001);
464 }
465
466 #[test]
467 fn predicate_pushdown_skips_blocks() {

Callers

nothing calls this directly

Calls 7

write_test_segmentFunction · 0.70
openFunction · 0.50
expectMethod · 0.45
read_columnMethod · 0.45
as_sliceMethod · 0.45
countMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected