spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Samel <manojsamelt...@gmail.com>
Subject Re: How to create RDD over hashmap?
Date Fri, 24 Jan 2014 21:03:12 GMT
sc.parallelize(cr.iterator) also gives error

scala> val cr_rdd = sc.parallelize(cr.iterator)
<console>:17: error: type mismatch;
 found   : Iterator[(String, Double)]
 required: Seq[?]
Error occurred in an application involving default arguments.
       val cr_rdd = sc.parallelize(cr.iterator)
                                      ^


On Fri, Jan 24, 2014 at 1:00 PM, Andrew Ash <andrew@andrewash.com> wrote:

> In Java you'd want to convert it to an entry set, which is a set of (key,
> value) pairs from the hashmap.  The closest I can see in scaladoc is the
> .iterator method -- try that?
>
>
> On Fri, Jan 24, 2014 at 12:56 PM, Manoj Samel <manojsameltech@gmail.com>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)
>>                                    ^
>>
>
>

Mime
View raw message