hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: HBase Client API: Why does HTable.get(get).getValue() return null if more than one family is added to the get instance?
Date Sun, 10 Jun 2012 18:45:17 GMT
Hi,

Am unable to reproduce this on 0.90.6 at least. What version are you using?

Regardless of "get.addFamily(Bytes.toBytes("family2"));" being present
or not, I do not receive a null.

Original table scan (of a table 't'), to match your qualifier-less f1 family:

 x   column=f1:, timestamp=1339353441608, value=value

And then again tried with a qualifier-added f2 family column:

 x   column=f1:, timestamp=1339353441608, value=value
 x   column=f2:x, timestamp=1339353614689, value=value

With both these data sets am still unable to get the null returns. I
only get a null if I instead comment the
"get.addFamily(Bytes.toBytes("family1"));" family1 line, which is
expected.

Can you also detail out the steps you did to check this? Did you
recreate rows/tables between tests?

On Sun, Jun 10, 2012 at 9:20 PM, Desert R. <desert_rose_170@hotmail.com> wrote:
>
> Hi,
>
>
>
>
>
>
>        I have a table with 2 column families. The column 'family1'
> has no qualifiers, and the row 'x' has the value \xFF. If I do the
> following
>
> HTable htable = new HTable(config, TABLE_NAME);
> Get get = new Get(Bytes.toBytes("x"));
> get.addFamily(Bytes.toBytes("family1"));
> if(htable.get(get).getValue(Bytes.toBytes("family1"), Bytes.toBytes("")) == null)
>  log.debug("Value is null!");
>
>
> the method getValue() returns not null (as expected). But if I add other family:
>
> HTable htable = new HTable(config, TABLE_NAME);
> Get get = new Get(Bytes.toBytes("x"));
> get.addFamily(Bytes.toBytes("family1"));
> get.addFamily(Bytes.toBytes("family2"));
> if(htable.get(get).getValue(Bytes.toBytes("family1"), Bytes.toBytes("")) == null)
>  log.debug("Value is null!");
>
>
> I get a null. Why does this happen?



-- 
Harsh J

Mime
View raw message