Search in sources :

Example 1 with SortedSingleValueBlock

use of com.linkedin.pinot.core.operator.blocks.SortedSingleValueBlock in project pinot by linkedin.

the class ColumnDataSourceImpl method getNextBlock.

@Override
public Block getNextBlock(BlockId blockId) {
    Block b = null;
    ColumnMetadata columnMetadata = indexContainer.getColumnMetadata();
    if (columnMetadata.isSingleValue()) {
        // TODO: Support sorted index without dictionary.
        if (columnMetadata.hasDictionary() && columnMetadata.isSorted()) {
            b = new SortedSingleValueBlock(blockId, (SortedForwardIndexReader) indexContainer.getForwardIndex(), indexContainer.getDictionary(), columnMetadata);
        } else {
            b = new UnSortedSingleValueBlock(blockId, (SingleColumnSingleValueReader) indexContainer.getForwardIndex(), indexContainer.getDictionary(), columnMetadata);
        }
    } else {
        b = new MultiValueBlock(blockId, (SingleColumnMultiValueReader) indexContainer.getForwardIndex(), indexContainer.getDictionary(), columnMetadata);
    }
    return b;
}
Also used : SingleColumnSingleValueReader(com.linkedin.pinot.core.io.reader.SingleColumnSingleValueReader) UnSortedSingleValueBlock(com.linkedin.pinot.core.operator.blocks.UnSortedSingleValueBlock) ColumnMetadata(com.linkedin.pinot.core.segment.index.ColumnMetadata) SortedForwardIndexReader(com.linkedin.pinot.core.io.reader.impl.SortedForwardIndexReader) SortedSingleValueBlock(com.linkedin.pinot.core.operator.blocks.SortedSingleValueBlock) UnSortedSingleValueBlock(com.linkedin.pinot.core.operator.blocks.UnSortedSingleValueBlock) Block(com.linkedin.pinot.core.common.Block) MultiValueBlock(com.linkedin.pinot.core.operator.blocks.MultiValueBlock) SortedSingleValueBlock(com.linkedin.pinot.core.operator.blocks.SortedSingleValueBlock) UnSortedSingleValueBlock(com.linkedin.pinot.core.operator.blocks.UnSortedSingleValueBlock) MultiValueBlock(com.linkedin.pinot.core.operator.blocks.MultiValueBlock) SingleColumnMultiValueReader(com.linkedin.pinot.core.io.reader.SingleColumnMultiValueReader)

Aggregations

Block (com.linkedin.pinot.core.common.Block)1 SingleColumnMultiValueReader (com.linkedin.pinot.core.io.reader.SingleColumnMultiValueReader)1 SingleColumnSingleValueReader (com.linkedin.pinot.core.io.reader.SingleColumnSingleValueReader)1 SortedForwardIndexReader (com.linkedin.pinot.core.io.reader.impl.SortedForwardIndexReader)1 MultiValueBlock (com.linkedin.pinot.core.operator.blocks.MultiValueBlock)1 SortedSingleValueBlock (com.linkedin.pinot.core.operator.blocks.SortedSingleValueBlock)1 UnSortedSingleValueBlock (com.linkedin.pinot.core.operator.blocks.UnSortedSingleValueBlock)1 ColumnMetadata (com.linkedin.pinot.core.segment.index.ColumnMetadata)1