RDD Action Functions
reduce(func)
sc.parallelize(Seq(1,2,3,4,5)).reduce(_*_)
/*
res62: Int = 120
*/collect()
sc.parallelize(Seq(1,2,3,4,5,5,6,5,5,4,3)).repartition(3)
.collect
.foreach(println)count()
sc.parallelize(Seq(1,2,3,4,5,5,6,5,5,4,3))
.repartition(3)
.countfirst()
take(n)
takeSample(withReplacement, num, [seed])
takeOrdered(n, [ordering])
saveAsTextFile(path)
saveAsSequenceFile(path)
saveAsObjectFile(path)
countByKey()
foreach(func)
Last updated