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

Method download_parquet

nodedb/src/storage/cold_query.rs:18–34  ·  view source on GitHub ↗

Download a Parquet file from cold storage for query.

(&self, object_path: &str)

Source from the content-addressed store, hash-verified

16impl ColdStorage {
17 /// Download a Parquet file from cold storage for query.
18 pub async fn download_parquet(&self, object_path: &str) -> crate::Result<Bytes> {
19 let path = object_store::path::Path::from(object_path.to_string());
20 let result = self
21 .store()
22 .get_opts(&path, object_store::GetOptions::default())
23 .await
24 .map_err(|e| crate::Error::ColdStorage {
25 detail: format!("download {object_path}: {e}"),
26 })?;
27 let bytes = result
28 .bytes()
29 .await
30 .map_err(|e| crate::Error::ColdStorage {
31 detail: format!("read bytes: {e}"),
32 })?;
33 Ok(bytes)
34 }
35
36 /// List Parquet files for a collection in cold storage.
37 pub async fn list_parquet_files(

Callers 2

projected_readFunction · 0.80

Calls 3

to_stringMethod · 0.80
storeMethod · 0.45
bytesMethod · 0.45

Tested by

no test coverage detected