Table Management Commands

The Table Management command supports programmers to create tables and schema with rows and column families. Will study one by one in this session.

1. Create                                                                  

Create command used to creates a table along with column family in hbase.


hbase> create ‘<tablename>’, ‘<columnfamilyname>’


In this example will create table name called “beyondemp” with two column families like “personal data” and “professional data”.

hbase(main)> create ‘beyondemp’, ‘personal data’, ‘professional data’

2. List

List command helps to display whatever the tables present or verify the created table in Hbase.


Here will verify the above created table using list command.


3. Describe

Describe command provides the description of a table like table name with column families, associated filters, and versions.


hbase>describe <table name>


In this example we are getting information about the “beyondemp” table.

hbase(main)> describe ‘beyondemp’

4. Disable

Using disable command we can disables a table for modification or deletion operation of the existing table.


hbase>disable ‘<tablename>’


Support I need to delete the above table before deleting the above table firstly we have to disable the table.

hbase(main)> disable ‘beyondemp’

5. Disable_all

Using disable_all command we can delete all the tables matching the given regex.


hbase>disable_all ‘<matching text>’


In this example we are deleting the entire table matching with the letter “b”

hbase(main)> disable_all ‘b.*’

6. Is_disabled

This command is used to verify whether a table is disabled or not.


hbase>is_disabled ‘<tablename>’


In this example we are cross verifying that table is disabled or not.

hbase(main)> is_disabled ‘beyondemp’

7. Enable

Enable command is used to enables the entire disable table. We can reuse the disable table using this command.


hbase>enable ‘<tablename>’


In the previous example we have disable the “beyondemp” table, now again I have to reuse that table in that case we can use enable command.

hbase(main)> enable ‘beyondemp’

8. Is_enabled          

This command is used to verify whether the named table is enabled or not.


hbase>is_enabled ‘tablename’


In this example will cross verify that “beyondemp” table is enabled or not using is_enabled command.

hbase(main)> is_enabled ‘beyondemp’

9. show_filters

Show_filter command used to display the information about the filters present in HBase For example fix Filter, Timestamps Filter, Page Filter, Family Filter, etc.


In this example we are displaying all the present filter of hbase.


10. Drop

Drop command is used to delete table from HBase.

Note: Before deleting table first we need to disable the table.


hbase>drop ‘<table name>’


In this example we are deleting the “beyondemp” table from the hbase, first we need to disable then we can delete the table.

hbase(main)> disable ‘beyondemp’

hbase(main)> drop ‘beyondemp’

11. Drop_all

Using this command we can drops the tables matching the ‘regex’ given in the command.


Hbase>drop_all ‘<regex>’


In this example will delete all the tables starting with the text “beyond”

hbase(main)> drop_all ‘b.*’

12. Alter

Using alter command we can alter single, multiple column family names and deleting column family names from table.


In this example will see the different ways of altering the schema.

1. Here we are changing column family name personal data to personal data1

hbase> alter ‘beyondemp’, NAME=>’personal data1′, VERSIONS=>5

2. In this case I am adding new columns to our existing table “beyondemp”.

hbase> alter ‘beyondemp’, ‘personal data1’, {NAME => ‘first_name’, IN_MEMORY => true}, {NAME => ‘Last_name’, VERSIONS => 5}

3. In this case will see how to delete column family from the table.

hbase> alter ‘beyondemp’, { NAME => ‘personal data1’, VERSIONS => 3 },{ MAX_FILESIZE => ‘134217728’ }, { METHOD => ‘delete’}

13. Alter_status

Alter_status command used to get the updates of the modified command in hbase.

i.e it include information like the number of regions of the table that have received the updated schema.


In this example will get the alter information of the schema.

hbase>alter_status ‘beyondemp’

“That’s all about the Table Management Commands in Hbase”.