|val filenames: Seq[String] = ... val combined: RDD[(String,String)] = filenames.map { name => sc.textFile(name).map(line => name -> line) }.reduce(_ ++ _) |
On 9/26/14 6:45 PM, Shekhar Bansal wrote:
HiIn one of our usecase, filename contains timestamp and we have to append it in the record for aggregation.How can I access filename in map function? Thanks!