Search in sources :

Example 6 with VectorColumnSelectorFactory

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);
}
Also used : VectorValueSelector(org.apache.druid.segment.vector.VectorValueSelector) ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Before(org.junit.Before)

Example 7 with 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);
}
Also used : VectorValueSelector(org.apache.druid.segment.vector.VectorValueSelector) ColumnCapabilities(org.apache.druid.segment.column.ColumnCapabilities) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) Before(org.junit.Before)

Example 8 with 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);
}
Also used : VectorObjectSelector(org.apache.druid.segment.vector.VectorObjectSelector) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Before(org.junit.Before)

Example 9 with 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);
}
Also used : ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) VectorValueSelector(org.apache.druid.segment.vector.VectorValueSelector) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Before(org.junit.Before)

Example 10 with 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);
}
Also used : ColumnSelectorFactory(org.apache.druid.segment.ColumnSelectorFactory) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) VectorValueSelector(org.apache.druid.segment.vector.VectorValueSelector) VectorColumnSelectorFactory(org.apache.druid.segment.vector.VectorColumnSelectorFactory) ColumnCapabilitiesImpl(org.apache.druid.segment.column.ColumnCapabilitiesImpl) Before(org.junit.Before)

Aggregations

VectorColumnSelectorFactory (org.apache.druid.segment.vector.VectorColumnSelectorFactory)12 Before (org.junit.Before)9 ColumnCapabilitiesImpl (org.apache.druid.segment.column.ColumnCapabilitiesImpl)8 VectorValueSelector (org.apache.druid.segment.vector.VectorValueSelector)8 ColumnSelectorFactory (org.apache.druid.segment.ColumnSelectorFactory)5 Closer (org.apache.druid.java.util.common.io.Closer)2 ColumnCapabilities (org.apache.druid.segment.column.ColumnCapabilities)2 VectorCursor (org.apache.druid.segment.vector.VectorCursor)2 ByteBuffer (java.nio.ByteBuffer)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ISE (org.apache.druid.java.util.common.ISE)1 BitmapResultFactory (org.apache.druid.query.BitmapResultFactory)1 AggregatorAdapters (org.apache.druid.query.aggregation.AggregatorAdapters)1 AggregatorFactory (org.apache.druid.query.aggregation.AggregatorFactory)1 DefaultDimensionSpec (org.apache.druid.query.dimension.DefaultDimensionSpec)1 BitmapIndexSelector (org.apache.druid.query.filter.BitmapIndexSelector)1 DimFilter (org.apache.druid.query.filter.DimFilter)1 Filter (org.apache.druid.query.filter.Filter)1 VectorCursorGranularizer (org.apache.druid.query.vector.VectorCursorGranularizer)1