Manoj,

I assume you’re trying to create an RDD[(String, Double)]? Couldn’t you just do:

val cr_rdd = sc.parallelize(cr.toSeq)

The toSeq would convert the HashMap[String,Double] into a Seq[(String, Double)] 
before calling the parallelize function.

Regards,

Frank Austin Nothaft
[email protected]
[email protected]
202-340-0466

On Jan 24, 2014, at 12:56 PM, Manoj Samel <[email protected]> wrote:

> Is there a way to create RDD over a hashmap ?
> 
> If I have a hash map and try sc.parallelize, it gives 
> 
> <console>:17: error: type mismatch;
>  found   : scala.collection.mutable.HashMap[String,Double]
>  required: Seq[?]
> Error occurred in an application involving default arguments.
>        val cr_rdd = sc.parallelize(cr)
>                                    ^

Reply via email to