Search in sources :

Example 1 with FloatsColumn

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

the class NumericNullColumnSelectorTest method testFloatSelectorWithNullsCanResetOffset.

@Test
public void testFloatSelectorWithNullsCanResetOffset() {
    for (ImmutableBitmap bitmap : bitmaps) {
        ColumnarFloats floats = new ColumnarFloats() {

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

            @Override
            public float get(int index) {
                return ThreadLocalRandom.current().nextFloat();
            }

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

Aggregations

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