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

Function scan_block_level_skip

nodedb/src/engine/timeseries/columnar_bridge.rs:429–446  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427
428 #[test]
429 fn scan_block_level_skip() {
430 // Create a large segment with multiple blocks (>1024 rows).
431 let segment = write_test_segment(3000, 0);
432
433 // Query only the last block: ts in [2500, 2999].
434 let result = scan_shared_segment(&segment, 0, 1, 2500, 2999).expect("scan");
435
436 // Block 0 [0..1023] and block 1 [1024..2047] should be skipped.
437 // Block 2 [2048..2999] should be read.
438 // Skipped blocks produce null-filled rows (valid=false).
439 let valid_count = result.ts_valid.iter().filter(|&&v| v).count();
440 // Block 2 has 952 rows (3000-2048), all valid.
441 assert_eq!(valid_count, 952);
442
443 // Use filtered scan to get only the matching rows.
444 let (ts, _) = scan_shared_segment_filtered(&segment, 0, 1, 2500, 2999).expect("filtered");
445 assert_eq!(ts.len(), 500); // 2500..=2999 = 500 rows.
446 }
447
448 #[test]
449 fn read_arbitrary_column() {

Callers

nothing calls this directly

Calls 6

scan_shared_segmentFunction · 0.85
write_test_segmentFunction · 0.70
expectMethod · 0.45
countMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected