hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sreeram K <sreeram...@yahoo.com>
Subject Re: HBase- Scan with wildcard character
Date Tue, 13 Dec 2011 22:16:14 GMT
Thanks Doug. I am looking more from HBase shell for this.


----- Original Message -----
From: Doug Meil <doug.meil@explorysmedical.com>
To: "user@hbase.apache.org" <user@hbase.apache.org>; Sreeram K <sreeramk86@yahoo.com>;
lars hofhansl <lhofhansl@yahoo.com>
Cc: 
Sent: Tuesday, December 13, 2011 2:01 PM
Subject: Re: HBase- Scan with wildcard character


Hi there-

At some point you're probably going to want to get out of the shell, take
a look at this...

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






On 12/13/11 4:43 PM, "Sreeram K" <sreeramk86@yahoo.com> wrote:

>Thanks Lars. I am looking into that.
>
>Is there a way we can search all the entries starting  with 565HGOUO and
>print all the rows?
>
>Example:
>scan 'SAMPLE_TABLE' ,{COLUMNS
>=>['sample_info:FILENAME','event_info:FILENAME'],STARTROW=>'sample1%'}
>
>I am seeing all the Rows and information after that sample1% row in the
>DB.
>if for instance I have extra1rowid after sample1%, I am able to see that
>also.
>
>I am looking for a query to print only the rows which has Rowid starting
>with sample1%.
>
>can you let me know if we can get a query like that on hbase shell
>
>
>
>----- Original Message -----
>From: lars hofhansl <lhofhansl@yahoo.com>
>To: "user@hbase.apache.org" <user@hbase.apache.org>; Sreeram K
><sreeramk86@yahoo.com>
>Cc: 
>Sent: Tuesday, December 13, 2011 11:36 AM
>Subject: Re: HBase- Scan with wildcard character
>
>info:regioninfo is actually a serialized Java object (HRegionInfo). What
>you see in the shell the result of HRegionInfo.toString(), which looks
>like a 
>
>ruby object, but it is really just a string (see HRegionInfo.toString()).
>
>
>
>________________________________
>From: Sreeram K <sreeramk86@yahoo.com>
>To: "user@hbase.apache.org" <user@hbase.apache.org>; lars hofhansl
><lhofhansl@yahoo.com>
>Sent: Tuesday, December 13, 2011 12:16 AM
>Subject: Re: HBase- Scan with wildcard character
>
>Thanks Lars, I will look into that .
>
>one more question: on hbase shell.
>
>If I have :
>           hbase> scan 't1.', {COLUMNS => 'info:regioninfo'}  , it is
>printing all the colums of regioninfo.
>
>
>can I have a condition like:if colum,info.regioninfo=2 (value) than print
>all the associated columns like info:regioninfo1, regioninfo2.
>
>
>
>----- Original Message -----
>From: lars hofhansl <lhofhansl@yahoo.com>
>To: "user@hbase.apache.org" <user@hbase.apache.org>; Sreeram K
><sreeramk86@yahoo.com>
>Cc: 
>Sent: Monday, December 12, 2011 10:45 PM
>Subject: Re: HBase- Scan with wildcard character
>
>First off, what you want is:   select * from table where id like
>'4E1167677%'   in MySQL.
>Relational databases can typically use indexes to satisfy like "xxx%"
>type queries, but not "%xxx%" queries.
>
>HBase is really good at "xxx%" (prefix) type queries.
>
>Just create a scan object, set the startkey to "4E1167677", then call
>next resulting scanner until the returned key no longer start with
>"4E1167677".
>
>In your particular case (since your keys are hex numbers), you can even
>set the stopKey to "4E1167677z" (the z will sort after any valid hex
>digit),
>and the scanner will automatically stop at the last possible match.
>
>
>Have a look at the the Scan object and HTable.getScanner(...)
>
>
>-- Lars
>
>
>----- Original Message -----
>From: Sreeram K <sreeramk86@yahoo.com>
>To: "user@hbase.apache.org" <user@hbase.apache.org>
>Cc: 
>Sent: Monday, December 12, 2011 6:58 PM
>Subject: HBase- Scan with wildcard character
>
>Hi,
>
>I have a Table defined with the 3 columns.
>I am looking for a query in HBase shell to print all the values starting
>with some characters in Rowkey.
>
>Example:
>My rowids are:Coulm+Key
>4E11676773AC3B6E9A3FE1CCD1051B8C&1323736118749497
>colum=xxxxxx:size,timestamp=67667767,value=
>
>4E11676773AC3B6E9A3FE1CCD1051B8C&132373611874988
>colum=11xxxxx:size,timestamp=67667767,value=
>
>4E11676773AC3B6E9A3FE1CCD1051B8C&132373611565656
>colum=1xxxxxx:size,timestamp=67667767,value=
>
>
>Something similar to mysql => select * from table where id='%4E1167677%'
>
>do we have any command like this in the HBase shell - Scan with wild
>characters?
>
>(or) should we end up using HIVE ? what are the other options?
>
>Can you please let me know.
>
>-Sreeram 
>

Mime
View raw message