It's more about the question missing information, like an example
output of your query and a sample of your dataset. Also you are using
0.20.2, which 4 minor revisions old.
So I tried a simple test in the shell using HBase 0.20.2 just as a sanity check:
hbase(main):005:0> scan 't'
ROW COLUMN+CELL
1 column=f:, timestamp=1283271502185,
value=val1
2 column=f:, timestamp=1283271507825,
value=val2
3 column=f:, timestamp=1283271512665,
value=val3
3 row(s) in 0.0300 seconds
hbase(main):006:0> scan 't', {STARTROW => '2'}
ROW COLUMN+CELL
2 column=f:, timestamp=1283271507825,
value=val2
3 column=f:, timestamp=1283271512665,
value=val3
As you can see it works, under the hood it calls exactly the same
method. Are your keys sorted the way you think they are?
J-D
On Tue, Aug 31, 2010 at 9:06 AM, Kelvin Rawls <[email protected]> wrote:
> It seems my question is not clear:
>
> does this call:
>
> scan.setStartRow(Bytes.toBytes(lastDoc))
>
> .. have any effect on rows returned for anyone else?
>
> Thanks,
>
> Kelvin
> ________________________________________
> From: Kelvin Rawls [[email protected]]
> Sent: Monday, August 30, 2010 11:25 AM
> To: [email protected]
> Subject: Scan startRow seems to be broke in HBase 0.20.2
>
> No matter what I tell it, this seems to return Row IDs from the beginning of
> the table.
>
> code
>
> public List<String> getKeys(String lastDoc, int N) {
> List<String> results = new ArrayList<String>();
> try {
> Scan scan = new Scan();
> scan.setStartRow(Bytes.toBytes(lastDoc));
> StringBuilder regExp = new StringBuilder();
> regExp.append("MYROWFLAGTRUE");
> SingleColumnValueFilter scvf = new
> SingleColumnValueFilter("MYROW".getBytes(),
> "FLAG".getBytes(), CompareFilter.CompareOp.EQUAL,
> new RegexStringComparator(regExp.toString()));
> scvf.setFilterIfMissing(true);
> scan.setFilter(scvf);
> ResultScanner scanner = table.getScanner(scan);
> for (Result rr : scanner.next(N)) {
> String next_str = Bytes.toString(rr.getRow());
> results.add(next_str);
> }
> scanner.close();
> } catch (IOException ex) {
> m_log.error("Error getting keys", ex);
> }
> m_log.debug("Returning " + results.size() + " ids");
> return results;
> }
>
> Thanks for any help.
>
> Kelvin L. Rawls
>
> 410-290-6240, office
> 301-221-1308, cell
> 703 741-3120, fax
> www.iswcorp.com
>