Basic HBase Java Classes and Methods – Part 7: Delete from a Table

Deleting data from an HBase table is very similar in overall structure to many of our previous operations.  First we have our general skeleton code.  As before we use static variable declarations to make the code look a lot nicer.

We will create a Delete object, with a parameter of 1, which means we are deleting from the row with row key 1.  We will then add the columns we wish to delete using the addColumn method, and finally call the delete method on our Table object and pass in our Delete object as its parameter.

Putting it all together the complete code is as so:

The last part of this series will show how to Disable and then Drop an HBase table using Java.  Next Basic HBase Java Classes and Methods – Part 8: Disable and Delete a Table

This entry was posted in Data Analytics and tagged , . Bookmark the permalink.

Leave a Reply