Decoding Double Values

Hi!
I am trying to use druid to calc some distinct values.

I wrote this query:

{

“queryType”: “groupBy”,

“dataSource”: “usages”,

“granularity”: “hour”,

“dimensions”: [“os” ],

“aggregations”: [

{ “type”: “count”, “name”: “total_usage”, “fieldName”: “uid” },

{“type”: “cardinality”,

“name”: “active_users”,

“fieldNames”: [

“uid”

],

“byRow”: “false”

}

],

“intervals”: [ “2016-01-10T00:00:59.000Z/2016-01-10T23:59:59.000Z” ]

}

But when I get results, I saw some strange values at active_users aggregation:

[ {

“version” : “v1”,

“timestamp” : “2016-01-10T07:00:00.000Z”,

“event” : {

“os” : “Linux+3.19.0-42-generic”,

“total_usage” : 1,

“active_users” : “AQAAAQAAAACyEA==”

}

}, {

“version” : “v1”,

“timestamp” : “2016-01-10T07:00:00.000Z”,

“event” : {

“os” : “Linux+4.2.0-23-generic”,

“total_usage” : 1,

“active_users” : “AQAAAQAAAAGMAQ==”

}

}, {

“version” : “v1”,

“timestamp” : “2016-01-10T07:00:00.000Z”,

“event” : {

“os” : “Mac+OS+X+10.10.2”,

“total_usage” : 1,

“active_users” : “AQAAAQAAAAKmBA==”

}

}, {

“version” : “v1”,

“timestamp” : “2016-01-10T07:00:00.000Z”,

“event” : {

“os” : “Mac+OS+X+10.10.3”,

“total_usage” : 1,

“active_users” : “AQAAAQAAAAKmEA==”

}

}, {

“version” : “v1”,

“timestamp” : “2016-01-10T07:00:00.000Z”,

“event” : {

“os” : “Mac+OS+X+10.11.1”,

“total_usage” : 2,

“active_users” : “AQAAAgAAAAHbEAJZEA==”

}

},

May be some one know, how i can fix this?

Oooo I found what is problem. If you query Broker node all is ok, but if you query Real-time node it returns strange values, like AQAAAQAAAAKmEA==

Cardinality is an approximate calculation and the results that are returned directly from nodes is a 64 bit string that represents the approximate sketch. You can set “finalize”: “true” in the query context and it should return a human-readable result.