Re: transforming a Map object to RDD

2014-09-01 Thread Matthew Farrellee
and in python, >>> map = {'a': 1, 'b': 2, 'c': 3} >>> rdd = sc.parallelize(map.items()) >>> rdd.collect() [('a', 1), ('c', 3), ('b', 2)] best, matt On 08/28/2014 07:01 PM, Sean Owen wrote: val map = Map("foo" -> 1, "bar" -> 2, "baz" -> 3) val rdd = sc.parallelize(map.toSeq) rdd is a an RDD[

Re: transforming a Map object to RDD

2014-08-28 Thread Sean Owen
val map = Map("foo" -> 1, "bar" -> 2, "baz" -> 3) val rdd = sc.parallelize(map.toSeq) rdd is a an RDD[(String,Int)] and you can do what you like from there. On Thu, Aug 28, 2014 at 11:56 PM, SK wrote: > Hi, > > How do I convert a Map object to an RDD so that I can use the > saveAsTextFile() oper