Search in sources :

Example 16 with TestLongColumnSelector

use of org.apache.druid.query.aggregation.TestLongColumnSelector in project druid by druid-io.

the class FloatFirstAggregationTest method setup.

@Before
public void setup() {
    floatFirstAggregatorFactory = new FloatFirstAggregatorFactory("billy", "nilly", null);
    combiningAggFactory = (FloatFirstAggregatorFactory) floatFirstAggregatorFactory.getCombiningFactory();
    timeSelector = new TestLongColumnSelector(times);
    customTimeSelector = new TestLongColumnSelector(customTimes);
    valueSelector = new TestFloatColumnSelector(floats);
    objectSelector = new TestObjectColumnSelector<>(pairs);
    colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector(ColumnHolder.TIME_COLUMN_NAME)).andReturn(timeSelector);
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector("customTime")).andReturn(customTimeSelector);
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(valueSelector).atLeastOnce();
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector("billy")).andReturn(objectSelector).atLeastOnce();
    EasyMock.replay(colSelectorFactory);
}
Also used : TestFloatColumnSelector(org.apache.druid.query.aggregation.TestFloatColumnSelector) ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) TestLongColumnSelector(org.apache.druid.query.aggregation.TestLongColumnSelector) Before(org.junit.Before)

Example 17 with TestLongColumnSelector

use of org.apache.druid.query.aggregation.TestLongColumnSelector in project druid by druid-io.

the class LongAnyAggregationTest method setup.

@Before
public void setup() {
    longAnyAggFactory = new LongAnyAggregatorFactory("billy", "nilly");
    combiningAggFactory = (LongAnyAggregatorFactory) longAnyAggFactory.getCombiningFactory();
    valueSelector = new TestLongColumnSelector(longs);
    objectSelector = new TestObjectColumnSelector<>(objects);
    colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(valueSelector);
    EasyMock.expect(colSelectorFactory.makeColumnValueSelector("billy")).andReturn(objectSelector);
    EasyMock.replay(colSelectorFactory);
}
Also used : ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) TestLongColumnSelector(org.apache.druid.query.aggregation.TestLongColumnSelector) Before(org.junit.Before)

Aggregations

TestLongColumnSelector (org.apache.druid.query.aggregation.TestLongColumnSelector)17 ColumnSelectorFactory (org.apache.druid.segment.ColumnSelectorFactory)9 Before (org.junit.Before)9 ByteBuffer (java.nio.ByteBuffer)8 SerializablePairLongString (org.apache.druid.query.aggregation.SerializablePairLongString)8 TestObjectColumnSelector (org.apache.druid.query.aggregation.TestObjectColumnSelector)8 Test (org.junit.Test)8 TestDoubleColumnSelectorImpl (org.apache.druid.query.aggregation.TestDoubleColumnSelectorImpl)2 TestFloatColumnSelector (org.apache.druid.query.aggregation.TestFloatColumnSelector)2 ColumnCapabilitiesImpl (org.apache.druid.segment.column.ColumnCapabilitiesImpl)2