hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: question on Scan.setStopRow
Date Mon, 13 Sep 2010 17:37:22 GMT
On Mon, Sep 13, 2010 at 10:07 AM, John Sichi <jsichi@facebook.com> wrote:
> Hey hbasers,
>
> I'm working on pushing predicates down from Hive, and starting with a very basic case
(equality on a simple key).  This ends up looking like a get, but for now it still uses TableInputFormatBase
since later we'll be extending it to range scans as well.
>
> After converting the key to byte [] startRow, I do the following, since stopRow is exclusive
rather than inclusive:
>
>    byte [] stopRow = new byte[startRow.length + 1];
>    System.arraycopy(startRow, 0, stopRow, 0, startRow.length);
>    scan.setStartRow(startRow);
>    scan.setStopRow(stopRow);
>
> I just wanted to confirm
>
> (a) Is this the correct way to create a stopRow for a point lookup (appending a single
zero byte to make the successor lexical value)?
>


That looks like it should work.

You've seen InclusiveStopFilter?


> (b) Do I also need a WhileMatchFilter, or is setStartRow+setStopRow guaranteed to do
all the filtering directly?
>

You don't need to add filters if you are using setStartRow,
setStopRow.  Internally they do the business themselves [1].

Let us know if it gives you trouble John,
St.Ack

1. The 'business' is performed in the HRegion scanner.  Here is where
it is created http://hbase.apache.org/docs/r0.89.20100726/xref/org/apache/hadoop/hbase/regionserver/HRegion.html#2299
 Here in the internal 'next' on the region scanner is where it acts on
stop row: http://hbase.apache.org/docs/r0.89.20100726/xref/org/apache/hadoop/hbase/regionserver/HRegion.html#2394

Mime
View raw message