I am looking for a command which describes the columnfamily inside the table from the HBase Shell. I could not get any command to try this.
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.
A column family is a group of columns in a table that are stored as a single key-value pair in the underlying key-value store.
Simply press the "+" button in the "Alter table" page and add your new column family with all settings you need.
If you use the describe
command from the hbase shell
you'll get the information for each column family.
Currently, there is no way to filter on a single family.
Example:
hbase(main):003:0> describe 'TABLE_NAME'
'TABLE_NAME',
{NAME => 'FAMILY_NAME',
DATA_BLOCK_ENCODING => 'NONE',
BLOOMFILTER => 'ROW',
REPLICATION_ true
SCOPE => '0',
VERSIONS => '1',
COMPRESSION => 'NONE',
MIN_VERSIONS => '0', TTL => '2147483647',
KEEP_DELETED_CELLS => 'false',
BLOCKSIZE => '65536',
IN_MEMORY => 'false',
BLOCKCACHE => 'true'
}
There is no command to describe the Hbase column family (which can display the column qualifiers), but I used Hue Hbase Browser, it has a smartview, which can display column qualifiers of a column family.
(It can not show all the column qualifiers of column family( like describe), but it can show a record with all the column qualifiers, which is helpful for me to understand CF) (Something is better than nothing).
You can refer this link for more information: http://gethue.com/the-web-ui-for-hbase-hbase-browser/.
NOTE: Here is a sample page screenshot, showing column qualifiers of a Column Family ("p")
If this is not helpful, you can write a Happy Script to display all the column qualifiers of a given Column Family, or you can use this API.
getFamilyMap public NavigableMap getFamilyMap(byte[] family)
Map of qualifiers to values. Returns a Map of the form: Map
Parameters:
family - column family to get
Returns: map of qualifiers to values
Recently I wrote a Java program to display the column family and column qualifiers of a hbase table. Remember, this program will do a full table scan and analyze every cell, to get the qualifier names.Might take very longer for larger tables.
Here is the link for the program.
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