How to add new column family to an existing HBase table?

proutray picture proutray · Mar 27, 2015 · Viewed 26.7k times · Source

I created a table by

create 'tablename', 'columnfamily1'

Now is it possible to add another column family 'columnfamily2'? What is the method?

Answer

proutray picture proutray · Mar 27, 2015

It seems

alter 'tablename', 'columnfamily2'

does the trick. One may, disable 'tablename' first. However, it works fine even if enabled.

hbase(main):015:0> alter 'tablename', {NAME=> 'columnfamily2'}
Updating all regions with the new schema...
0/1 regions updated.
1/1 regions updated.
Done.