use of org.apache.druid.query.aggregation.VectorAggregator in project druid by druid-io.
the class VarianceAggregatorFactoryUnitTest method factorizeVectorShouldReturnFloatVectorAggregator.
@Test
public void factorizeVectorShouldReturnFloatVectorAggregator() {
VectorAggregator agg = target.factorizeVector(selectorFactory);
Assert.assertNotNull(agg);
Assert.assertEquals(VarianceFloatVectorAggregator.class, agg.getClass());
}
use of org.apache.druid.query.aggregation.VectorAggregator in project druid by druid-io.
the class VarianceAggregatorFactoryUnitTest method factorizeVectorForLongShouldReturnFloatVectorAggregator.
@Test
public void factorizeVectorForLongShouldReturnFloatVectorAggregator() {
target = new VarianceAggregatorFactory(NAME, FIELD_NAME, null, LONG);
VectorAggregator agg = target.factorizeVector(selectorFactory);
Assert.assertNotNull(agg);
Assert.assertEquals(VarianceLongVectorAggregator.class, agg.getClass());
}
use of org.apache.druid.query.aggregation.VectorAggregator in project druid by druid-io.
the class VarianceAggregatorFactoryUnitTest method factorizeVectorForVarianceShouldReturnObjectVectorAggregator.
@Test
public void factorizeVectorForVarianceShouldReturnObjectVectorAggregator() {
target = new VarianceAggregatorFactory(NAME, FIELD_NAME, null, VARIANCE);
VectorAggregator agg = target.factorizeVector(selectorFactory);
Assert.assertNotNull(agg);
Assert.assertEquals(VarianceObjectVectorAggregator.class, agg.getClass());
}
use of org.apache.druid.query.aggregation.VectorAggregator in project druid by druid-io.
the class LongAnyAggregatorFactoryTest method factorizeVectorWithNumericColumnShouldReturnLongVectorAggregator.
@Test
public void factorizeVectorWithNumericColumnShouldReturnLongVectorAggregator() {
Mockito.doReturn(capabilities).when(selectorFactory).getColumnCapabilities(FIELD_NAME);
Mockito.doReturn(true).when(capabilities).isNumeric();
VectorAggregator aggregator = target.factorizeVector(selectorFactory);
Assert.assertNotNull(aggregator);
Assert.assertEquals(LongAnyVectorAggregator.class, aggregator.getClass());
}
use of org.apache.druid.query.aggregation.VectorAggregator in project druid by druid-io.
the class LongAnyAggregatorFactoryTest method factorizeVectorForStringTypeShouldReturnLongVectorAggregatorWithNilSelector.
@Test
public void factorizeVectorForStringTypeShouldReturnLongVectorAggregatorWithNilSelector() {
Mockito.doReturn(capabilities).when(selectorFactory).getColumnCapabilities(FIELD_NAME);
Mockito.doReturn(false).when(capabilities).isNumeric();
VectorAggregator aggregator = target.factorizeVector(selectorFactory);
Assert.assertNotNull(aggregator);
Assert.assertEquals(NullHandling.defaultLongValue(), aggregator.get(BUFFER, POSITION));
}
Aggregations