我正在尝试从 HBase 表中过滤行(我正在使用 HappyBase),具体来说,我正在尝试获取“id”小于 1000 的行:
for key, data in graph_table.scan(filter="SingleColumnValueFilter('cf', 'id', <, 'binary:1000')"):
print key, data
结果如下:
<http://ieee.rkbexplorer.com/id/publication-d2a6837e67d808b41ffe6092db50f7cc> {'cf:type': 'v', 'cf:id': '100', 'cf:label': '<http://www.aktors.org/ontology/portal#Proceedings-Paper-Reference>'}
<http://www.aktors.org/ontology/date#1976> {'cf:type': 'v', 'cf:id': '1', 'cf:label': '<http://www.aktors.org/ontology/support#Calendar-Date>'}
<http://www.aktors.org/ontology/date#1985> {'cf:type': 'v', 'cf:id': '10', 'cf:label': '<http://www.aktors.org/ontology/support#Calendar-Date>'}
在表中有从 1 到 1000 的“id”行。如果我使用 HBase Java 库在 Java 中对此进行编码,它可以正常工作,使用 Byte.toBytes() 函数解析整数值。
谢谢你。