Is it possible to read data from HBase
based on rowKey
and columnFamily
. Currently I access records by rowkey by this code:
HTable table = new HTable(conf, "tablename");
Get get = new Get(rowkey.getBytes());
Result rs = table.get(get);
for (KeyValue kv : rs.raw()) {
holdvalue = new String(kv.getValue());
}
I want to add columnfamily as a filter to access specific records that belongs to that specific rowKey
and columnFamily
. How could I achieve this?
Thanks in advance
You can add the column family as a filter by using the
addFamily
method of theGet
object.