I created a table by
create 'tablename', 'columnfamily1'
Now is it possible to add another column family 'columnfamily2'? What is the method?
Simply press the "+" button in the "Alter table" page and add your new column family with all settings you need.
Alter is the command used to make changes to an existing table. Using this command, you can change the maximum number of cells of a column family, set and delete table scope operators, and delete a column family from a table.
An HBase table contains column families , which are the logical and physical grouping of columns. There are column qualifiers inside of a column family, which are the columns. Column families contain columns with time stamped versions. Columns only exist when they are inserted, which makes HBase a sparse database.
Technically, HBase can manage more than three of four column families. However, you need to understand how column families work to make the best use of them.
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.
alter 'tablename', NAME => 'newcolumnfamily', VERSIONS => 50
you can specify various properties of the new column family separated by a comma (,)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With