Search in sources :

Example 1 with FilterBlockDocIdSet

use of com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet in project pinot by linkedin.

the class OrOperator method nextFilterBlock.

@Override
public BaseFilterBlock nextFilterBlock(BlockId BlockId) {
    List<FilterBlockDocIdSet> blockDocIdSets = new ArrayList<FilterBlockDocIdSet>();
    for (Operator operator : operators) {
        Block block = operator.nextBlock();
        FilterBlockDocIdSet blockDocIdSet = (FilterBlockDocIdSet) block.getBlockDocIdSet();
        blockDocIdSets.add(blockDocIdSet);
    }
    orBlock = new OrBlock(blockDocIdSets);
    return orBlock;
}
Also used : Operator(com.linkedin.pinot.core.common.Operator) OrBlock(com.linkedin.pinot.core.operator.blocks.OrBlock) ArrayList(java.util.ArrayList) OrBlock(com.linkedin.pinot.core.operator.blocks.OrBlock) Block(com.linkedin.pinot.core.common.Block) BaseFilterBlock(com.linkedin.pinot.core.operator.blocks.BaseFilterBlock) FilterBlockDocIdSet(com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet)

Example 2 with FilterBlockDocIdSet

use of com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet in project pinot by linkedin.

the class ScanBasedFilterOperator method nextFilterBlock.

@Override
public BaseFilterBlock nextFilterBlock(BlockId BlockId) {
    DataSourceMetadata dataSourceMetadata = dataSource.getDataSourceMetadata();
    FilterBlockDocIdSet docIdSet;
    Block nextBlock = dataSource.nextBlock();
    BlockValSet blockValueSet = nextBlock.getBlockValueSet();
    BlockMetadata blockMetadata = nextBlock.getMetadata();
    if (dataSourceMetadata.isSingleValue()) {
        docIdSet = new ScanBasedSingleValueDocIdSet(dataSource.getOperatorName(), blockValueSet, blockMetadata, predicateEvaluator);
    } else {
        docIdSet = new ScanBasedMultiValueDocIdSet(dataSource.getOperatorName(), blockValueSet, blockMetadata, predicateEvaluator);
    }
    if (startDocId != null) {
        docIdSet.setStartDocId(startDocId);
    }
    if (endDocId != null) {
        docIdSet.setEndDocId(endDocId);
    }
    return new ScanBlock(docIdSet);
}
Also used : DataSourceMetadata(com.linkedin.pinot.core.common.DataSourceMetadata) ScanBasedSingleValueDocIdSet(com.linkedin.pinot.core.operator.docidsets.ScanBasedSingleValueDocIdSet) BlockMetadata(com.linkedin.pinot.core.common.BlockMetadata) Block(com.linkedin.pinot.core.common.Block) BaseFilterBlock(com.linkedin.pinot.core.operator.blocks.BaseFilterBlock) BlockValSet(com.linkedin.pinot.core.common.BlockValSet) FilterBlockDocIdSet(com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet) ScanBasedMultiValueDocIdSet(com.linkedin.pinot.core.operator.docidsets.ScanBasedMultiValueDocIdSet)

Example 3 with FilterBlockDocIdSet

use of com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet in project pinot by linkedin.

the class AndOperator method nextFilterBlock.

@Override
public BaseFilterBlock nextFilterBlock(BlockId BlockId) {
    List<FilterBlockDocIdSet> blockDocIdSets = new ArrayList<FilterBlockDocIdSet>();
    for (Operator operator : operators) {
        Block block = operator.nextBlock();
        FilterBlockDocIdSet blockDocIdSet = (FilterBlockDocIdSet) block.getBlockDocIdSet();
        blockDocIdSets.add(blockDocIdSet);
    }
    andBlock = new AndBlock(blockDocIdSets);
    return andBlock;
}
Also used : Operator(com.linkedin.pinot.core.common.Operator) AndBlock(com.linkedin.pinot.core.operator.blocks.AndBlock) ArrayList(java.util.ArrayList) AndBlock(com.linkedin.pinot.core.operator.blocks.AndBlock) Block(com.linkedin.pinot.core.common.Block) BaseFilterBlock(com.linkedin.pinot.core.operator.blocks.BaseFilterBlock) FilterBlockDocIdSet(com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet)

Aggregations

Block (com.linkedin.pinot.core.common.Block)3 BaseFilterBlock (com.linkedin.pinot.core.operator.blocks.BaseFilterBlock)3 FilterBlockDocIdSet (com.linkedin.pinot.core.operator.docidsets.FilterBlockDocIdSet)3 Operator (com.linkedin.pinot.core.common.Operator)2 ArrayList (java.util.ArrayList)2 BlockMetadata (com.linkedin.pinot.core.common.BlockMetadata)1 BlockValSet (com.linkedin.pinot.core.common.BlockValSet)1 DataSourceMetadata (com.linkedin.pinot.core.common.DataSourceMetadata)1 AndBlock (com.linkedin.pinot.core.operator.blocks.AndBlock)1 OrBlock (com.linkedin.pinot.core.operator.blocks.OrBlock)1 ScanBasedMultiValueDocIdSet (com.linkedin.pinot.core.operator.docidsets.ScanBasedMultiValueDocIdSet)1 ScanBasedSingleValueDocIdSet (com.linkedin.pinot.core.operator.docidsets.ScanBasedSingleValueDocIdSet)1