twitter / scalding

A Scala API for Cascading
http://twitter.com/scalding
Apache License 2.0
3.5k stars 707 forks source link

Operation after groupBy #1696

Open dhruvilbadani opened 7 years ago

dhruvilbadani commented 7 years ago

I want to groupBy an key. And then, hopefully I get an iterator over all the values with the same key (please correct me if I'm wrong here). Then, for each key, I want to apply a function on the iterator over its values. How can I do so? I am currently using groupBy and then mapValueStream but I'm not sure if that is correct

Thanks!

johnynek commented 7 years ago

That it mapGroup which also gives you the key. On Sat, Jun 3, 2017 at 11:19 dhruvilbadani notifications@github.com wrote:

I want to groupBy an key. And then, hopefully I get an iterator over all the values with the same key (please correct me if I'm wrong here). Then, for each key, I want to apply a function on the iterator over its values. How can I do so? I am currently using groupBy and then mapValueStream but I'm not sure if that is correct

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/twitter/scalding/issues/1696, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEJdn7gEZESs2xq097_zqmdKKUyux57ks5sAc3YgaJpZM4NvNCr .

dhruvilbadani commented 7 years ago

So I should:

  1. groupBy my key
  2. Then use mapGroup to apply a function on all i_k where i_k is the iterator for all values with key k

Is that correct?