You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Rita <rm...@gmail.com> on 2011/10/05 09:29:44 UTC

range query

Hello,

I have a simple table where the data looks like this,

key,value
2011-01-01.foo,data01
2011-01-02.foo,data02
2011-01-03.foo,data03
2011-01-04.foo,data04
2011-01-05.foo,data05
2011-01-05.foo,data06

Does anyone have any example code to perform a range query like, get all
values for keys which has a range from [2011-01-03.foo to 2011-01-05.foo]?
The expected answer should be:

data03
date04
data05





-- 
--- Get your facts first, then you can distort them as you please.--

Re: range query

Posted by Stack <sa...@gmail.com>.
Regex is going to be more expensive than checking bytes or comparing longs.   But I wouldn't worry about it at least till you finger the regexing as perf prob



On Oct 5, 2011, at 15:42, Rita <rm...@gmail.com> wrote:

> Thanks. This worked like a charm.
> 
> Is it common to use regex for timeseries or is there a more elegant way of
> handling it?
> 
> 
> On Wed, Oct 5, 2011 at 8:39 AM, Doug Meil <do...@explorysmedical.com>wrote:
> 
>> 
>> Hi there-
>> 
>> Check out the Hbase book...
>> 
>> http://hbase.apache.org/book.html#scan
>> 
>> 
>> 
>> 
>> On 10/5/11 3:29 AM, "Rita" <rm...@gmail.com> wrote:
>> 
>>> Hello,
>>> 
>>> I have a simple table where the data looks like this,
>>> 
>>> key,value
>>> 2011-01-01.foo,data01
>>> 2011-01-02.foo,data02
>>> 2011-01-03.foo,data03
>>> 2011-01-04.foo,data04
>>> 2011-01-05.foo,data05
>>> 2011-01-05.foo,data06
>>> 
>>> Does anyone have any example code to perform a range query like, get all
>>> values for keys which has a range from [2011-01-03.foo to 2011-01-05.foo]?
>>> The expected answer should be:
>>> 
>>> data03
>>> date04
>>> data05
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> --- Get your facts first, then you can distort them as you please.--
>> 
>> 
> 
> 
> -- 
> --- Get your facts first, then you can distort them as you please.--

Re: range query

Posted by Rita <rm...@gmail.com>.
Thanks. This worked like a charm.

Is it common to use regex for timeseries or is there a more elegant way of
handling it?


On Wed, Oct 5, 2011 at 8:39 AM, Doug Meil <do...@explorysmedical.com>wrote:

>
> Hi there-
>
> Check out the Hbase book...
>
> http://hbase.apache.org/book.html#scan
>
>
>
>
> On 10/5/11 3:29 AM, "Rita" <rm...@gmail.com> wrote:
>
> >Hello,
> >
> >I have a simple table where the data looks like this,
> >
> >key,value
> >2011-01-01.foo,data01
> >2011-01-02.foo,data02
> >2011-01-03.foo,data03
> >2011-01-04.foo,data04
> >2011-01-05.foo,data05
> >2011-01-05.foo,data06
> >
> >Does anyone have any example code to perform a range query like, get all
> >values for keys which has a range from [2011-01-03.foo to 2011-01-05.foo]?
> >The expected answer should be:
> >
> >data03
> >date04
> >data05
> >
> >
> >
> >
> >
> >--
> >--- Get your facts first, then you can distort them as you please.--
>
>


-- 
--- Get your facts first, then you can distort them as you please.--

Re: range query

Posted by Doug Meil <do...@explorysmedical.com>.
Hi there-

Check out the Hbase book...

http://hbase.apache.org/book.html#scan




On 10/5/11 3:29 AM, "Rita" <rm...@gmail.com> wrote:

>Hello,
>
>I have a simple table where the data looks like this,
>
>key,value
>2011-01-01.foo,data01
>2011-01-02.foo,data02
>2011-01-03.foo,data03
>2011-01-04.foo,data04
>2011-01-05.foo,data05
>2011-01-05.foo,data06
>
>Does anyone have any example code to perform a range query like, get all
>values for keys which has a range from [2011-01-03.foo to 2011-01-05.foo]?
>The expected answer should be:
>
>data03
>date04
>data05
>
>
>
>
>
>-- 
>--- Get your facts first, then you can distort them as you please.--