Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase >> mail # user >> how to create a Result object with some null value?


Copy link to this message
-
how to create a Result object with some null value?
Now I want to test HBase with mock Result object.In the map(), we get value like this:
byte[] date = value.getValue(Bytes.toBytes("f"),
Bytes.toBytes("date"));
Sometimes,  the byte[] date will be null because of null value in hbase.
Now I want to create fake HBase object by using :

new KeyValue(
Bytes.toBytes(rowkey),
Bytes.toBytes(family),
Bytes.toBytes(qualifier),
1,
Bytes.toBytes(value));
But I can't set value to null to create KeyValue object.
Anybody knows how to simulate this situation?    
+
Ted Yu 2013-02-27, 21:57