Search in sources :

Example 6 with DimensionIndexer

use of io.druid.segment.DimensionIndexer in project druid by druid-io.

the class IncrementalIndexAdapter method getBitmapIndex.

@Override
public IndexedInts getBitmapIndex(String dimension, int index) {
    DimensionAccessor accessor = accessors.get(dimension);
    if (accessor == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    ColumnCapabilities capabilities = accessor.dimensionDesc.getCapabilities();
    DimensionIndexer indexer = accessor.dimensionDesc.getIndexer();
    if (!capabilities.hasBitmapIndexes()) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    final int id = (Integer) indexer.getUnsortedEncodedValueFromSorted(index);
    if (id < 0 || id >= indexer.getCardinality()) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    MutableBitmap bitmapIndex = accessor.invertedIndexes[id];
    if (bitmapIndex == null) {
        return EmptyIndexedInts.EMPTY_INDEXED_INTS;
    }
    return new BitmapIndexedInts(bitmapIndex);
}
Also used : DimensionIndexer(io.druid.segment.DimensionIndexer) MutableBitmap(io.druid.collections.bitmap.MutableBitmap) ColumnCapabilities(io.druid.segment.column.ColumnCapabilities)

Example 7 with DimensionIndexer

use of io.druid.segment.DimensionIndexer in project druid by druid-io.

the class IncrementalIndexAdapter method getDimValueLookup.

@Override
public Indexed<Comparable> getDimValueLookup(String dimension) {
    final DimensionAccessor accessor = accessors.get(dimension);
    if (accessor == null) {
        return null;
    }
    final DimensionIndexer indexer = accessor.dimensionDesc.getIndexer();
    return indexer.getSortedIndexedValues();
}
Also used : DimensionIndexer(io.druid.segment.DimensionIndexer)

Example 8 with DimensionIndexer

use of io.druid.segment.DimensionIndexer in project druid by druid-io.

the class IncrementalIndexStorageAdapter method getMaxValue.

@Override
public Comparable getMaxValue(String column) {
    IncrementalIndex.DimensionDesc desc = index.getDimension(column);
    if (desc == null) {
        return null;
    }
    DimensionIndexer indexer = desc.getIndexer();
    return indexer.getMaxValue();
}
Also used : DimensionIndexer(io.druid.segment.DimensionIndexer)

Aggregations

DimensionIndexer (io.druid.segment.DimensionIndexer)8 DimensionHandler (io.druid.segment.DimensionHandler)2 ColumnCapabilities (io.druid.segment.column.ColumnCapabilities)2 DateTime (org.joda.time.DateTime)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 MutableBitmap (io.druid.collections.bitmap.MutableBitmap)1 IAE (io.druid.java.util.common.IAE)1 ISE (io.druid.java.util.common.ISE)1 DimensionSpec (io.druid.query.dimension.DimensionSpec)1 ExtractionFn (io.druid.query.extraction.ExtractionFn)1 ValueMatcher (io.druid.query.filter.ValueMatcher)1 RuntimeShapeInspector (io.druid.query.monomorphicprocessing.RuntimeShapeInspector)1 Cursor (io.druid.segment.Cursor)1 DimensionSelector (io.druid.segment.DimensionSelector)1 FloatColumnSelector (io.druid.segment.FloatColumnSelector)1 FloatWrappingDimensionSelector (io.druid.segment.FloatWrappingDimensionSelector)1 LongColumnSelector (io.druid.segment.LongColumnSelector)1 LongWrappingDimensionSelector (io.druid.segment.LongWrappingDimensionSelector)1 NullDimensionSelector (io.druid.segment.NullDimensionSelector)1 ObjectColumnSelector (io.druid.segment.ObjectColumnSelector)1