You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Krishna <re...@gmail.com> on 2016/06/30 04:09:19 UTC

DeleteColumn in KeyValue

Hi,

I am testing the behaviour of KeyValue using DeleteColumn when applied via
the bulkloading process. When I do this, I still see NULL value for "cq"
where I expected it have "new-value". What's the correct approach to ensure
"cq" keeps the value inserted after performing delete?

context.write(key, new KeyValue(key.get(), "cf".getBytes(),
"cq".getBytes(), HConstants.LATEST_TIMESTAMP, KeyValue.Type.DeleteColumn));

context.write(key, new KeyValue(key.get(), "cf".getBytes(),
"cq".getBytes(), HConstants.LATEST_TIMESTAMP, "new-value".getBytes()));

RE: DeleteColumn in KeyValue

Posted by "Du, Jingcheng" <ji...@intel.com>.
In your case, the delete cell and put cell have the same timestamp and  seqId if using bulkload. The delete cell can be read ahead of put cell, and the scan result will be null.
You can try to use different timestamp for them?

Regards,
Jingcheng

-----Original Message-----
From: Krishna [mailto:research800@gmail.com] 
Sent: Thursday, June 30, 2016 12:09 PM
To: dev@hbase.apache.org; user@hbase.apache.org
Subject: DeleteColumn in KeyValue

Hi,

I am testing the behaviour of KeyValue using DeleteColumn when applied via the bulkloading process. When I do this, I still see NULL value for "cq"
where I expected it have "new-value". What's the correct approach to ensure "cq" keeps the value inserted after performing delete?

context.write(key, new KeyValue(key.get(), "cf".getBytes(), "cq".getBytes(), HConstants.LATEST_TIMESTAMP, KeyValue.Type.DeleteColumn));

context.write(key, new KeyValue(key.get(), "cf".getBytes(), "cq".getBytes(), HConstants.LATEST_TIMESTAMP, "new-value".getBytes()));

RE: DeleteColumn in KeyValue

Posted by "Du, Jingcheng" <ji...@intel.com>.
In your case, the delete cell and put cell have the same timestamp and  seqId if using bulkload. The delete cell can be read ahead of put cell, and the scan result will be null.
You can try to use different timestamp for them?

Regards,
Jingcheng

-----Original Message-----
From: Krishna [mailto:research800@gmail.com] 
Sent: Thursday, June 30, 2016 12:09 PM
To: dev@hbase.apache.org; user@hbase.apache.org
Subject: DeleteColumn in KeyValue

Hi,

I am testing the behaviour of KeyValue using DeleteColumn when applied via the bulkloading process. When I do this, I still see NULL value for "cq"
where I expected it have "new-value". What's the correct approach to ensure "cq" keeps the value inserted after performing delete?

context.write(key, new KeyValue(key.get(), "cf".getBytes(), "cq".getBytes(), HConstants.LATEST_TIMESTAMP, KeyValue.Type.DeleteColumn));

context.write(key, new KeyValue(key.get(), "cf".getBytes(), "cq".getBytes(), HConstants.LATEST_TIMESTAMP, "new-value".getBytes()));