Skip to content

Commit afe9396

Browse files
committed
fixed condition
1 parent c82b4f9 commit afe9396

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/scala/org/apache/spark/rdd

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/rdd/RDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ abstract class RDD[T: ClassTag](
475475
seed: Long = Utils.random.nextLong): Array[T] = withScope {
476476
val numStDev = 10.0
477477

478-
require(num > 0, "Negative number of elements requested")
478+
require(num >= 0, "Negative number of elements requested")
479479
require(num <= (Int.MaxValue - (numStDev * math.sqrt(Int.MaxValue)).toInt),
480480
"Cannot support a sample size > Int.MaxValue - " +
481481
s"$numStDev * math.sqrt(Int.MaxValue)")

0 commit comments

Comments
 (0)