The default value is 1. If you are considering a hive or pigs, then the number of gears depends on the request, for example, on the group, the amount .....
In the case of ur mapreduce code, it can be defined using setNumReduceTasks in job / conf.
job.setNumReduceTasks(3);
In most cases, this happens when you overwrite getPartition() , i.e. use custom delimiter
class customPartitioner extends Partitioner<Text,Text>{ public int getPartition(Text key, Text value, int numReduceTasks){ if(numReduceTasks==0) return 0; if(some logic) return 0; if(some logic) return 1; else return 2; } }
One thing you'll notice is the number of gears = the file number of the part in the output.
Let me know if you have any doubts.
user3123372
source share