Copy from RDD to HDFS

How to copy the results from RDD to HDFS

You use the saveAsTextFile action along with the HDFS path to save the RDD into HDFS. There are also other actions such as saveAsObjectFile and saveAsSequenceFile. http://spark.apache.org/docs/latest/programming-guide.html#actions