Ankit Arnon user1573269
The only way to make it work as below
So - I have a table with columns rule1, rule2, rule3 and so on. Rows can only have a column rule1, or rule1 and rule2, or rule1 and rule2 and rule3 etc. Let's say I want to extract rows that contain ONLY rule1. Now this means that I will have to skip lines that have a rule2.
Scan getRules = new Scan(); ColumnPrefixFilter rule1Filter = new ColumnPrefixFilter(Bytes.toBytes("rule1")); SingleColumnValueFilter skipRule2Value = new SingleColumnValueFilter(Bytes.toBytes("rules"),Bytes.toBytes("rule2"), CompareOp.EQUAL,Bytes.toBytes("0")); SkipFilter skipRule2 = new SkipFilter(skipRule2Value); getRules.setFilter(rule1Filter); getRules.setFilter(skipRule2); ResultScanner scanner = htable.getScanner(getRules);
Although this worked, I am not very happy with the solution. It takes time to determine hbase. I would think that there should be a simpler simple method that should not check the value. Arnon, your method does not work, because SkipFilter skips those that DONOT satisfy the condition. Therefore, building it from a ColumnPrefixFilter does not meet the requirements.
source share