You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Shahab Yunus <sh...@gmail.com> on 2013/05/29 00:23:20 UTC

Couting number of records in a HBase table

Is there a faster way to get the count of rows in a HBase table
(potentially a huge one)? I am looking for ways other than the 'count'
shell command or any Pig script? Thanks.

Regards,
Shahab

Re: Couting number of records in a HBase table

Posted by shashwat shriparv <dw...@gmail.com>.
bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename>
[<column1> <column2>...]


*Thanks & Regards    *

∞
Shashwat Shriparv



On Wed, May 29, 2013 at 10:29 AM, rajeshbabu chintaguntla <
rajeshbabu.chintaguntla@huawei.com> wrote:

> If you enable aggregation coprocessors you can use aggreation client which
> is more faster than normal count from shell.
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(byte[],
> org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,
> org.apache.hadoop.hbase.client.Scan)
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(org.apache.hadoop.hbase.client.HTable,
> org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,
> org.apache.hadoop.hbase.client.Scan)
>
>
> ________________________________________
> From: James Taylor [jtaylor@salesforce.com]
> Sent: Wednesday, May 29, 2013 4:15 AM
> To: user@hbase.apache.org
> Subject: Re: Couting number of records in a HBase table
>
> Another option is Phoenix (https://github.com/forcedotcom/phoenix),
> where you'd do
>      SELECT count(*) FROM my_table
>
> Regards,
> James
>
> On 05/28/2013 03:25 PM, Ted Yu wrote:
> > Take a look at http://hbase.apache.org/book.html#rowcounter
> >
> > Cheers
> >
> > On Tue, May 28, 2013 at 3:23 PM, Shahab Yunus <shahab.yunus@gmail.com
> >wrote:
> >
> >> Is there a faster way to get the count of rows in a HBase table
> >> (potentially a huge one)? I am looking for ways other than the 'count'
> >> shell command or any Pig script? Thanks.
> >>
> >> Regards,
> >> Shahab
> >>
>

Re: Couting number of records in a HBase table

Posted by Shahab Yunus <sh...@gmail.com>.
Thanks all for the suggestions. It helped.

-Shahab


On Wed, May 29, 2013 at 12:59 AM, rajeshbabu chintaguntla <
rajeshbabu.chintaguntla@huawei.com> wrote:

> If you enable aggregation coprocessors you can use aggreation client which
> is more faster than normal count from shell.
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(byte[],
> org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,
> org.apache.hadoop.hbase.client.Scan)
>
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(org.apache.hadoop.hbase.client.HTable,
> org.apache.hadoop.hbase.coprocessor.ColumnInterpreter,
> org.apache.hadoop.hbase.client.Scan)
>
>
> ________________________________________
> From: James Taylor [jtaylor@salesforce.com]
> Sent: Wednesday, May 29, 2013 4:15 AM
> To: user@hbase.apache.org
> Subject: Re: Couting number of records in a HBase table
>
> Another option is Phoenix (https://github.com/forcedotcom/phoenix),
> where you'd do
>      SELECT count(*) FROM my_table
>
> Regards,
> James
>
> On 05/28/2013 03:25 PM, Ted Yu wrote:
> > Take a look at http://hbase.apache.org/book.html#rowcounter
> >
> > Cheers
> >
> > On Tue, May 28, 2013 at 3:23 PM, Shahab Yunus <shahab.yunus@gmail.com
> >wrote:
> >
> >> Is there a faster way to get the count of rows in a HBase table
> >> (potentially a huge one)? I am looking for ways other than the 'count'
> >> shell command or any Pig script? Thanks.
> >>
> >> Regards,
> >> Shahab
> >>
>

RE: Couting number of records in a HBase table

Posted by rajeshbabu chintaguntla <ra...@huawei.com>.
If you enable aggregation coprocessors you can use aggreation client which is more faster than normal count from shell.

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(byte[], org.apache.hadoop.hbase.coprocessor.ColumnInterpreter, org.apache.hadoop.hbase.client.Scan)

http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/coprocessor/AggregationClient.html#rowCount(org.apache.hadoop.hbase.client.HTable, org.apache.hadoop.hbase.coprocessor.ColumnInterpreter, org.apache.hadoop.hbase.client.Scan)


________________________________________
From: James Taylor [jtaylor@salesforce.com]
Sent: Wednesday, May 29, 2013 4:15 AM
To: user@hbase.apache.org
Subject: Re: Couting number of records in a HBase table

Another option is Phoenix (https://github.com/forcedotcom/phoenix),
where you'd do
     SELECT count(*) FROM my_table

Regards,
James

On 05/28/2013 03:25 PM, Ted Yu wrote:
> Take a look at http://hbase.apache.org/book.html#rowcounter
>
> Cheers
>
> On Tue, May 28, 2013 at 3:23 PM, Shahab Yunus <sh...@gmail.com>wrote:
>
>> Is there a faster way to get the count of rows in a HBase table
>> (potentially a huge one)? I am looking for ways other than the 'count'
>> shell command or any Pig script? Thanks.
>>
>> Regards,
>> Shahab
>>

Re: Couting number of records in a HBase table

Posted by James Taylor <jt...@salesforce.com>.
Another option is Phoenix (https://github.com/forcedotcom/phoenix), 
where you'd do
     SELECT count(*) FROM my_table

Regards,
James

On 05/28/2013 03:25 PM, Ted Yu wrote:
> Take a look at http://hbase.apache.org/book.html#rowcounter
>
> Cheers
>
> On Tue, May 28, 2013 at 3:23 PM, Shahab Yunus <sh...@gmail.com>wrote:
>
>> Is there a faster way to get the count of rows in a HBase table
>> (potentially a huge one)? I am looking for ways other than the 'count'
>> shell command or any Pig script? Thanks.
>>
>> Regards,
>> Shahab
>>


Re: Couting number of records in a HBase table

Posted by Ted Yu <yu...@gmail.com>.
Take a look at http://hbase.apache.org/book.html#rowcounter

Cheers

On Tue, May 28, 2013 at 3:23 PM, Shahab Yunus <sh...@gmail.com>wrote:

> Is there a faster way to get the count of rows in a HBase table
> (potentially a huge one)? I am looking for ways other than the 'count'
> shell command or any Pig script? Thanks.
>
> Regards,
> Shahab
>