You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Sam William <sa...@stumbleupon.com> on 2013/09/09 21:28:31 UTC
Getting column values in batches for a single row
Hi,
I have a table which is wide(with a single family) and the column qualifiers are timestamps. I'd like to do a get on a rowkey, but I dont need to read all of the columns. I want to read the first n values and then read more in batches if need be. Is there a way to do this? Im on version-0.94.2.
Thanks
Re: Getting column values in batches for a single row
Posted by Sam William <sa...@stumbleupon.com>.
JD,
Thanks. This works. I considered Scan.setBatch earlier but dismissed it because the ResultScanner.next()'s docs said it checks for the next row.
Sam
On Sep 9, 2013, at 12:43 PM, Jean-Daniel Cryans <jd...@apache.org> wrote:
> Scan.setBatch does what you are looking for, since with a Get there's no
> way to iterate over mutliple calls:
> https://github.com/apache/hbase/blob/0.94.2/src/main/java/org/apache/hadoop/hbase/client/Scan.java#L306
>
> Just make sure to make the Scan start at the row you want and stop right
> after it.
>
> J-D
>
>
> On Mon, Sep 9, 2013 at 12:28 PM, Sam William <sa...@stumbleupon.com> wrote:
>
>> Hi,
>> I have a table which is wide(with a single family) and the column
>> qualifiers are timestamps. I'd like to do a get on a rowkey, but I dont
>> need to read all of the columns. I want to read the first n values and
>> then read more in batches if need be. Is there a way to do this? Im on
>> version-0.94.2.
>>
>>
>> Thanks
Re: Getting column values in batches for a single row
Posted by Jean-Daniel Cryans <jd...@apache.org>.
Scan.setBatch does what you are looking for, since with a Get there's no
way to iterate over mutliple calls:
https://github.com/apache/hbase/blob/0.94.2/src/main/java/org/apache/hadoop/hbase/client/Scan.java#L306
Just make sure to make the Scan start at the row you want and stop right
after it.
J-D
On Mon, Sep 9, 2013 at 12:28 PM, Sam William <sa...@stumbleupon.com> wrote:
> Hi,
> I have a table which is wide(with a single family) and the column
> qualifiers are timestamps. I'd like to do a get on a rowkey, but I dont
> need to read all of the columns. I want to read the first n values and
> then read more in batches if need be. Is there a way to do this? Im on
> version-0.94.2.
>
>
> Thanks