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

   Fixes #18115.
   
   Parsing `1969-12-31T23:59:59.999999999` directly as a microsecond timestamp 
returns `0`, while conversion through a nanosecond timestamp returns `-1`. 
Compute microseconds from epoch seconds and the fractional second, and share 
that conversion across Instant, LocalDateTime, and OffsetDateTime.
   
   Checked arithmetic preserves the full long microsecond range, including 
cases where a negative second's fractional part brings the result back into 
range.
   
   Compatibility: pre-epoch inputs with a sub-microsecond remainder now floor 
one microsecond earlier than before, consistent with `nanosToMicros`. This can 
change a derived date at a boundary. Exact-microsecond inputs and stored 
microsecond values are unchanged. Existing literal-conversion tests that 
explicitly expected the old behavior are updated.
   
   Validation on JDK 17: the new regressions failed before the fix; the full 
API test suite, API formatting, and API `revapi` checks passed. Coverage 
includes public literal conversion, offset handling, positive/exact-unit 
controls, both long boundaries, and overflow rejection.
   
   ---
   **AI Disclosure**
   - Model: GPT-6
   - Platform/Tool: Codex
   - Human Oversight: unreviewed
   - Prompt Summary: Reproduce and fix inconsistent pre-epoch timestamp 
conversion, add boundary regressions, 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]

Reply via email to