简体   繁体   中英

HBase: how to filter by “key not start with”

using PrefixFilter("word") it is possible to filter all keys which start with "word". I am trying to get the opposite, all key which not start with "word".

Is it a filter which ,match to my requirement? If I will need to create a Filter from my own, will it work? ( I am not sure if the HBase scanner supports new filters)

I manage to achieve the same behavior using RowFilter and RegexStringComparator classes ie:

RowFilter prefixFilter = new RowFilter(CompareFilter.CompareOp.NOT_EQUAL,
 new RegexStringComparator("word"+"[\\S]+"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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