chenhao-db opened a new pull request, #56313:
URL: https://github.com/apache/spark/pull/56313

   ### What changes were proposed in this pull request?
   
   Fixes the bug introduced by https://github.com/apache/spark/pull/55610. When 
`local` is a very large negative value, `Math.floorMod(local, unitMicros)` is 
also negative, and the subtraction can overflow to positive values. This 
produces a inconsistent result from the slow path.
   
   In most common cases, this optimization still takes effect. The performance 
loss is ignorable.
   
   ### Why are the changes needed?
   
   Fix incorrect result.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   New unit tests. It passes before https://github.com/apache/spark/pull/55610, 
or after this change. But it fails on the current master.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


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