scala - How to remove parentheses around records when saveAsTextFile on RDD[(String, Int)]? -


i'm using saveastextfile(path) in order save output text file in later import result db. output looks this:

(value1, value2) 

how remove parentheses?

you can try following basic:

rdd.map(x => x._1 + "," + x._2).saveastextfile(path) 

you map rdd[(a,b)] rdd[string] , save it.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -