use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class MomentSketchQuantilePostAggregatorTest method testComparator.
@Test
public void testComparator() {
expectedException.expect(IAE.class);
expectedException.expectMessage("Comparing arrays of quantiles is not supported");
PostAggregator postAgg = new MomentSketchQuantilePostAggregator("post", new ConstantPostAggregator("", 100), new double[] { 0.25, 0.75 });
postAgg.getComparator();
}
use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class MomentSketchQuantilePostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new MomentSketchQuantilePostAggregator("post", new ConstantPostAggregator("", 100), new double[] { 0.25, 0.75 });
Assert.assertEquals("MomentSketchQuantilePostAggregator{name='post', field=ConstantPostAggregator{name='', constantValue=100}, fractions=[0.25, 0.75]}", postAgg.toString());
}
use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class TDigestSketchToQuantilesPostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new TDigestSketchToQuantilesPostAggregator("post", new ConstantPostAggregator("", 100), new double[] { 0.25, 0.75 });
Assert.assertEquals("TDigestSketchToQuantilesPostAggregator{name='post', field=ConstantPostAggregator{name='', constantValue=100}, fractions=[0.25, 0.75]}", postAgg.toString());
}
use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class TDigestSketchToQuantilePostAggregatorTest method testSerde.
@Test
public void testSerde() throws Exception {
TDigestSketchToQuantilePostAggregator there = new TDigestSketchToQuantilePostAggregator("post", new ConstantPostAggregator("", 100), 0.5);
DefaultObjectMapper mapper = new DefaultObjectMapper();
TDigestSketchToQuantilePostAggregator andBackAgain = mapper.readValue(mapper.writeValueAsString(there), TDigestSketchToQuantilePostAggregator.class);
Assert.assertEquals(there, andBackAgain);
Assert.assertArrayEquals(there.getCacheKey(), andBackAgain.getCacheKey());
Assert.assertEquals(there.getDependentFields(), andBackAgain.getDependentFields());
}
use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class TDigestSketchToQuantilePostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new TDigestSketchToQuantilePostAggregator("post", new ConstantPostAggregator("", 100), 0.5);
Assert.assertEquals("TDigestSketchToQuantilePostAggregator{name='post', field=ConstantPostAggregator{name='', constantValue=100}, fraction=0.5}", postAgg.toString());
}
Aggregations