I'm using saveAsTextFile(path) in order to save output as text file in later to import the result to DB. The output looks something like this:
saveAsTextFile(path)
(value1, value2)
How to remove the parentheses?
You can try the following which is very basic:
rdd.map(x => x._1 + "," + x._2).saveAsTextFile(path)
You just map your RDD[(A,B)] to an RDD[String] and save it.
1.4m articles
1.4m replys
5 comments
57.0k users