HyperUnique aggregator in javascript

Hi ,

I am trying to run some post aggregation on a hyperunique aggregator object. However unable to get this working. Can someone tell me how to run javascript using hyperunique aggregator? Would be really helpful.

“postAggregations”: [{

“type” : “javascript”,

“name” : “result”,

“function” : “function(UNIQUEUSERS) {return Math.round(UNIQUEUSERS) }”,

“fields” : [

{ “type” : “hyperUniqueCardinality”, “name” : “temp”, “fieldName” : “UNIQUEUSERS” }

],

}],

“aggregations”: [{

{

“type”: “hyperUnique”,

“fieldName”: “uniqueUsers”,

“name”: “UNIQUEUSERS”

}]

Thanks,

Rajitha

Try wrapping it in a “finalizingFieldAccess” postAggregator first, and then referring to that postAggregator in the javascript function.

The finalizingFieldAccess postAggregator was added in 0.10.0 but we missed adding docs for it. I just wrote some docs in this patch here: https://github.com/druid-io/druid/pull/4737/files