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.
2.1m questions
2.1m answers
60 comments
57.0k users