hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Daniel Cryans <jdcry...@apache.org>
Subject Re: Can we store a HBase Result object using Put
Date Mon, 21 May 2012 20:26:51 GMT
How exactly are you building the Put? It doesn't have a constructor
that can take byte[] and figure out how it should use it, it only
takes a row key (meaning that if you do new
Put(Result.getBytes().get()), you're passing the whole thing as a row
key which is wrong).

In the HBase code we do the Result => Put conversion here:
https://github.com/apache/hbase/blob/trunk/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java#L115

J-D

On Mon, May 21, 2012 at 12:10 PM, Shahsikant Jain
<shahsikant.jain@gmail.com> wrote:
> Hi,
>
> I am trying to store a result that I got out of some scan into another
> Hbase table so that I can read it back via Get and reconstruct.
>
> This is what I am doing....
>
> 1. Result.getBytes().get() -- Get the byte[] and do a Put in HBase
> 2. Then do a get and read the bytes[] as
> new Result(new ImmutableBytesWritable(byte[]))
>
> Now when I try to read some value from this Result it's give me null.
> Wondering what I am doing worng
>
> Regards,
> Shahsikant

Mime
View raw message