目的:查询多个rowkey(比如200个),并过滤出值中包含某个关键字的
可以单独查询每一个rowkey
<Scanner batch="1000">
<filter>
{
"type": "FilterList",
"op": "MUST_PASS_ALL",
"filters": [
{
"latestVersion":true, "ifMissing":true,
"op":"EQUAL", "type":"RowFilter",
"comparator":{"value":"enpjTzRXTjIwbDJlMTZFNkhpNEY=","type":"BinaryComparator"}
},
{
"latestVersion":true, "ifMissing":true,
"op":"EQUAL", "type":"SingleColumnValueFilter",
"family":"Zg==","qualifier":"bA==",
"comparator":{"value":"zzcO4WN20l2e16E6Hi4F","type":"SubstringComparator"}
}
}
</filter>
</Scanner>
但是这种方式要循环查询每一个rowkey效率低
查询所有的这些rowkey,怎么能过滤到值呢?
<Scanner batch="1000">
<filter>
{
"type": "FilterList",
"op": "MUST_PASS_ONE",
"filters": [
{
"latestVersion":true, "ifMissing":true,
"op":"EQUAL", "type":"RowFilter",
"comparator":{"value":"enpjTzRXTjIwbDJlMTZFNkhpNEY=","type":"BinaryComparator"}
},
{
"latestVersion":true, "ifMissing":true,
"op":"EQUAL", "type":"RowFilter",
"comparator":{"value":"aaaaTzRXTjIwbDJlMTZFNkhpNEY=","type":"BinaryComparator"}
}
}
</filter>
</Scanner>
如果使用MultiRowRangeFilter应该可以比较好的解决,但是一直没有找到rest api查询的语句
<Scanner batch="1000">
<filter>
{
"type": "FilterList",
"op": "MUST_PASS_All",
"filters": [
{
"latestVersion":true, "ifMissing":true,
"type":"MultiRowRangeFilter".....
},
{
"latestVersion":true, "ifMissing":true,
"op":"EQUAL", "type":"SingleColumnValueFilter",
"family":"Zg==","qualifier":"bA==",
"comparator":{"value":"zzcO4WN20l2e16E6Hi4F","type":"SubstringComparator"}
}
}
</filter>
</Scanner>
|