在HBase中以相反的顺序扫描HBASE行前缀 [英] HBASE row prefix scan in reverse order in hbase
问题描述
我有以下格式的行键:
<name>--<zero-padded timestamp>
使用HBASE shell,我想找到带有前缀.的最后15个条目.
Using HBASE shell I want to find last 15 entries with the prefix .
scan 'mytable', {LIMIT => 15, ROWPREFIXFILTER => 'name' }
给我前15个,但是:
scan 'mytable', {LIMIT => 15, REVERSED => TRUE, ROWPREFIXFILTER => 'name'}
返回零结果...
这种请求的语法是什么?
What is the syntax for such a request?
是否有可能,还是我需要做一些俗气的事情,例如将MAXINT-timestamp用作我的行键来手动反转键的顺序?
Is it possible, or do I have to do something cheesy like use MAXINT-timestamp as my rowkey to manually reverse the key ordering?
推荐答案
我可以在HBase Shell环境中执行您的查询命令,并获得预期的结果.但是无法获得任何结果抛出Java Client.我的HBase版本是0.98.
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.
在将HBase客户端扫描与reversed = true一起使用时出现错误,请参见此jira问题
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
这篇关于在HBase中以相反的顺序扫描HBASE行前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!