Kriskras99 commented on PR #326:
URL: https://github.com/apache/avro-rs/pull/326#issuecomment-3460458562
I think this can be useful to have. However I don't entirely agree with the
design.
I think the `AvroSerializedBuffer` should have it's own append function.
It's also relatively easily now to create a buffer with one schema and use it
for another. It would also need functions for appending `Value`s
Maybe more something like this?:
```rust
pub struct AvroSerializedBuffer<'a> {
schema: &'a Schema,
// We don't want this to be a reference to the writer, as that would
block any writing,
// But cloning this can be expensive (there's a Vec inside)
resolved_schema: ResolvedSchema<'a>,
codec: Codec
num_values: usize,
// We want to do compression in the buffer not in the writer, but want
to do it as late as possible
// for maximum compression. So we need to track what we already have
compressed.
compressed_up_to: usize,
}
```
Then we can compare the schema, resolved schema and codec when adding it
back to the writer.
@martin-g what do you think?
--
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]