HBASE row prefix scan in reverse order in hbase

纵然是瞬间 提交于 2019-12-07 22:27:59

问题


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?


回答1:


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




回答2:


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

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



来源:https://stackoverflow.com/questions/39772832/hbase-row-prefix-scan-in-reverse-order-in-hbase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!