use of org.apache.druid.segment.vector.VectorColumnSelectorFactory in project druid by druid-io.
the class ApproximateHistogramVectorAggregatorTest method setup.
@Before
public void setup() {
NullHandling.initializeForTests();
VectorValueSelector vectorValueSelector_1 = createMock(VectorValueSelector.class);
expect(vectorValueSelector_1.getFloatVector()).andReturn(FLOATS).anyTimes();
expect(vectorValueSelector_1.getNullVector()).andReturn(NULL_VECTOR).anyTimes();
VectorValueSelector vectorValueSelector_2 = createMock(VectorValueSelector.class);
expect(vectorValueSelector_2.getFloatVector()).andReturn(FLOATS).anyTimes();
expect(vectorValueSelector_2.getNullVector()).andReturn(null).anyTimes();
EasyMock.replay(vectorValueSelector_1);
EasyMock.replay(vectorValueSelector_2);
ColumnCapabilities columnCapabilities = ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ColumnType.DOUBLE);
vectorColumnSelectorFactory = createMock(VectorColumnSelectorFactory.class);
expect(vectorColumnSelectorFactory.getColumnCapabilities("field_1")).andReturn(columnCapabilities).anyTimes();
expect(vectorColumnSelectorFactory.makeValueSelector("field_1")).andReturn(vectorValueSelector_1).anyTimes();
expect(vectorColumnSelectorFactory.getColumnCapabilities("field_2")).andReturn(columnCapabilities).anyTimes();
expect(vectorColumnSelectorFactory.makeValueSelector("field_2")).andReturn(vectorValueSelector_2).anyTimes();
expect(vectorColumnSelectorFactory.getColumnCapabilities("string_field")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.STRING));
expect(vectorColumnSelectorFactory.getColumnCapabilities("complex_field")).andReturn(new ColumnCapabilitiesImpl().setType(ApproximateHistogramAggregatorFactory.TYPE));
EasyMock.replay(vectorColumnSelectorFactory);
}
use of org.apache.druid.segment.vector.VectorColumnSelectorFactory in project druid by druid-io.
the class FixedBucketsHistogramVectorAggregatorTest method setup.
@Before
public void setup() {
NullHandling.initializeForTests();
VectorValueSelector vectorValueSelector_1 = createMock(VectorValueSelector.class);
expect(vectorValueSelector_1.getDoubleVector()).andReturn(DOUBLES).anyTimes();
expect(vectorValueSelector_1.getNullVector()).andReturn(NULL_VECTOR).anyTimes();
VectorValueSelector vectorValueSelector_2 = createMock(VectorValueSelector.class);
expect(vectorValueSelector_2.getDoubleVector()).andReturn(DOUBLES).anyTimes();
expect(vectorValueSelector_2.getNullVector()).andReturn(null).anyTimes();
EasyMock.replay(vectorValueSelector_1);
EasyMock.replay(vectorValueSelector_2);
ColumnCapabilities columnCapabilities = ColumnCapabilitiesImpl.createSimpleNumericColumnCapabilities(ColumnType.DOUBLE);
vectorColumnSelectorFactory = createMock(VectorColumnSelectorFactory.class);
expect(vectorColumnSelectorFactory.getColumnCapabilities("field_1")).andReturn(columnCapabilities).anyTimes();
expect(vectorColumnSelectorFactory.makeValueSelector("field_1")).andReturn(vectorValueSelector_1).anyTimes();
expect(vectorColumnSelectorFactory.getColumnCapabilities("field_2")).andReturn(columnCapabilities).anyTimes();
expect(vectorColumnSelectorFactory.makeValueSelector("field_2")).andReturn(vectorValueSelector_2).anyTimes();
EasyMock.replay(vectorColumnSelectorFactory);
}
use of org.apache.druid.segment.vector.VectorColumnSelectorFactory in project druid by druid-io.
the class ApproximateHistogramFoldingVectorAggregatorTest method setup.
@Before
public void setup() {
h1 = new ApproximateHistogram(5);
h2 = new ApproximateHistogram(5);
for (int i = 0; i < 5; ++i) {
h1.offer(FLOATS[i]);
}
for (int i = 5; i < FLOATS.length; ++i) {
h2.offer(FLOATS[i]);
}
VectorObjectSelector vectorObjectSelector = createMock(VectorObjectSelector.class);
expect(vectorObjectSelector.getObjectVector()).andReturn(new Object[] { h1, null, h2, null }).anyTimes();
EasyMock.replay(vectorObjectSelector);
vectorColumnSelectorFactory = createMock(VectorColumnSelectorFactory.class);
expect(vectorColumnSelectorFactory.makeObjectSelector("field")).andReturn(vectorObjectSelector).anyTimes();
expect(vectorColumnSelectorFactory.getColumnCapabilities("field")).andReturn(new ColumnCapabilitiesImpl().setType(ApproximateHistogramAggregatorFactory.TYPE));
expect(vectorColumnSelectorFactory.getColumnCapabilities("string_field")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.STRING));
expect(vectorColumnSelectorFactory.getColumnCapabilities("double_field")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.STRING));
EasyMock.replay(vectorColumnSelectorFactory);
}
use of org.apache.druid.segment.vector.VectorColumnSelectorFactory in project druid by druid-io.
the class DoubleMaxAggregationTest method setup.
@Before
public void setup() {
NullHandling.initializeForTests();
selector = new TestDoubleColumnSelectorImpl(values);
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector);
EasyMock.expect(colSelectorFactory.getColumnCapabilities("nilly")).andReturn(null);
EasyMock.replay(colSelectorFactory);
VectorValueSelector vectorValueSelector = EasyMock.createMock(VectorValueSelector.class);
EasyMock.expect(vectorValueSelector.getDoubleVector()).andReturn(doubleValues1).anyTimes();
EasyMock.expect(vectorValueSelector.getNullVector()).andReturn(null).anyTimes();
EasyMock.replay(vectorValueSelector);
vectorColumnSelectorFactory = EasyMock.createMock(VectorColumnSelectorFactory.class);
EasyMock.expect(vectorColumnSelectorFactory.getColumnCapabilities("dblFld")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.DOUBLE).setDictionaryEncoded(true)).anyTimes();
EasyMock.expect(vectorColumnSelectorFactory.makeValueSelector("dblFld")).andReturn(vectorValueSelector).anyTimes();
EasyMock.replay(vectorColumnSelectorFactory);
}
use of org.apache.druid.segment.vector.VectorColumnSelectorFactory in project druid by druid-io.
the class DoubleMinAggregationTest method setup.
@Before
public void setup() {
NullHandling.initializeForTests();
selector = new TestDoubleColumnSelectorImpl(values);
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(selector);
EasyMock.expect(colSelectorFactory.getColumnCapabilities("nilly")).andReturn(null);
EasyMock.replay(colSelectorFactory);
VectorValueSelector vectorValueSelector = EasyMock.createMock(VectorValueSelector.class);
EasyMock.expect(vectorValueSelector.getDoubleVector()).andReturn(doubleValues1).anyTimes();
EasyMock.expect(vectorValueSelector.getNullVector()).andReturn(null).anyTimes();
EasyMock.replay(vectorValueSelector);
vectorColumnSelectorFactory = EasyMock.createMock(VectorColumnSelectorFactory.class);
EasyMock.expect(vectorColumnSelectorFactory.getColumnCapabilities("dblFld")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.DOUBLE).setDictionaryEncoded(true)).anyTimes();
EasyMock.expect(vectorColumnSelectorFactory.makeValueSelector("dblFld")).andReturn(vectorValueSelector).anyTimes();
EasyMock.replay(vectorColumnSelectorFactory);
}
Aggregations