Search

How will we write a custom partitioner for a Hadoop job?



To write a custom partitioner we will have to
  • Create a new class that extends Partitioner class
  • Override method getPartition()
  • In the wrapper that runs the Map Reducer, add the custom partitioner to the job programmatically using method setPartitionerClass()