Custom PostAggregator extension example?

Hiya,

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:

@Override

public List<? extends Module> getJacksonModules() {

return Collections.singletonList(

       new SimpleModule("MyPostAggregatorModule")

               .registerSubtypes(

                       new NamedType(MyPostAggregator.class, "myPostAggregator")

               )

);

}

``

Thanks,

Dyana

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

As an example you can refer DoubleSketchToHistogramPostAggregator -

https://github.com/apache/incubator-druid/blob/master/extensions-core/datasketches/src/main/java/io/druid/query/aggregation/datasketches/quantiles/DoublesSketchToHistogramPostAggregator.java#L37

Brilliant, thanks for the response.

Dyana