Search in sources :

Example 1 with BitmapCompressedIndexedInts

use of io.druid.segment.data.BitmapCompressedIndexedInts in project druid by druid-io.

the class QueryableIndexIndexableAdapter method getBitmapIndex.

@Override
public IndexedInts getBitmapIndex(String dimension, int dictId) {
    final Column column = input.getColumn(dimension);
    if (column == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    final BitmapIndex bitmaps = column.getBitmapIndex();
    if (bitmaps == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    if (dictId >= 0) {
        return new BitmapCompressedIndexedInts(bitmaps.getBitmap(dictId));
    } else {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
}
Also used : IndexedLongsGenericColumn(io.druid.segment.column.IndexedLongsGenericColumn) GenericColumn(io.druid.segment.column.GenericColumn) ComplexColumn(io.druid.segment.column.ComplexColumn) Column(io.druid.segment.column.Column) DictionaryEncodedColumn(io.druid.segment.column.DictionaryEncodedColumn) IndexedFloatsGenericColumn(io.druid.segment.column.IndexedFloatsGenericColumn) BitmapCompressedIndexedInts(io.druid.segment.data.BitmapCompressedIndexedInts) BitmapIndex(io.druid.segment.column.BitmapIndex)

Example 2 with BitmapCompressedIndexedInts

use of io.druid.segment.data.BitmapCompressedIndexedInts in project druid by druid-io.

the class QueryableIndexIndexableAdapter method getBitmapIndex.

@VisibleForTesting
IndexedInts getBitmapIndex(String dimension, String value) {
    final Column column = input.getColumn(dimension);
    if (column == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    final BitmapIndex bitmaps = column.getBitmapIndex();
    if (bitmaps == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    return new BitmapCompressedIndexedInts(bitmaps.getBitmap(bitmaps.getIndex(value)));
}
Also used : IndexedLongsGenericColumn(io.druid.segment.column.IndexedLongsGenericColumn) GenericColumn(io.druid.segment.column.GenericColumn) ComplexColumn(io.druid.segment.column.ComplexColumn) Column(io.druid.segment.column.Column) DictionaryEncodedColumn(io.druid.segment.column.DictionaryEncodedColumn) IndexedFloatsGenericColumn(io.druid.segment.column.IndexedFloatsGenericColumn) BitmapCompressedIndexedInts(io.druid.segment.data.BitmapCompressedIndexedInts) BitmapIndex(io.druid.segment.column.BitmapIndex) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

BitmapIndex (io.druid.segment.column.BitmapIndex)2 Column (io.druid.segment.column.Column)2 ComplexColumn (io.druid.segment.column.ComplexColumn)2 DictionaryEncodedColumn (io.druid.segment.column.DictionaryEncodedColumn)2 GenericColumn (io.druid.segment.column.GenericColumn)2 IndexedFloatsGenericColumn (io.druid.segment.column.IndexedFloatsGenericColumn)2 IndexedLongsGenericColumn (io.druid.segment.column.IndexedLongsGenericColumn)2 BitmapCompressedIndexedInts (io.druid.segment.data.BitmapCompressedIndexedInts)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1