You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Hansi Klose <ha...@web.de> on 2014/04/29 09:53:57 UTC
rowcount in a specified timerange
Hi,
is it possible to count the rows in a table in a specified timerange?
I found [--range=[startKey],[endKey]] but I need to count between
specified timestamps.
Regards Hansi
Re: rowcount in a specified timerange
Posted by Samir Ahmic <ah...@gmail.com>.
Hi, Hansi
Take look at
https://github.com/apache/hbase/blob/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java
.
You can modified it and and scan.setTimeRange(long minStamp, long maxStamp)
that will give you option to count rows in specific time range.
Anther option is to use hbase shell and scan with:
hbase> scan 't1', {COLUMNS => 'c1', TIMERANGE => [1303668804, 1303668904]}
which will also return row count
Regards
Samir
On Tue, Apr 29, 2014 at 9:53 AM, Hansi Klose <ha...@web.de> wrote:
> Hi,
>
> is it possible to count the rows in a table in a specified timerange?
> I found [--range=[startKey],[endKey]] but I need to count between
> specified timestamps.
>
> Regards Hansi
>