use of com.linkedin.pinot.core.operator.filter.AndOperator in project pinot by linkedin.
the class AndOperatorTest method testIntersectionForTwoLists.
@Test
public void testIntersectionForTwoLists() {
int[] list1 = new int[] { 2, 3, 10, 15, 16, 28 };
int[] list2 = new int[] { 3, 6, 8, 20, 28 };
List<BaseFilterOperator> operators = new ArrayList<>();
operators.add(makeFilterOperator(list1));
operators.add(makeFilterOperator(list2));
final AndOperator andOperator = new AndOperator(operators);
andOperator.open();
BaseFilterBlock block;
while ((block = andOperator.getNextBlock()) != null) {
final BlockDocIdSet blockDocIdSet = block.getBlockDocIdSet();
final BlockDocIdIterator iterator = blockDocIdSet.iterator();
int docId;
while ((docId = iterator.next()) != Constants.EOF) {
// System.out.println(docId);
}
}
andOperator.close();
}
Aggregations