GitHub user kiszk opened a pull request: https://github.com/apache/spark/pull/21481
[SPARK-24452][SQL][Core] Avoid possible overflow in int add or multiple ## What changes were proposed in this pull request? This PR fixes possible overflow in int add or multiply. The following assignments may cause overflow in right hand side. As a result, the result may be negative. ``` long = int * int long = int + int ``` To avoid this problem, this PR performs cast from int to long in right hand side. ## How was this patch tested? Existing UTs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kiszk/spark SPARK-24452 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/21481.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #21481 ---- commit 324fd5ccb73c8017f5537031db21b687ac1ca27a Author: Kazuaki Ishizaki <ishizaki@...> Date: 2018-06-01T20:22:34Z initial commit ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org