jecsand838 commented on code in PR #9462:
URL: https://github.com/apache/arrow-rs/pull/9462#discussion_r2880635035
##########
arrow-avro/src/reader/async_reader/builder.rs:
##########
@@ -109,8 +109,18 @@ impl<R> ReaderBuilder<R> {
}
}
-impl<R: AsyncFileReader> ReaderBuilder<R> {
- async fn read_header(&mut self) -> Result<(Header, u64), AvroError> {
Review Comment:
@mzabaluev
I'm curious about what you think about these two potential alternatives?
1. Make `read_header(&mut self) -> Result<(Header, u64), AvroError>` public
and then adding a new `pub fn writer_schema(&self) -> Result<AvroSchema,
AvroError>` method to `Header` for callers to use? Granted we'd need to
publicly expose the `Header`, but we did eventually intend to do that.
2. Alternatively, keep `read_header(&mut self) -> Result<(Header, u64),
AvroError>` private, but add a new `pub fn writer_schema(&self) ->
Result<AvroSchema, AvroError>` to `ReaderBuilder` that reads the `Header` and
gets the writer `AvroSchema`.
Both alternatives would cache the (`Header`, `header_len`) on the
`ReaderBuilder` to prevent re-reading the `Header` multiple times.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]