use of org.apache.druid.segment.IdMapping in project druid by druid-io.
the class ListFilteredVirtualColumn method getBitmapIndex.
@Override
@Nullable
public BitmapIndex getBitmapIndex(String columnName, ColumnSelector selector) {
final ColumnHolder holder = selector.getColumnHolder(delegate.getDimension());
if (holder == null) {
return null;
}
final BitmapIndex underlyingIndex = holder.getBitmapIndex();
if (underlyingIndex == null) {
return null;
}
final IdMapping idMapping;
if (allowList) {
idMapping = ListFilteredDimensionSpec.buildAllowListIdMapping(values, underlyingIndex.getCardinality(), null, underlyingIndex::getValue);
} else {
idMapping = ListFilteredDimensionSpec.buildDenyListIdMapping(values, underlyingIndex.getCardinality(), underlyingIndex::getValue);
}
return new ListFilteredBitmapIndex(underlyingIndex, idMapping);
}
Aggregations