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..
Thanks for the above responses..I implemented using RangePartitioner..we need to use any of the custom partitioners in orderto perform this task..Normally u cant maintain a counter becoz count operations should beperformed on each partitioned block ofdata...