charliec05 opened a new pull request, #17963:
URL: https://github.com/apache/iceberg/pull/17963

   ## Summary
   
   - reject negative seek positions in both single- and multi-buffer input 
streams
   - validate before resetting or advancing buffer state
   - add shared regression coverage that runs against both implementations
   
   ## Motivation
   
   The two `ByteBufferInputStream` implementations handled negative positions 
inconsistently. `MultiBufferInputStream` silently accepted `seek(-1)` and reset 
to the beginning, while `SingleBufferInputStream` failed later inside 
`ByteBuffer.position` after it had already reset its state.
   
   Both implementations now reject the invalid position before changing state, 
matching the behavior of Iceberg's other seekable streams.
   
   ## Testing
   
   - `./gradlew :iceberg-core:spotlessApply :iceberg-core:test`
   - `./gradlew :iceberg-core:spotlessCheck :iceberg-core:test --tests 
org.apache.iceberg.io.TestSingleBufferInputStream --tests 
org.apache.iceberg.io.TestMultiBufferInputStream`
   
   ---
   **AI Disclosure**
   - Model: GPT-5 (Codex)
   - Platform/Tool: OpenAI Codex
   - Human Oversight: fully reviewed
   - Prompt Summary: Used a detailed, repository-aware prompt to compare seek 
boundary behavior across implementations, reproduce inconsistent 
negative-position handling, require state preservation, review the minimal 
diff, and run both focused and complete Core tests.
   


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

Reply via email to