Reputation: 922
I am new to Apache Spark. As the title says, I have a JavaPairRdd<String,String>
and I want to produce a JavaRdd<String>
with the concatenation of the key and the value of the JavaPairRdd
. Is this possible?
Example:
("1,Nick", "[email protected],53")
("2,John", "[email protected],53")
Result (JavaRdd<String>
with):
"1,Nick,[email protected],53"
"2,John,[email protected],53"
Upvotes: 0
Views: 1076
Reputation: 67065
Just use a map
:
pairRDD.map((key, value) => key + value)
That is using scala, but you should get the gist.
Upvotes: 1