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

大城市里の小女人 提交于 2019-11-30 21:58:45

问题


I created a table by

create 'tablename', 'columnfamily1'

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


回答1:


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.



回答2:


alter 'tablename', NAME => 'newcolumnfamily', VERSIONS => 50

you can specify various properties of the new column family separated by a comma (,)




回答3:


If you consider some GUI solutions than you can easily do it with HAdmin. Simply press the "+" button in the "Alter table" page and add your new column family with all settings you need.



来源:https://stackoverflow.com/questions/29291305/how-to-add-new-column-family-to-an-existing-hbase-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!