MCPcopy Create free account
hub / github.com/apache/datafusion / load_data

Function load_data

benchmarks/src/cancellation.rs:251–269  ·  view source on GitHub ↗
(
    store: Arc<dyn ObjectStore>,
    files_on_disk: &[PathBuf],
)

Source from the content-addressed store, hash-verified

249}
250
251async fn load_data(
252 store: Arc<dyn ObjectStore>,
253 files_on_disk: &[PathBuf],
254) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
255 for file in files_on_disk {
256 let bytes = std::fs::read(file)?;
257
258 let path = object_store::path::Path::from_iter([
259 "data",
260 file.file_name().unwrap().to_str().unwrap(),
261 ]);
262 let payload = object_store::PutPayload::from_bytes(bytes.into());
263 store
264 .put_opts(&path, payload, object_store::PutOptions::default())
265 .await?;
266 }
267
268 Ok(())
269}
270
271async fn generate_data(
272 data_dir: impl AsRef<Path>,

Callers 1

runMethod · 0.85

Calls 2

intoMethod · 0.45
put_optsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…