use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.
the class StringAnyAggregationTest method testStringAnyAggregatorWithNullFirst.
@Test
public void testStringAnyAggregatorWithNullFirst() {
valueSelector = new TestObjectColumnSelector<>(stringsWithNullFirst);
colSelectorFactory = EasyMock.createMock(ColumnSelectorFactory.class);
EasyMock.expect(colSelectorFactory.getColumnCapabilities("nilly")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.STRING));
EasyMock.expect(colSelectorFactory.makeColumnValueSelector("nilly")).andReturn(valueSelector);
EasyMock.replay(colSelectorFactory);
Aggregator agg = stringAnyAggFactory.factorize(colSelectorFactory);
aggregate(agg);
aggregate(agg);
aggregate(agg);
aggregate(agg);
String result = (String) agg.get();
Assert.assertNull(result);
}
use of org.apache.druid.segment.column.ColumnCapabilitiesImpl 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.column.ColumnCapabilitiesImpl 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);
}
use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.
the class FloatMinAggregationTest method setup.
@Before
public void setup() {
NullHandling.initializeForTests();
VectorValueSelector vectorValueSelector = EasyMock.createMock(VectorValueSelector.class);
EasyMock.expect(vectorValueSelector.getFloatVector()).andReturn(floatValues1).anyTimes();
EasyMock.expect(vectorValueSelector.getNullVector()).andReturn(null).anyTimes();
EasyMock.replay(vectorValueSelector);
vectorColumnSelectorFactory = EasyMock.createMock(VectorColumnSelectorFactory.class);
EasyMock.expect(vectorColumnSelectorFactory.getColumnCapabilities("fltFld")).andReturn(new ColumnCapabilitiesImpl().setType(ColumnType.FLOAT).setDictionaryEncoded(true)).anyTimes();
EasyMock.expect(vectorColumnSelectorFactory.makeValueSelector("fltFld")).andReturn(vectorValueSelector).anyTimes();
EasyMock.replay(vectorColumnSelectorFactory);
}
use of org.apache.druid.segment.column.ColumnCapabilitiesImpl in project druid by druid-io.
the class GroupByQueryEngineV2Test method testCanPushDownLimitForExpressionStringSelector.
@Test
public void testCanPushDownLimitForExpressionStringSelector() {
ColumnCapabilities capabilities = new ColumnCapabilitiesImpl().setType(ColumnType.STRING).setHasBitmapIndexes(false).setHasMultipleValues(false).setDictionaryEncoded(false).setDictionaryValuesSorted(false).setDictionaryValuesUnique(false);
EasyMock.expect(factory.getColumnCapabilities(DIM)).andReturn(capabilities).once();
EasyMock.replay(factory);
Assert.assertFalse(GroupByQueryEngineV2.canPushDownLimit(factory, DIM));
EasyMock.verify(factory);
}
Aggregations