use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ArrayOfDoublesSketchTTestPostAggregatorTest method testToString.
@Test
public void testToString() {
final PostAggregator postAgg = new ArrayOfDoublesSketchTTestPostAggregator("a", Arrays.asList(new ConstantPostAggregator("", 0), new ConstantPostAggregator("", 0)));
Assert.assertEquals("ArrayOfDoublesSketchTTestPostAggregator{name='a', fields=[ConstantPostAggregator{name='', constantValue=0}, ConstantPostAggregator{name='', constantValue=0}]}", postAgg.toString());
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ArrayOfDoublesSketchTTestPostAggregatorTest method testSerde.
@Test
public void testSerde() throws JsonProcessingException {
final PostAggregator there = new ArrayOfDoublesSketchTTestPostAggregator("a", Arrays.asList(new ConstantPostAggregator("", 0), new ConstantPostAggregator("", 0)));
DefaultObjectMapper mapper = new DefaultObjectMapper();
ArrayOfDoublesSketchTTestPostAggregator andBackAgain = mapper.readValue(mapper.writeValueAsString(there), ArrayOfDoublesSketchTTestPostAggregator.class);
Assert.assertEquals(there, andBackAgain);
Assert.assertArrayEquals(there.getCacheKey(), andBackAgain.getCacheKey());
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ArrayOfDoublesSketchTTestPostAggregatorTest method testComparator.
@Test
public void testComparator() {
expectedException.expect(IAE.class);
expectedException.expectMessage("Comparing arrays of p values is not supported");
PostAggregator postAgg = new ArrayOfDoublesSketchTTestPostAggregator("a", Arrays.asList(new ConstantPostAggregator("", 0), new ConstantPostAggregator("", 0)));
postAgg.getComparator();
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ArrayOfDoublesSketchToEstimatePostAggregatorTest method testToString.
@Test
public void testToString() {
PostAggregator postAgg = new ArrayOfDoublesSketchToEstimatePostAggregator("a", new ConstantPostAggregator("", 0));
Assert.assertEquals("ArrayOfDoublesSketchToEstimatePostAggregator{name='a', field=ConstantPostAggregator{name='', constantValue=0}}", postAgg.toString());
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ArrayOfDoublesSketchToNumEntriesPostAggregatorTest method testSerde.
@Test
public void testSerde() throws JsonProcessingException {
final PostAggregator there = new ArrayOfDoublesSketchToNumEntriesPostAggregator("a", new ConstantPostAggregator("", 0));
DefaultObjectMapper mapper = new DefaultObjectMapper();
ArrayOfDoublesSketchToNumEntriesPostAggregator andBackAgain = mapper.readValue(mapper.writeValueAsString(there), ArrayOfDoublesSketchToNumEntriesPostAggregator.class);
Assert.assertEquals(there, andBackAgain);
Assert.assertArrayEquals(there.getCacheKey(), andBackAgain.getCacheKey());
}
Aggregations