Reading a text file into RDD[Char] instead of RDD[String]

2015-03-19 Thread Michael Lewis
Hi, I’m struggling to think of the best way to read a text file into an RDD[Char] rather than [String] I can do: sc.textFile(….) which gives me the Rdd[String], Can anyone suggest the most efficient way to create the RDD[Char] ? I’m sure I’ve missed something simple… Regards, Mike

Re: Reading a text file into RDD[Char] instead of RDD[String]

2015-03-19 Thread Sean Owen
val s = sc.parallelize(Array(foo, bar, baz)) val c = s.flatMap(_.toIterator) c.collect() res8: Array[Char] = Array(f, o, o, b, a, r, b, a, z) On Thu, Mar 19, 2015 at 8:46 AM, Michael Lewis lewi...@me.com wrote: Hi, I’m struggling to think of the best way to read a text file into an RDD[Char]