use of com.linkedin.pinot.core.operator.blocks.BaseFilterBlock in project pinot by linkedin.
the class BitmapBasedFilterOperator method nextFilterBlock.
@Override
public BaseFilterBlock nextFilterBlock(BlockId BlockId) {
InvertedIndexReader invertedIndex = dataSource.getInvertedIndex();
Block dataSourceBlock = dataSource.nextBlock();
int[] dictionaryIds;
boolean exclusion = false;
switch(predicate.getType()) {
case EQ:
case IN:
case RANGE:
dictionaryIds = predicateEvaluator.getMatchingDictionaryIds();
break;
case NEQ:
case NOT_IN:
exclusion = true;
dictionaryIds = predicateEvaluator.getNonMatchingDictionaryIds();
break;
case REGEX:
default:
throw new UnsupportedOperationException("Regex is not supported");
}
ImmutableRoaringBitmap[] bitmaps = new ImmutableRoaringBitmap[dictionaryIds.length];
for (int i = 0; i < dictionaryIds.length; i++) {
bitmaps[i] = invertedIndex.getImmutable(dictionaryIds[i]);
}
bitmapBlock = new BitmapBlock(dataSource.getOperatorName(), dataSourceBlock.getMetadata(), startDocId, endDocId, bitmaps, exclusion);
return bitmapBlock;
}
Aggregations