cloud-fan commented on a change in pull request #21599: [SPARK-26218][SQL] 
Overflow on arithmetic operations returns incorrect result
URL: https://github.com/apache/spark/pull/21599#discussion_r309204023
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/DataFrameRangeSuite.scala
 ##########
 @@ -113,11 +113,7 @@ class DataFrameRangeSuite extends QueryTest with 
SharedSQLContext with Eventuall
     val random = new Random(seed)
 
     def randomBound(): Long = {
-      val n = if (random.nextBoolean()) {
-        random.nextLong() % (Long.MaxValue / (100 * MAX_NUM_STEPS))
-      } else {
-        random.nextLong() / 2
-      }
+      val n = random.nextLong() % (Long.MaxValue / (100 * MAX_NUM_STEPS))
 
 Review comment:
   But this changes the distribution of the randomly generated long values, 
which may reduce the test coverage. Does it cause overflow in many tests, or 
just a few?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to