We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c82b4f9 commit afe9396Copy full SHA for afe9396
core/src/main/scala/org/apache/spark/rdd/RDD.scala
@@ -475,7 +475,7 @@ abstract class RDD[T: ClassTag](
475
seed: Long = Utils.random.nextLong): Array[T] = withScope {
476
val numStDev = 10.0
477
478
- require(num > 0, "Negative number of elements requested")
+ require(num >= 0, "Negative number of elements requested")
479
require(num <= (Int.MaxValue - (numStDev * math.sqrt(Int.MaxValue)).toInt),
480
"Cannot support a sample size > Int.MaxValue - " +
481
s"$numStDev * math.sqrt(Int.MaxValue)")
0 commit comments