How to emit multiple keys for the same value?

2014-10-20 Thread HARIPRIYA AYYALASOMAYAJULA
Hello, I am facing a problem with implementing this - My mapper should emit multiple keys for the same value - for every input (k, v) it should emit (k, v), (k+1, v),(k+2,v) (k+n,v). In MapReduce, it was pretty straight forward - I used a for loop and performed Context write within that.

Re: How to emit multiple keys for the same value?

2014-10-20 Thread Boromir Widas
flatMap should help, it returns a Seq for every input. On Mon, Oct 20, 2014 at 12:31 PM, HARIPRIYA AYYALASOMAYAJULA aharipriy...@gmail.com wrote: Hello, I am facing a problem with implementing this - My mapper should emit multiple keys for the same value - for every input (k, v) it should

Re: How to emit multiple keys for the same value?

2014-10-20 Thread DB Tsai
You can do this using flatMap which return a Seq of (key, value) pairs. Sincerely, DB Tsai --- My Blog: https://www.dbtsai.com LinkedIn: https://www.linkedin.com/in/dbtsai On Mon, Oct 20, 2014 at 9:31 AM, HARIPRIYA AYYALASOMAYAJULA