hcrosse opened a new pull request, #1728:
URL: https://github.com/apache/arrow-go/pull/1728

   ### Rationale for this change
   
   Closes #1727
   
   The Arrow Parquet writer only reports `RowGroupTotalBytesWritten` and 
`RowGroupTotalCompressedBytes`, which count pages after they are flushed and 
compressed. Callers that rotate buffered row groups on a memory budget cannot 
see data that is still held in column encoders, active dictionaries, level 
buffers, or in-memory page buffers.
   
   ### What changes are included in this PR?
   
   - Add `BufferedStats` and an optional `BufferedStatsProvider` interface in 
`parquet/file` without changing any existing v18 writer interfaces.
   - Implement `EstimatedBufferedStats` and `EstimatedBufferedBytes` on column 
and row group writers to report unflushed encoder bytes and total buffered 
bytes in memory, without double counting across dictionary fallback or serial 
page flushes.
   - Add `RowGroupEstimatedBufferedStats` and `RowGroupEstimatedBufferedBytes` 
on the Parquet and Arrow file writers, and update the writer documentation to 
distinguish buffered and flushed byte counts.
   - Return zero from `EstimatedBufferedValueBytes` on empty or closed writers 
instead of panicking or reporting non-zero sizes, make buffer length queries 
read-only and nil-safe, guard uninitialized plain boolean encoders, and include 
pending values in size estimates for delta encoders.
   
   ### Are these changes tested?
   
   Yes. I added unit tests covering untouched and closed writers, plain and 
dictionary encoding with and without compression, dictionary fallback before 
and after page flushes, V1 and V2 levels, and small batches with delta 
encoding. The tests also cover serial column transitions, flushing with a 
footer, all-null batches, sink write errors, Arrow dictionary arrays, and 
rotating buffered row groups on a byte threshold under checked allocators.
   
   ### Are there any user-facing changes?
   
   Yes. New additive types and methods are exported in `parquet/file` and 
`parquet/pqarrow`, with no breaking changes to existing interfaces.
   


-- 
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]

Reply via email to