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

Function make_chunked_store

datafusion/datasource-json/src/mod.rs:49–60  ·  view source on GitHub ↗

Seed a fresh `InMemory` store with `data` and wrap it in a [`ChunkedStore`] that splits every GET response into `chunk_size`-byte pieces.

(
        data: &[u8],
        chunk_size: usize,
    )

Source from the content-addressed store, hash-verified

47 /// [`ChunkedStore`] that splits every GET response into `chunk_size`-byte
48 /// pieces.
49 pub async fn make_chunked_store(
50 data: &[u8],
51 chunk_size: usize,
52 ) -> (Arc<dyn ObjectStore>, Path) {
53 let inner = Arc::new(InMemory::new());
54 let path = Path::from("test");
55 inner
56 .put(&path, PutPayload::from(Bytes::copy_from_slice(data)))
57 .await
58 .unwrap();
59 (Arc::new(ChunkedStore::new(inner, chunk_size)), path)
60 }
61}

Calls 2

newFunction · 0.85
putMethod · 0.45

Tested by 15

test_start_mid_lineFunction · 0.68
test_end_at_eofFunction · 0.68
test_no_newline_in_rangeFunction · 0.68
test_empty_rangeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…