dmitry-chirkov-dremio opened a new pull request, #49455:
URL: https://github.com/apache/arrow/pull/49455

   ### Rationale for this change
   GH-49454 castVARCHAR_timestamp_int64 produces negative milliseconds for 
pre-epoch timestamps
   
   ### What changes are included in this PR?
   Fixed `castVARCHAR_timestamp_int64` to correctly handle pre-epoch timestamps 
(before 1970-01-01). The issue was that using `in % MILLIS_IN_SEC` on negative 
timestamps produces negative milliseconds, resulting in output like 
`"0107-10-17 12:20:03.-10"`.
   
   ### Are these changes tested?
   Yes, added 4 new test cases covering pre-epoch timestamps with milliseconds
   
   ### Are there any user-facing changes?
   **This PR contains a "Critical Fix".**
   This fixes a bug that caused **incorrect data to be produced** when casting 
pre-epoch timestamps to VARCHAR in Gandiva. Previously, timestamps before 
1970-01-01 with non-zero milliseconds would produce invalid output with 
negative millisecond values (e.g., `"0107-10-17 12:20:03.-10"` instead of 
`"0107-10-17 12:20:03.900"`).


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

Reply via email to