Performing a scan with

start row = 20100809041500_abd
end row = 20100809041500_abe

will give you just that. The end row is exclusive, so it will only return rows 
with VAR1 = abd. You need to compute the 'abe' yourself, though (which is 
basically taking 'abd' and increasing the right most byte by 1 unless it's at 
max byte value, then set it to 0 and increase the byte left to that by 1, 
etc.). There is no scan method that has 'starts with' semantics, AFAIK.

See here: 
http://hbase.apache.org/docs/r0.89.20100924/apidocs/org/apache/hadoop/hbase/client/Scan.html#Scan(byte[],
 
byte[])<http://hbase.apache.org/docs/r0.89.20100924/apidocs/org/apache/hadoop/hbase/client/Scan.html#Scan(byte%5B%5D,%20byte%5B%5D)>


Friso




On 20 jan 2011, at 09:22, Shuja Rehman wrote:

Hi
Consider the following scenario.

Row Key  Format = DATETIME_VAR1_VAR2 (where var1 and var2 have fixed
lengths)

and example data could be

20100809041500_abc_xyz
20100809041500_abc_xyw
20100809041500_abc_xyc
*20100809041500_abd_xyz*
20100809041500_abd_xyw
20100809041500_abf_xyz
...

Now if i want to get the rows which only have this row key
20100809041500_abd then is there anyway to achieve through scan without
using filter because if i use filter scan(startrow, filter) where
startrow="20100809041500_abd" then it will scan whole table from start key
to end of table. i want to just scan that part of table which i require. So
if there is any method like this

scan(row)  where row ="20100809041500_abd"  and it just return the following
results

20100809041500_abd_xyz
20100809041500_abd_xyw

Kindly let me know whether it is achievable or not?
thnx
--
Regards
Shuja-ur-Rehman Baig
<http://pk.linkedin.com/in/shujamughal>

Reply via email to