You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by hua beatls <be...@gmail.com> on 2013/01/04 19:23:04 UTC

how to get the record number from hbase

Hi,
     is there any easy way to know how many records in the hbase, hive or
coprocessor?

     Thanks!

     beatls

Re: how to get the record number from hbase

Posted by Jean-Marc Spaggiari <je...@spaggiari.org>.
Hi Hua,

The record number is not an information stored with the row itself. So
the idea here is to count how many rows are there before the one you
are looking at.

And if you insert one or some before, you will have to recount. At the
end, this can be still a costly information.

Are you sure you can't use something else for your usecase?

JM

2013/1/5, Alok Kumar <al...@gmail.com>:
> Hi,
>
> See here https://blogs.apache.org/hbase/entry/coprocessor_introduction for
> Coprocessor Introduction.
> It's the first place you should look for . It has couple of example as well
>
>
> **Happy New Year**
>
> Regards,
> Alok
>
>
>
>
> On Sat, Jan 5, 2013 at 12:42 PM, hua beatls <be...@gmail.com> wrote:
>
>> Hi,
>>    do you have any guide about copreccesor? how to use it?
>>
>>
>>    Thanks!
>>
>>     beatls
>>
>> On Sat, Jan 5, 2013 at 8:51 AM, Azuryy Yu <az...@gmail.com> wrote:
>>
>> > Coprocessor: rowcount
>>
>
>
>
> --
> Alok Kumar
>

Re: how to get the record number from hbase

Posted by Alok Kumar <al...@gmail.com>.
Hi,

See here https://blogs.apache.org/hbase/entry/coprocessor_introduction for
Coprocessor Introduction.
It's the first place you should look for . It has couple of example as well


**Happy New Year**

Regards,
Alok




On Sat, Jan 5, 2013 at 12:42 PM, hua beatls <be...@gmail.com> wrote:

> Hi,
>    do you have any guide about copreccesor? how to use it?
>
>
>    Thanks!
>
>     beatls
>
> On Sat, Jan 5, 2013 at 8:51 AM, Azuryy Yu <az...@gmail.com> wrote:
>
> > Coprocessor: rowcount
>



-- 
Alok Kumar

Re: how to get the record number from hbase

Posted by hua beatls <be...@gmail.com>.
Hi,
   do you have any guide about copreccesor? how to use it?


   Thanks!

    beatls

On Sat, Jan 5, 2013 at 8:51 AM, Azuryy Yu <az...@gmail.com> wrote:

> Coprocessor: rowcount

Re: how to get the record number from hbase

Posted by 周梦想 <ab...@gmail.com>.
hi hua,
using command

$ bin/hbase org.apache.hadoop.hbase.mapreduce.RowCounter <tablename>
[<column1> <column2>...]

it will report you the ROWS.
or you can write a MapReduce tool yourself to count the rows.

or you can run command in hbase shell:
hbase(main):005:0> scan 't1',FILTER=>"FirstKeyOnlyFilter()"
...
6 row(s) in 0.0730 seconds
this is a alternative choice for row count.

see HBase Reference Guide Chinese version: http://abloz.com/hbase/book.html

Andy

2013/1/5 Azuryy Yu <az...@gmail.com>

> using Coprocessor: rowcount
>
>
> On Sat, Jan 5, 2013 at 2:23 AM, hua beatls <be...@gmail.com> wrote:
>
> > Hi,
> >      is there any easy way to know how many records in the hbase, hive or
> > coprocessor?
> >
> >      Thanks!
> >
> >      beatls
> >
>

Re: how to get the record number from hbase

Posted by Azuryy Yu <az...@gmail.com>.
using Coprocessor: rowcount


On Sat, Jan 5, 2013 at 2:23 AM, hua beatls <be...@gmail.com> wrote:

> Hi,
>      is there any easy way to know how many records in the hbase, hive or
> coprocessor?
>
>      Thanks!
>
>      beatls
>