chenzihao5 commented on pull request #3740:
URL: https://github.com/apache/iceberg/pull/3740#issuecomment-994242115
> Thanks for this patch @chenzihao5!
>
> I checked (with a Scala shell but using `java.lang.Integer`) and using the
explicit float does indeed seem to prevent overflow.
>
> ```
> scala> import java.lang.{Integer => JInt}
> import java.lang.{Integer=>JInt}
>
> scala> JInt.MAX_VALUE
> res5: Int = 2147483647
>
> scala> JInt.MAX_VALUE * 1000
> res6: Int = -1000
>
> scala> JInt.MAX_VALUE * 1000L
> res7: Long = 2147483647000
> ```
>
> Could you add test cases somewhere for writing a value that would have
overflowed otherwise?
@kbendick Thanks for your review. I will add some unit tests.
--
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]