简体   繁体   English

HBASE行前缀在hbase中以相反的顺序扫描

[英]HBASE row prefix scan in reverse order in hbase

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 .使用 HBASE shell 我想找到带有前缀的最后 15 个条目。

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

Gives me the first 15, but:给了我前 15 个,但是:

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?是否有可能,或者我必须做一些俗气的事情,比如使用 MAXINT-timestamp 作为我的行键来手动反转键排序?

I can execute your query command in HBase shell environment, and get the expected result.我可以在 HBase shell 环境中执行你的查询命令,并得到预期的结果。 But couldn't get any result throw Java Client.但是无法得到任何结果抛出 Java 客户端。 My HBase version is 0.98.我的 HBase 版本是 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使用带有 reversed = true 的 HBase 客户端扫描时有一个错误,请参阅此 jira 问题hbase-client:scanner with reversed=true and small=true get no result

Yes, I reproduced this issue, and my result was the same.是的,我重现了这个问题,我的结果是一样的。

The workaround I used was to change ROWPREFILTER to STARTROW and ENDROW .我使用的解决方法是将ROWPREFILTER更改为STARTROWENDROW

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM