Multiple Output in Reducer

后端 未结 2 604
我寻月下人不归
我寻月下人不归 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: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.

提交回复
热议问题