1
for(i <- 1 to 20) {
    val tmp = rdd.sample(true, 1)
    val rdd2 = resampledData(tmp)
    }

I would like to combine every rdd2 in the loop in single rdd. The type of rdd2 is RDD[(String, Double, Double)] and how can I initialize the new vriable if required?

1 Answers1

0

val combined = (1 to 20).map(x => resampledData(rdd.sample(true, 1))).reduce(_ union _)