[ https://issues.apache.org/jira/browse/HBASE-22980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shardul Singh updated HBASE-22980: ---------------------------------- Description: In HRegionPartitioner getPartition(), the case where we have less reduces than region is incorrect. [https://github.com/apache/hbase/blob/fbd5b5e32753104f88600b0f4c803ab5659bce64/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java#L92] Consider the following scenario: # if there are 5 regions for the table, partitions = 5 and number of reducers is also 5. So in this case above code should not return true. But for the last region when i=4, getPartition should return 4 but it returns 2 because it falls in the case of when we have less reduces than region and returns true for the above condition. {code:java} {code} was: In HRegionPartitioner getPartition(), the case where we have less reduces than region is incorrect. https://github.com/apache/hbase/blob/fbd5b5e32753104f88600b0f4c803ab5659bce64/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java#L92 Consider the following scenario: 1. if there are 5 regions for the table, partitions = 5 and number of reducers is also 5. So in this case above code should not return true. But for the last region when i=4, getPartition should return 4 but it returns 2 because it falls in the case of when we have less reduces than region and returns true for the above condition. > HRegionPartioner getPartition() method incorrectly partitions the regions of > the table. > --------------------------------------------------------------------------------------- > > Key: HBASE-22980 > URL: https://issues.apache.org/jira/browse/HBASE-22980 > Project: HBase > Issue Type: Bug > Components: mapreduce > Reporter: Shardul Singh > Assignee: Shardul Singh > Priority: Minor > > In HRegionPartitioner getPartition(), the case where we have less reduces > than region is incorrect. > [https://github.com/apache/hbase/blob/fbd5b5e32753104f88600b0f4c803ab5659bce64/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HRegionPartitioner.java#L92] > Consider the following scenario: > # if there are 5 regions for the table, partitions = 5 and number of > reducers is also 5. > So in this case above code should not return true. But for the last region > when i=4, getPartition should return 4 but it returns 2 because it falls in > the case of when we have less reduces than region and returns true for the > above condition. > {code:java} > {code} -- This message was sent by Atlassian Jira (v8.3.2#803003)