HBase Create, Retreive, Update, Delete (CRUD) operation


HBase Create, Retreive, Update, Delete (CRUD) operation

Step 1 - Change the directory to /usr/local/hbase




$ cd /usr/local/hbase

Step 2 - To start up the initial HBase cluster.




$ ./start-hbase.sh

Creating Table




hbase> create 'emp','personal data','professional data'

Inserting Data into Table




hbase> put 'emp','1','personal data:name','raju'
hbase> put 'emp','1','personal data:city','hyderabad'
hbase> put 'emp','1','professional data:designation','manager'
hbase> put 'emp','1','professional data:salary','50000'


View or Scan




hbase> scan 'emp'

Update




hbase> put 'emp','1','personal data:city','Delhi'

Verify or Scan




hbase> scan 'emp'

Retrieve




hbase> get 'emp', '1'

hbase> get 'emp', '1', {COLUMN=>'personal data:name'}


Delete




hbase> delete 'emp', '1', 'personal data:city'
hbase> deleteall 'emp','1'

View or Scan




hbase> scan 'emp'

Count and Truncate




hbase> count 'emp'

hbase> truncate 'emp'

hbase> scan 'emp'


Grant, revoke and list all permissions




hbase> grant 'nagaraju', 'RWXCA'

hbase> revoke 'nagaraju'

hbase> user_permission 'emp'

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *