fallintoplace opened a new pull request, #17423: URL: https://github.com/apache/iceberg/pull/17423
### What changes are included? - Keep destination `ByteBuffer`s in write mode after `SingleBufferInputStream.read(ByteBuffer)`. - Return `-1` at EOF while preserving `0` for destinations without remaining space. - Add shared coverage that verifies the same behavior for single-buffer and multi-buffer streams. ### Why is this change necessary? `ByteBufferInputStream.wrap` selects its implementation based on the number of source buffers. The single-buffer implementation flipped the destination after writing, while the multi-buffer implementation advanced its position normally. As a result, the destination state and EOF result depended on how the source was internally split. ### Testing - `./gradlew :iceberg-core:test --tests org.apache.iceberg.io.TestSingleBufferInputStream --tests org.apache.iceberg.io.TestMultiBufferInputStream` - `./gradlew :iceberg-core:spotlessCheck :iceberg-core:checkstyleMain :iceberg-core:checkstyleTest` --- **AI Disclosure** - Model: OpenAI language model - Platform/Tool: OpenAI desktop app - Human Oversight: fully reviewed - Prompt Summary: Investigated inconsistent `ByteBufferInputStream` behavior, implemented a focused fix, and added regression coverage. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
