use of io.druid.segment.data.Indexed in project druid by druid-io.
the class ColumnSelectorBitmapIndexSelector method getDimensionValues.
@Override
public Indexed<String> getDimensionValues(String dimension) {
if (isFilterableVirtualColumn(dimension)) {
// Virtual columns don't have dictionaries or indexes.
return null;
}
final Column columnDesc = index.getColumn(dimension);
if (columnDesc == null || !columnDesc.getCapabilities().isDictionaryEncoded()) {
return null;
}
final DictionaryEncodedColumn<String> column = columnDesc.getDictionaryEncoding();
return new Indexed<String>() {
@Override
public Class<? extends String> getClazz() {
return String.class;
}
@Override
public int size() {
return column.getCardinality();
}
@Override
public String get(int index) {
return column.lookupName(index);
}
@Override
public int indexOf(String value) {
return column.lookupId(value);
}
@Override
public Iterator<String> iterator() {
return IndexedIterable.create(this).iterator();
}
};
}
Aggregations