spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shams ul Haque <>
Subject Separate all values from Iterable
Date Tue, 27 Oct 2015 10:50:21 GMT

I have grouped all my customers in JavaPairRDD<Long, Iterable<ProductBean>>
by there customerId (of Long type). Means every customerId have a List or

Now i want to save all ProductBean to DB irrespective of customerId. I got
all values by using method
JavaRDD<Iterable<ProductBean>> values = custGroupRDD.values();

Now i want to convert JavaRDD<Iterable<ProductBean>> to JavaRDD<Object,
BSONObject> so that i can save it to Mongo. Remember, every BSONObject is
made of Single ProductBean.

I am not getting any idea of how to do this in Spark, i mean which Spark's
Transformation is used to do that job. I think this task is some kind
of seperate
all values from Iterable. Please let me know how is this possible.
Any hint in Scala or Python are also ok.



View raw message