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

Function read_single_column

nodedb/src/engine/timeseries/packed_partition.rs:498–517  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

496
497 #[test]
498 fn read_single_column() {
499 let tmp = TempDir::new().unwrap();
500 let path = tmp.path().join("test.ndpk");
501
502 let ts_data = vec![1u8, 2, 3, 4, 5];
503 let val_data = vec![10u8, 20, 30];
504 let columns = vec![
505 ("timestamp".to_string(), ts_data.clone()),
506 ("value".to_string(), val_data.clone()),
507 ];
508
509 write_packed(&path, &columns, None, &[], &test_meta(), None).unwrap();
510
511 let footer = read_footer(&path).unwrap();
512 let ts_bytes = read_column(&path, &footer, "timestamp", None).unwrap();
513 assert_eq!(ts_bytes, ts_data);
514
515 let val_bytes = read_column(&path, &footer, "value", None).unwrap();
516 assert_eq!(val_bytes, val_data);
517 }
518
519 #[test]
520 fn http_range_headers_for_projection() {

Callers

nothing calls this directly

Calls 6

write_packedFunction · 0.85
test_metaFunction · 0.85
read_footerFunction · 0.85
read_columnFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected