laserninja opened a new pull request, #18114: URL: https://github.com/apache/iceberg/pull/18114
Fixes #18113. A positioned binary buffer truncated with `Integer.MAX_VALUE` width currently throws because position plus width overflows before the limit is clamped. Clamp the width to the remaining bytes before adding the position. The returned buffer still shares storage with the input, and neither the input position nor limit is changed. Tests exercise the public transform, read-only and writable buffers, and shared storage. Validation on JDK 17: the three new cases failed before the fix; the truncation transform/projection tests and `TestBinaryUtil` passed afterward. API formatting and `revapi` checks passed. --- **AI Disclosure** - Model: GPT-6 - Platform/Tool: Codex - Human Oversight: unreviewed - Prompt Summary: Reproduce and fix binary truncation overflow, add regression tests, and create an issue and PR. -- 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]
