Skip to content

Commit 64e445b

Browse files
committed
logwarnning as soon as it enters the while loop
1 parent 55518ed commit 64e445b

File tree

1 file changed

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

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ abstract class RDD[T: ClassTag](
421421
// this shouldn't happen often because we use a big multiplier for the initial size
422422
var numIters = 0
423423
while (samples.length < num) {
424-
if (numIters > 0) {
425-
logWarning(s"Needed to re-sample due to insufficient sample size. Repeat #$numIters")
426-
}
424+
logWarning(s"Needed to re-sample due to insufficient sample size. Repeat #$numIters")
427425
samples = this.sample(withReplacement, fraction, rand.nextInt()).collect()
428426
numIters += 1
429427
}

0 commit comments

Comments
 (0)