use of io.druid.segment.LongColumnSelector in project druid by druid-io.
the class ExpressionVirtualColumnTest method testLongSelector.
@Test
public void testLongSelector() {
final LongColumnSelector selector = XPLUSY.makeLongColumnSelector("expr", COLUMN_SELECTOR_FACTORY);
COLUMN_SELECTOR_FACTORY.setRow(ROW0);
Assert.assertEquals(0L, selector.get());
COLUMN_SELECTOR_FACTORY.setRow(ROW1);
Assert.assertEquals(0L, selector.get());
COLUMN_SELECTOR_FACTORY.setRow(ROW2);
Assert.assertEquals(5L, selector.get());
}
use of io.druid.segment.LongColumnSelector in project druid by druid-io.
the class VirtualColumnsTest method testMakeSelectorsWithDotSupportBaseNameOnly.
@Test
public void testMakeSelectorsWithDotSupportBaseNameOnly() {
final VirtualColumns virtualColumns = makeVirtualColumns();
final ObjectColumnSelector objectSelector = virtualColumns.makeObjectColumnSelector("foo", null);
final DimensionSelector dimensionSelector = virtualColumns.makeDimensionSelector(new DefaultDimensionSpec("foo", "x"), null);
final FloatColumnSelector floatSelector = virtualColumns.makeFloatColumnSelector("foo", null);
final LongColumnSelector longSelector = virtualColumns.makeLongColumnSelector("foo", null);
Assert.assertEquals(-1L, objectSelector.get());
Assert.assertEquals("-1", dimensionSelector.lookupName(dimensionSelector.getRow().get(0)));
Assert.assertEquals(-1.0f, floatSelector.get(), 0.0f);
Assert.assertEquals(-1L, longSelector.get());
}
Aggregations