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

前端 未结 3 394
青春惊慌失措
青春惊慌失措 2021-01-07 19:08

I created a table by

create \'tablename\', \'columnfamily1\'

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

相关标签:
3条回答
  • 2021-01-07 19:29
    alter 'tablename', NAME => 'newcolumnfamily', VERSIONS => 50
    

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

    0 讨论(0)
  • 2021-01-07 19:38

    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.

    0 讨论(0)
  • 2021-01-07 19:41

    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.
    
    0 讨论(0)
提交回复
热议问题