Search in sources :

Example 1 with DoublesColumn

use of org.apache.druid.segment.column.DoublesColumn in project druid by druid-io.

the class NumericNullColumnSelectorTest method testDoubleSelectorWithNullsCanResetOffset.

@Test
public void testDoubleSelectorWithNullsCanResetOffset() {
    for (ImmutableBitmap bitmap : bitmaps) {
        ColumnarDoubles doubles = new ColumnarDoubles() {

            @Override
            public int size() {
                return numRows;
            }

            @Override
            public double get(int index) {
                return ThreadLocalRandom.current().nextDouble();
            }

            @Override
            public void close() {
            }
        };
        DoublesColumn columnWithNulls = DoublesColumn.create(doubles, bitmap);
        ColumnValueSelector<?> selector = columnWithNulls.makeColumnValueSelector(offset);
        assertOffsetCanReset(selector, bitmap, offset);
        VectorValueSelector vectorSelector = columnWithNulls.makeVectorValueSelector(vectorOffset);
        assertVectorOffsetCanReset(vectorSelector, bitmap, vectorOffset);
    }
}
Also used : ImmutableBitmap(org.apache.druid.collections.bitmap.ImmutableBitmap) DoublesColumn(org.apache.druid.segment.column.DoublesColumn) VectorValueSelector(org.apache.druid.segment.vector.VectorValueSelector) Test(org.junit.Test)

Aggregations

ImmutableBitmap (org.apache.druid.collections.bitmap.ImmutableBitmap)1 DoublesColumn (org.apache.druid.segment.column.DoublesColumn)1 VectorValueSelector (org.apache.druid.segment.vector.VectorValueSelector)1 Test (org.junit.Test)1