Filter filter = getHBaseStorageFilter("cf1:a cf1:b cf2:foo*");
List<Filter> childFilters = assertFilterList(filter, FilterList.Operator.MUST_PASS_ALL, 1);
List<Filter> groupFilters = assertFilterList(childFilters.get(0), FilterList.Operator.MUST_PASS_ONE, 2);
List<Filter> firstFilters = assertFilterList(groupFilters.get(0), FilterList.Operator.MUST_PASS_ALL, 2);
FamilyFilter firstFamilyFilter = assertFamilyFilter(firstFilters.get(0), CompareFilter.CompareOp.EQUAL);
List<Filter> secondFilters = assertFilterList(groupFilters.get(1), FilterList.Operator.MUST_PASS_ALL, 2);
FamilyFilter secondFamilyFilter = assertFamilyFilter(secondFilters.get(0), CompareFilter.CompareOp.EQUAL);
// one of the above will be the cf1 filters, one will be the cf2. Order is unknown
Filter cf1ColumnList;
Filter cf2ColumnList;
if (Bytes.toString(firstFamilyFilter.getComparator().getValue()).equals("cf1")) {
assertEquals("cf2", Bytes.toString(secondFamilyFilter.getComparator().getValue()));
cf1ColumnList = firstFilters.get(1);
cf2ColumnList = secondFilters.get(1);
}
else {
assertEquals("cf1", Bytes.toString(secondFamilyFilter.getComparator().getValue()));
assertEquals("cf2", Bytes.toString(firstFamilyFilter.getComparator().getValue()));
cf1ColumnList = secondFilters.get(1);
cf2ColumnList = firstFilters.get(1);
}