Hi, I want to perform map operation on an RDD of elements such that resulting RDD is a key value pair(counter,value)
For example var k:RDD[Int]=10,20,30,40,40,60... k.map(t=>(i,t)) where 'i' value should be like a counter whose value increments after each mapoperation... Pleas help me.. I tried to wirte like this but didnt work out.. var i=0; k.map(t=>{ (i,t);i+=1; }) please correct me... -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/How-to-index-each-map-operation-tp3471.html Sent from the Apache Spark User List mailing list archive at Nabble.com.