How about using this method: * Return a new RDD by applying a function to all elements of this RDD. */ def mapToDouble[R](f: DoubleFunction[T]): JavaDoubleRDD = { new JavaDoubleRDD(rdd.map(x => f.call(x).doubleValue()))
On Wed, Sep 16, 2015 at 8:30 PM, Tapan Sharma <tapan.sha...@gmail.com> wrote: > Hi All, > > I am a newbie. I want to achieve following scenario. > I would like to iterate over a JavaRDD of Complex type (user defined class, > say X). > I need to calculate the sum of integers stored in X and return. > Which method do I need to call of JavaRDD? > > Thanks > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Iterating-over-JavaRDD-tp24723.html > Sent from the Apache Spark User List mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@spark.apache.org > For additional commands, e-mail: user-h...@spark.apache.org > >