Custom PostAggregator extension example?


I can find numerous examples of properly setting up custom Aggregator extensions, but I don’t seem to be able to find one for a PostAggregator extension.

Can anyone point me to one?

My main questions are, considering the Aggregator requires an Aggregator, AggragatorFactory and a BufferAggregator, the PostAggregator doesn’t look to require anything other than implementing PostAggregator, is that correct?

In the DruidModule, is the PostAggregator then registered like:


public List<? extends Module> getJacksonModules() {

return Collections.singletonList(

       new SimpleModule("MyPostAggregatorModule")


                       new NamedType(MyPostAggregator.class, "myPostAggregator")







Yes, this is correct, you need to register your own implementation of PostAggregator using jackson.

As an example you can refer DoubleSketchToHistogramPostAggregator -

Brilliant, thanks for the response.