hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Washusen <...@reactive.org>
Subject Re: searching values in hbase tables
Date Fri, 12 Feb 2010 20:42:50 GMT
Comments also inline...

On 13 February 2010 03:15, Jean-Daniel Cryans <jdcryans@apache.org> wrote:

> Inline.
>
> J-D
>
> On Fri, Feb 12, 2010 at 5:38 AM, Muhammad Mudassar <mudassark7@gmail.com
> >wrote:
>
> > Hi
> > I have hbase table with 3 column families and some number of rows stored
> in
> > it here I want to ask that how I can search values from the table (like
> > select name from employee where age='35': query of sql ) using api in
> java
> > some code would be helpful.
> >
>
> There's no support for secondary indexes in HBase core, you need you use
> one
> of the contribs. 2 are available in 0.20.3, you can have a look at them by
> looking at src/contrib/indexed and src/contrib/transactional. Another
> option
> is maintaining the indexes yourself.
>

To perform the 'query' you're after you'll need to use a
org.apache.hadoop.hbase.client.Scan along with a
org.apache.hadoop.hbase.filter.SingleColumnValueFilter.  As Jean-Daniel
implies, this isn't quick.  It's like performing a SQL query on a column
that isn't indexed.  The more data you have the longer it will take...


>
>
> > i am having problem to define row keys curently i am using numbers like
> > 1,2,3..... for each row which i have implemented using a loop which
> > increments integer variable used as row key each time i have to inser
> data
> > in table is there any way to generate saperat row key each time data
> > insertion is performed.
> >
>
> Inserting row keys with an incremental ID is usually not a good idea since
> sequential writing is usually slower than random writing. If you can't find
> a natural row key (which is good for scans), use a UUID.
>
>
> >
> > Thanks
> >
> > Mhammad Mudassar
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message