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

Function build_reader

datafusion/datasource-avro/src/source.rs:262–275  ·  view source on GitHub ↗
(
        name: &'_ str,
        projection: Option<Vec<usize>>,
    )

Source from the content-addressed store, hash-verified

260 use std::io::BufReader;
261
262 fn build_reader(
263 name: &'_ str,
264 projection: Option<Vec<usize>>,
265 ) -> Reader<BufReader<File>> {
266 let testdata = datafusion_common::test_util::arrow_test_data();
267 let filename = format!("{testdata}/avro/{name}");
268 let mut builder = ReaderBuilder::new().with_batch_size(64);
269 if let Some(proj) = projection {
270 builder = builder.with_projection(proj);
271 }
272 builder
273 .build(BufReader::new(File::open(filename).unwrap()))
274 .unwrap()
275 }
276
277 fn get_col<'a, T: 'static>(
278 batch: &'a RecordBatch,

Callers 3

test_avro_basicFunction · 0.85

Calls 5

arrow_test_dataFunction · 0.85
newFunction · 0.85
with_batch_sizeMethod · 0.45
with_projectionMethod · 0.45
buildMethod · 0.45

Tested by 3

test_avro_basicFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…