Reputation: 2378
I want to know how to delete specific rows in HBase using Map-Reduce?
Upvotes: 1
Views: 1305
Reputation: 3261
The easiest way is to create a map task that does a delete, no reduce necessary.
In your job configuration, you should set up an appropriate Scan object with the conditions that you want to specify, and the hbase column family/qualifiers that you will used to determine whether or not to delete a row.
Alternatively, you could put the conditions in the map, but that would be much more inefficient. The nice part about putting the conditions in the scan is that the comparisons are done on the server, not the client. The hard part is that you either have to use the very flexible built-in comparators, or ensure that your custom comparator is in the classpath of all of the regionservers
Upvotes: 1