Search in sources :

Example 26 with DimensionSelector

use of io.druid.segment.DimensionSelector 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());
}
Also used : DimensionSelector(io.druid.segment.DimensionSelector) TestLongColumnSelector(io.druid.segment.TestLongColumnSelector) LongColumnSelector(io.druid.segment.LongColumnSelector) TestFloatColumnSelector(io.druid.segment.TestFloatColumnSelector) FloatColumnSelector(io.druid.segment.FloatColumnSelector) DefaultDimensionSpec(io.druid.query.dimension.DefaultDimensionSpec) VirtualColumns(io.druid.segment.VirtualColumns) ObjectColumnSelector(io.druid.segment.ObjectColumnSelector) Test(org.junit.Test)

Aggregations

DimensionSelector (io.druid.segment.DimensionSelector)26 IndexedInts (io.druid.segment.data.IndexedInts)14 DefaultDimensionSpec (io.druid.query.dimension.DefaultDimensionSpec)12 Test (org.junit.Test)11 Cursor (io.druid.segment.Cursor)9 ValueMatcher (io.druid.query.filter.ValueMatcher)5 ObjectColumnSelector (io.druid.segment.ObjectColumnSelector)5 FloatColumnSelector (io.druid.segment.FloatColumnSelector)4 LongColumnSelector (io.druid.segment.LongColumnSelector)4 Interval (org.joda.time.Interval)4 DimensionSpec (io.druid.query.dimension.DimensionSpec)3 ExtractionFn (io.druid.query.extraction.ExtractionFn)3 RuntimeShapeInspector (io.druid.query.monomorphicprocessing.RuntimeShapeInspector)3 TestFloatColumnSelector (io.druid.segment.TestFloatColumnSelector)3 TestLongColumnSelector (io.druid.segment.TestLongColumnSelector)3 VirtualColumns (io.druid.segment.VirtualColumns)3 ByteBuffer (java.nio.ByteBuffer)3 ImmutableList (com.google.common.collect.ImmutableList)2 MapBasedInputRow (io.druid.data.input.MapBasedInputRow)2 ExtractionDimensionSpec (io.druid.query.dimension.ExtractionDimensionSpec)2