Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HBase update operation

Tags:

hbase

  1. I am new to HBase, I find in HBase client API, update operation is not supported? Is that correct?
  2. If so, what is the suggested best practices to update the values for a specific rowkey?
like image 671
Lin Ma Avatar asked Dec 02 '12 09:12

Lin Ma


1 Answers

You can use PUT which will create or update the value of any cell. You don't need to use delete unless you want the new version to not have some of the old cells .

say we have

r1:f1:c1:value1
r1:f1:c2:value2 

you can put r1:f1:c1 new value and you'd get:

r1:f1:c1:new value 
r1:f1:c2:value2 

Note that actually each cell is stored as rowkey, column family, cell, timestamp, version and value. So depending on how you set versioning (per column family) you can also access the old values including doing a point in time query to see deleted values.

like image 159
Arnon Rotem-Gal-Oz Avatar answered Sep 29 '22 19:09

Arnon Rotem-Gal-Oz