Commits


Peter Newcomb authored and GitHub committed 5fd6b44936a
GH-40630: [Go][Parquet] Enable writing of Parquet footer without closing file (#40654) ### Rationale for this change See #40630 ### What changes are included in this PR? 1. Added `FlushWithFooter` method to *file.Writer 2. To support `FlushWithFooter`, refactored `Close` in a way that changes the order of operations in two ways: a. closure of open row group writers is now done after using `defer` to ensure closure of the sink, instead of before b. wiping out of encryption keys is now done by the same deferred function, ensuring that it happens even upon error ### Are these changes tested? `file_writer_test.go` has been extended to cover `FlushWithFooter` in a manner equivalent to the existing coverage. ### Are there any user-facing changes? Only the addition of a new public method as described above. No breaking changes to any existing public interfaces, unless the two minor order-of-operation changes described above are somehow a problem. I'm not sure it's a critical fix, but one of the minor changes described above may reduce the likelihood that an attack could inject an error (e.g., an I/O error) to prevent an encryption key from being wiped from memory. * GitHub Issue: #40630 Authored-by: Peter Newcomb <peter.newcomb@walmart.com> Signed-off-by: Matt Topol <zotthewizard@gmail.com>