4

I have a row key of the form:

<name>--<zero-padded timestamp>

Using HBASE shell I want to find last 15 entries with the prefix .

scan 'mytable', {LIMIT => 15, ROWPREFIXFILTER => 'name' }

Gives me the first 15, but:

scan 'mytable', {LIMIT => 15, REVERSED => TRUE, ROWPREFIXFILTER => 'name'}

returns zero results...

What is the syntax for such a request?

Is it possible, or do I have to do something cheesy like use MAXINT-timestamp as my rowkey to manually reverse the key ordering?

tanbog
  • 600
  • 9
  • 28

2 Answers2

3

I can execute your query command in HBase shell environment, and get the expected result. But couldn't get any result throw Java Client. My HBase version is 0.98.

There is a bug when use HBase client scan with reversed = true, see this jira issue hbase-client: scanner with reversed=true and small=true get no result

Armstrongya
  • 795
  • 1
  • 6
  • 9
0

Yes, I reproduced this issue, and my result was the same.

The workaround I used was to change ROWPREFILTER to STARTROW and ENDROW.

chb
  • 1,727
  • 7
  • 25
  • 47