Hbase PDF
Hbase PDF
create 'emp','details'
put 'emp','Row1','details:ename','King'
put 'emp','Row1','details:esal','24000'
put 'emp','Row1','details:loc','Hyd'
put 'emp','Row2','details:ename','Steven'
put 'emp','Row2','details:esal','14000'
put 'emp','Row2','details:loc','Delhi'
scan 'emp'
get 'emp','Row2'
put 'emp','Row1','details:loc','Chennai'
get 'emp','Row1'
Step6: Describe the table emp and notice the table status to be
ENABLED
describe 'emp'
disable 'emp'
drop 'emp'
list
************HDFS FILE TO Hbase *************
create 'employees','name','contact','job','wages','work'
list
hadoop fs -ls
Note: make sure you type the below statement in one line only
Creating table in Hive that automatically creates table in Hbase and this table
sync's data insert,update,delete can only happen on this table from Hbase side
********************************************************
list
scan 'customer'
put 'customer','901','add:country','Germany'
put 'customer','901','add:state','Stuttgart'
scan 'customer'
Step6: Connect to Hive and see data for 901 added in Hbase has synced
in Hive table customer
Step7: Load file custH.csv from Hdfs to Hbase table customer and see it
syncing in Hive
scan 'customer'
Step10: Delete cell value of column country from Hbase customer table
for row 901
delete 'customer','901','add:country'
get 'customer','901'
put 'customer','101','add:state','MH'
get 'customer','101'
Step15: Check the table in Hbase for existance, it wont be there as it got
automatically drop because of its drop from Hive
list
Syncing Hive External tables with a pre-existing table in Hbase
Step1: Create table employees in Hbase and load it with data from a file
in HDFS
list
scan 'employees'
show databases;
use hbase_demo;
put 'employees','100','job:job_id','President'
get 'employees','100'
Step7: Drop the emp table in Hive the table will only be drop from Hive ,
Hbase employees table wiil be unaffected