Define and drop namespaces
You can create and drop namespaces in the HBase shell.
![]() | Note |
|---|---|
You can assign a table to only one namespace, and you should ensure that the table correctly belongs to the namespace before you make the association in HBase. You cannot change the namespace that is assigned to the table later. |
The HBase shell has a set of straightforward commands for creating and dropping namespaces. You can assign a table to a namespace when you create the table.
- create_namespace 'my_ns'
-
Creates a namespace with the name
my_ns. - create 'my_ns:my_table', 'fam1'
Creates
my_tablewith a column family identified asfam1in themy_nsnamespace.- drop_namespace 'my_ns'
-
Removes the
my_nsnamespace from the system. The command only functions when there are no tables with data that are assigned to the namespace.


