MCPcopy Create free account
hub / github.com/apache/arrow-rs / build

Method build

arrow-avro/src/reader/mod.rs:1289–1302  ·  view source on GitHub ↗

Build a `Reader` (OCF) from this builder and a `BufRead`. This reads and validates the OCF header, initializes an internal row decoder from the discovered writer (and optional reader) schema, and prepares to iterate blocks, decompressing if necessary.

(self, mut reader: R)

Source from the content-addressed store, hash-verified

1287 /// the discovered writer (and optional reader) schema, and prepares to iterate blocks,
1288 /// decompressing if necessary.
1289 pub fn build<R: BufRead>(self, mut reader: R) -> Result<Reader<R>, ArrowError> {
1290 let (header, _) = read_header(&mut reader)?;
1291 let decoder = self.make_decoder(Some(&header), self.reader_schema.as_ref())?;
1292 Ok(Reader {
1293 reader,
1294 header,
1295 decoder,
1296 block_decoder: BlockDecoder::default(),
1297 block_data: Vec::new(),
1298 block_count: 0,
1299 block_cursor: 0,
1300 finished: false,
1301 })
1302 }
1303
1304 /// Build a streaming `Decoder` from this builder.
1305 ///

Calls 4

defaultFunction · 0.85
read_headerFunction · 0.70
make_decoderMethod · 0.45
as_refMethod · 0.45