use of org.apache.druid.query.aggregation.datasketches.theta.SketchHolder in project druid by druid-io.
the class OldApiSketchAggregationTest method testRelocation.
@Test
public void testRelocation() {
final TestColumnSelectorFactory columnSelectorFactory = GrouperTestUtil.newColumnSelectorFactory();
SketchHolder sketchHolder = SketchHolder.of(Sketches.updateSketchBuilder().setNominalEntries(16).build());
UpdateSketch updateSketch = (UpdateSketch) sketchHolder.getSketch();
updateSketch.update(1);
columnSelectorFactory.setRow(new MapBasedRow(0, ImmutableMap.of("sketch", sketchHolder)));
SketchHolder[] holders = helper.runRelocateVerificationTest(new OldSketchMergeAggregatorFactory("sketch", "sketch", 16, false), columnSelectorFactory, SketchHolder.class);
Assert.assertEquals(holders[0].getEstimate(), holders[1].getEstimate(), 0);
}
Aggregations