kszucs opened a new pull request, #1685: URL: https://github.com/apache/arrow-go/pull/1685
### Rationale for this change `PlainBooleanEncoder` reuses its bit buffer across flushes. When a page's values don't fill its last byte, the bits after the last value keep what an earlier page wrote there. Readers ignore those bits, but the same values can encode to different bytes depending on the page before. That breaks byte-identical pages, which content-defined chunking relies on to deduplicate: after an edit, an unchanged boolean page far from the edit can still get a different last byte. ### What changes are included in this PR? `FlushValues` clears the bits of the last byte after the last value. ### Are these changes tested? `TestBooleanPlainEncoderPadsWithZeros` flushes eight `true` values, then `true, false, true`, and expects `0x05` for the second flush. On main it gets `0xfd`, through both `Put` and `PutBitmap`; it passes with this change. `go vet`, `go test -race ./parquet/internal/encoding/` and `go test ./parquet/...` passed. golangci-lint wasn't run. ### Are there any user-facing changes? The padding bits of PLAIN boolean pages are zero. The decoded values don't change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
