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

Function projected_read

nodedb/src/storage/cold.rs:439–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

437
438 #[tokio::test]
439 async fn projected_read() {
440 let dir = tempfile::tempdir().unwrap();
441 let config = ColdStorageConfig {
442 local_dir: Some(dir.path().to_path_buf()),
443 ..Default::default()
444 };
445 let cold = ColdStorage::new(config).unwrap();
446
447 let rows = vec![(
448 "d1".into(),
449 serde_json::json!({"name": "alice", "score": 95.5, "rank": 1}),
450 )];
451 let path = cold
452 .encode_and_upload("results", 1, &rows, 1, 1)
453 .await
454 .unwrap();
455
456 let bytes = cold.download_parquet(&path).await.unwrap();
457 let batches = read_parquet_with_predicate(&bytes, &["name".into()]).unwrap();
458 assert_eq!(batches[0].num_columns(), 1); // Only "name" projected.
459 }
460
461 // ── SSE configuration path tests ──────────────────────────────────────
462

Callers

nothing calls this directly

Calls 4

encode_and_uploadMethod · 0.80
download_parquetMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected