Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How describe Hbase column family?

Tags:

hbase

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.

like image 831
sahiljain Avatar asked Jan 31 '14 05:01

sahiljain


People also ask

What is column families in HBase?

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.

How many column families does HBase have?

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.

What is column family in database?

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.

How do I create a column family in HBase?

Simply press the "+" button in the "Alter table" page and add your new column family with all settings you need.


2 Answers

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'
 }   
like image 55
th30z Avatar answered Oct 07 '22 23:10

th30z


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") enter image description here

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

UPDATE #1

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.

like image 28
Anandkumar Avatar answered Oct 07 '22 23:10

Anandkumar