Thursday, January 19, 2012

How to enter data in Hbase table and view them using the Hbase Shell

Following command inserts value 'www.yahoo.com' into Hbase table 'referrer' for row 'z1', column family 'details' and column 'url'
put 'referrer','z1','details:url','www.yahoo.com'

The following command lets you view data for row 'z1'
get 'referrer','z1'

How to create and drop table from hbase shell

Logon to hbase shell
hbase shell 

Create a table 'referrer' with 2 column families 'details' and 'stats'
create 'referrer', 'details','stats'

List the table
list

Drop the table
disable 'referrer'
drop 'referrer'