Multiple Output in Reducer

后端 未结 2 601
我寻月下人不归
我寻月下人不归 2021-01-24 20:25

I am working on simple map reduce program. I want to create different files after reducer for each different word in the key. For example, after executing Mapreduce I have somet

相关标签:
2条回答
  • 2021-01-24 20:42

    Have a look at MultipleOutputs.

    0 讨论(0)
  • 2021-01-24 20:43

    You need to create a partioner class first, that partions based on your criteria.

    You then need to create your own outputformat class and a recordwriter class.

    The recordwriter class, needs to write to different files as per your needs. Further if you need to sort your values create comparator class for your key field.

    0 讨论(0)
提交回复
热议问题