jecsand838 commented on code in PR #8006: URL: https://github.com/apache/arrow-rs/pull/8006#discussion_r2234567831
########## arrow-avro/src/reader/mod.rs: ########## @@ -216,73 +440,227 @@ impl ReaderBuilder { /// - `batch_size` = 1024 /// - `strict_mode` = false /// - `utf8_view` = false - /// - `schema` = None + /// - `reader_schema` = None + /// - `writer_schema_store` = None + /// - `active_fp` = None + /// - `static_store_mode` = false pub fn new() -> Self { Self::default() } - fn make_record_decoder(&self, schema: &AvroSchema<'_>) -> Result<RecordDecoder, ArrowError> { - let root_field = AvroFieldBuilder::new(schema) - .with_utf8view(self.utf8_view) - .with_strict_mode(self.strict_mode) - .build()?; - RecordDecoder::try_new_with_options(root_field.data_type(), self.utf8_view) + /// Sets the maximum number of rows to include in each `RecordBatch`. + /// + /// Defaults to `1024`. + pub fn with_batch_size(mut self, n: usize) -> Self { + self.batch_size = n; + self } - fn build_impl<R: BufRead>(self, reader: &mut R) -> Result<(Header, Decoder), ArrowError> { Review Comment: These methods got deleted. I was able to confirm that only the `Reader` would ever expect a `Header` and was able to change `build` and `build_decoder` to this: ```rust /// Create a [`Reader`] from this builder and a `BufRead` pub fn build<R: BufRead>(self, mut reader: R) -> Result<Reader<R>, ArrowError> { self.validate()?; let header = read_header(&mut reader)?; let decoder = self.make_decoder(Some(&header))?; Ok(Reader { reader, header, decoder, block_decoder: BlockDecoder::default(), block_data: Vec::new(), block_cursor: 0, finished: false, }) } /// Create a [`Decoder`] from this builder. pub fn build_decoder(self) -> Result<Decoder, ArrowError> { self.validate()?; self.make_decoder(None) } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org