HBASE & Java: Delete a Table

(Last Updated On: )

This tutorial will guide you through how to delete a HBASE table using Java 8. Make sure you first follow this tutorial on connecting to HBASE.

Import:

  1. import org.apache.hadoop.hbase.client.Admin;

Delete:

  1. //You must first disable the table
  2. conn.getAdmin().disableTable(TableName.valueOf("myTable"));
  3.  
  4. //Now you can delete the table
  5. conn.getAdmin().deleteTable(TableName.valueOf("myTable"));