On Thu, Sep 23, 2010 at 11:28 AM, Andrey Stepachev <[email protected]> wrote: > 2010/9/23 Imran M Yousuf <[email protected]>: >> <snip /> >> Second, when doing object to row, we are mapping a one to many >> relation in a specific column family, e.g. cf1, now when I will update >> the row I will populate cf1 with values set newly, e.g. old values are >> 1,2,3 and new values are 1,3,4, now I will populate cf1 to have 1,3,4. >> Now my first question is what will happen to the value '2'? When I do >> a scan/get on that row will cf1 return 1,3,4 or 1,2,3,4? If the answer >> is 1,2,3,4, when getting cf1 I want to get 1,3,4 only as it was set >> and not 2, what is the best way to achieve it? > > How you populate family cf1? 1,2,3,4 = are qualifiers? or you put values > under the same qualifiers? > > In case of qualifiers, you should delete qualifier+value explicitly.
Hmm, this is the information I needed confirmation on. > This can be done in two ways: > 1. delete whole cf for given key > http://hbase.apache.org/docs/r0.20.6/api/org/apache/hadoop/hbase/client/Delete.html#deleteFamily(byte[], > long) > This is the brutforce approach. > 2. get current values, make diff with new value, and delete obsolete value. > This is the more elegant approach but for a lot of simultaneous Puts' it could be expensive. I will ponder on them and check how to implement them efficiently. Thanks, -- Imran M Yousuf Twitter: @imyousuf - http://twitter.com/imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557
