srowen commented on a change in pull request #20793: [WIP][SPARK-23643]
Shrinking the buffer in hashSeed up to size of the seed parameter
URL: https://github.com/apache/spark/pull/20793#discussion_r255303074
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala
##########
@@ -25,17 +25,17 @@ import org.apache.spark.sql.types.{IntegerType, LongType}
class RandomSuite extends SparkFunSuite with ExpressionEvalHelper {
test("random") {
- checkDoubleEvaluation(Rand(30), 0.31429268272540556 +- 0.001)
- checkDoubleEvaluation(Randn(30), -0.4798519469521663 +- 0.001)
+ checkDoubleEvaluation(Rand(30), 0.2762195585886885 +- 0.001)
Review comment:
You may need to double-check me, but this is just evaluating the result of a
call that generates a random number in [0,1) then right? then this test was
bogus to begin with. The only thing we should assert is that it is in [0,1).
The only argument I can see is that we want to assert that the result
doesn't change given the seed. I don't think we guarantee that though. But if
that were true we should assert the exact value with no spread.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]