title: Can I do cell merging in hbase?
body: <p>Suppose that I have a column that is updated incrementally other than overwriting (like a bitwise-ored integer flag or a sum column). For example (assuming only 1 version):</p>
  
  <p>Existing Cell: <strong>[key: 'k1', f1:sum: 100]</strong><br>
  Upcomming New Cell: <strong>[key: 'k1', f1:sum: 200]</strong></p>
  
  <p>Then I want to update the cell data this way: sum = 100+200 = 300.
  Yielding the final record:<br>
  <strong>[key: 'k1', f1:sum: 300]</strong></p>
  
  <p>Here I want to <strong>MERGE</strong> the new cell into the old one with the same key.
  How can I achieve this? A direct <strong>put</strong> would simple overwrite the old cell. (Again only one version is maintained).</p>
  
  <p>I come up with some ideas but they don't seem satisfying though:</p>
  
  <p>1> On the client side first <strong>get</strong> the old value then add sum to the on going <strong>put</strong> object. </p>
  
  <p>2> Use a coprocessor. In RegionObserver.prePut I do a get, add and modify the final <strong>put</strong> object. This pushes the computation to the server side but still needs an extra query(get) (which could expensive) first.</p>
  
  <p>Besides even the above work in real-time query scenario but what about bulk-load data merging? </p>
  
  <p>I've been going through the documents for quite a while but can't find a clue yet. I'll really appreciate it if you could share some idea on this.</p>
  
  <p>I'm using hbase-1.2.6. Thanks!</p>