更新时间:2023-11-17 11:18:04
You can achieve a globally sorted file (which is what you basically want) using these methods:
Write a custom partitioner. Partioner is the class which divides the key space in mapreduce. The default partioner (Hashpartioner) evenly divides the key space into the number of reducers. Check out this example for writing a custom partioner.
Use Hadoop Pig/Hive to do sort.