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 <[email protected]>
To: "[email protected]" <[email protected]>; Sreeram K
<[email protected]>
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 <[email protected]>
To: "[email protected]" <[email protected]>; lars hofhansl
<[email protected]>
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 <[email protected]>
To: "[email protected]" <[email protected]>; Sreeram K
<[email protected]>
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 <[email protected]>
To: "[email protected]" <[email protected]>
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