First page Back Continue Last page Image

Hbase Code Example

https://www.guru99.com/hbase-shell-general-commands.html

$ hbase shell

hbase(main):003:0> create ‘ourFriends’, {NAME => ‘info’}, {NAME => ‘friends’}

0 row(s) in 1.3400 seconds

hbase(main):005:0> put ‘ourfriends’ , ‘guy’ , ‘info:email’ , ‘guy@gmail.com’

0 row(s) in 0.0900 seconds

hbase(main):006:0> put ‘ourfriends’ , ‘guy’ , ‘info:userid’ , ‘9990’

0 row(s) in 0.0070 seconds

hbase(main):007:0> put ‘ourfriends’ , ‘guy’ , ‘friends:Jo’ , ‘jo@gmail.com’

0 row(s) in 0.0080 seconds

hbase(main):008:0> put ‘ourfriends’ , ‘guy’ , ‘friends:John’ , ‘john@gmail.com’

0 row(s) in 0.0040 seconds

hbase(main):018:0> get ‘ourfriends’ , ‘guy’

COLUMN CELL

friends:Jo timestamp=1444123707299, value=jo@gmail.com

friends:John timestamp=1444123707324, value=john@gmail.com

info:email timestamp=1444123707214, value=guy@gmail.com

info:userid timestamp=1444123707274, value=9990

4 row(s) in 0.0390 seconds