use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class TDigestSketchToQuantilesPostAggregatorTest method testSerde.
@Test
public void testSerde() throws Exception {
TDigestSketchToQuantilesPostAggregator there = new TDigestSketchToQuantilesPostAggregator("post", new ConstantPostAggregator("", 100), new double[] { 0.25, 0.75 });
DefaultObjectMapper mapper = new DefaultObjectMapper();
TDigestSketchToQuantilesPostAggregator andBackAgain = mapper.readValue(mapper.writeValueAsString(there), TDigestSketchToQuantilesPostAggregator.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 TDigestSketchToQuantilesPostAggregatorTest method testComparator.
@Test
public void testComparator() {
expectedException.expect(IAE.class);
expectedException.expectMessage("Comparing arrays of quantiles is not supported");
PostAggregator postAgg = new TDigestSketchToQuantilesPostAggregator("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 MomentSketchMinPostAggregatorTest method testSerde.
@Test
public void testSerde() throws Exception {
MomentSketchMinPostAggregator there = new MomentSketchMinPostAggregator("post", new ConstantPostAggregator("", 100));
DefaultObjectMapper mapper = new DefaultObjectMapper();
MomentSketchMinPostAggregator andBackAgain = mapper.readValue(mapper.writeValueAsString(there), MomentSketchMinPostAggregator.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 MomentSketchMinPostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new MomentSketchMinPostAggregator("post", new ConstantPostAggregator("", 100));
Assert.assertEquals("MomentSketchMinPostAggregator{name='post', field=ConstantPostAggregator{name='', constantValue=100}}", postAgg.toString());
}
use of org.apache.druid.query.aggregation.post.ConstantPostAggregator in project druid by druid-io.
the class MomentSketchMaxPostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new MomentSketchMaxPostAggregator("post", new ConstantPostAggregator("", 100));
Assert.assertEquals("MomentSketchMaxPostAggregator{name='post', field=ConstantPostAggregator{name='', constantValue=100}}", postAgg.toString());
}
Aggregations