goavro icon indicating copy to clipboard operation
goavro copied to clipboard

ocfwriter: allow writing blocks

Open tanner-bruce opened this issue 2 years ago • 0 comments

Exports an AppendBlock function which Append uses. Our use case is that we have a go routine that sends batches of []map[string]interface{} over a channel and a reader which then Appends it to a block. This forces us to compress and append smaller blocks for each batch we receive. This code change allows us to build up the block over time, by converting (using codec) on the fly, appending to a block, and compressing at the same time. We can then compress all data into a single data block.

In the worst case, calling Append many times was more than doubling, and almost tripling, the actual file sizes compared to calling Append a few times per file.

tanner-bruce avatar Aug 14 '23 14:08 tanner-bruce