use of org.apache.druid.segment.vector.VectorSizeInspector in project druid by druid-io.
the class AlwaysTwoVectorizedVirtualColumn method makeMultiValueVectorDimensionSelector.
@Override
public MultiValueDimensionVectorSelector makeMultiValueVectorDimensionSelector(DimensionSpec dimensionSpec, VectorColumnSelectorFactory factory) {
Assert.assertEquals(outputName, dimensionSpec.getOutputName());
final IndexedInts[] rowVector = new IndexedInts[factory.getReadableVectorInspector().getMaxVectorSize()];
Arrays.fill(rowVector, new ArrayBasedIndexedInts(new int[] { 0, 0 }));
return new MultiValueDimensionVectorSelector() {
private final VectorSizeInspector inspector = factory.getReadableVectorInspector();
@Override
public IndexedInts[] getRowVector() {
return rowVector;
}
@Override
public int getValueCardinality() {
return dictionaryEncoded ? 1 : CARDINALITY_UNKNOWN;
}
@Nullable
@Override
public String lookupName(int id) {
return "2";
}
@Override
public boolean nameLookupPossibleInAdvance() {
return dictionaryEncoded;
}
@Nullable
@Override
public IdLookup idLookup() {
return null;
}
@Override
public int getMaxVectorSize() {
return inspector.getMaxVectorSize();
}
@Override
public int getCurrentVectorSize() {
return inspector.getCurrentVectorSize();
}
};
}
Aggregations