Search in sources :

Example 1 with ImmutableBitmapValues

use of org.apache.druid.segment.data.ImmutableBitmapValues in project druid by druid-io.

the class QueryableIndexIndexableAdapter method getBitmapIndex.

@VisibleForTesting
BitmapValues getBitmapIndex(String dimension, String value) {
    final ColumnHolder columnHolder = input.getColumnHolder(dimension);
    if (columnHolder == null) {
        return BitmapValues.EMPTY;
    }
    final BitmapIndex bitmaps = columnHolder.getBitmapIndex();
    if (bitmaps == null) {
        return BitmapValues.EMPTY;
    }
    return new ImmutableBitmapValues(bitmaps.getBitmap(bitmaps.getIndex(value)));
}
Also used : ColumnHolder(org.apache.druid.segment.column.ColumnHolder) BitmapIndex(org.apache.druid.segment.column.BitmapIndex) ImmutableBitmapValues(org.apache.druid.segment.data.ImmutableBitmapValues) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with ImmutableBitmapValues

use of org.apache.druid.segment.data.ImmutableBitmapValues in project druid by druid-io.

the class QueryableIndexIndexableAdapter method getBitmapValues.

@Override
public BitmapValues getBitmapValues(String dimension, int dictId) {
    final ColumnHolder columnHolder = input.getColumnHolder(dimension);
    if (columnHolder == null) {
        return BitmapValues.EMPTY;
    }
    final BitmapIndex bitmaps = columnHolder.getBitmapIndex();
    if (bitmaps == null) {
        return BitmapValues.EMPTY;
    }
    if (dictId >= 0) {
        return new ImmutableBitmapValues(bitmaps.getBitmap(dictId));
    } else {
        return BitmapValues.EMPTY;
    }
}
Also used : ColumnHolder(org.apache.druid.segment.column.ColumnHolder) BitmapIndex(org.apache.druid.segment.column.BitmapIndex) ImmutableBitmapValues(org.apache.druid.segment.data.ImmutableBitmapValues)

Aggregations

BitmapIndex (org.apache.druid.segment.column.BitmapIndex)2 ColumnHolder (org.apache.druid.segment.column.ColumnHolder)2 ImmutableBitmapValues (org.apache.druid.segment.data.ImmutableBitmapValues)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1