dwsmith1983 commented on PR #60056:
URL: https://github.com/apache/spark/pull/60056#issuecomment-7062949528

   Thanks @MaxGekk, good catch. This PR caused it: the old Double path turned 
these values into Infinity and overflowed right away.
   
   I added the digit check before `toBigInteger`, with two small changes. It's 
computed in `Long`, because `precision - scale` overflows `Int` for 
`1E2147483647` itself. It also skips zero, since `0E+100` would otherwise count 
as 101 digits. `roundToLong` now uses the same helper, so all four methods 
raise `CAST_OVERFLOW` through `overflowError`. There are tests for the 
`1E2147483647` and zero cases.
   


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