com.yahoo.sketches.theta.HeapCompactOrderedSketch cannot be cast to java.lang.Number

Hi

When I use post aggregator ,I get some errors,see below,

{

“error” : “com.yahoo.sketches.theta.HeapCompactOrderedSketch cannot be cast to java.lang.Number”

}

my query json like:

{

“queryType”: “groupBy”,

“dataSource”: “test_event”,

“granularity”: {“type”: “period”, “period”: “PT1M”, “timeZone”: “Asia/Shanghai”},

“aggregations”: [

{ “type”: “thetaSketch”, “name”: “uv”, “fieldName”: “uuid” },

{ “type”: “longSum”, “name”: “pv”, “fieldName”: “count” }

],

“filter”: {

" type": “selector”, “dimension”: “test”, “value”: “default”

},

“intervals”: [ “2017-02-14T00:00:00/2017-02-14T23:59:59” ],

“postAggregations” : [{

“type” : “arithmetic”,

“name” : “avg”,

“fn” : “/”,

“fields” : [

{ “type” : “fieldAccess”, “fieldName” : “uv” },

{ “type” : “fieldAccess”, “name” : “pv”, “fieldName” : “pv” }

]

}]

}

What’s you advice here?Thanks~~

Try putting it through a thetaSketchEstimate post-aggregator first before the fieldAccess.

Hi Gian,

When I change the fieldAccess as thetaSketchEstimate ,I get other errors,see below:

“error” : “Unexpected token (VALUE_STRING), expected FIELD_NAME: missing property ‘type’ that is to contain type id (for class io.druid.query.aggregation.PostAggregator)\n at [Source: HttpInputOverHTTP@3285a137; line: 1, column: 602] (through reference chain: java.util.ArrayList[0]->java.util.ArrayList[0])”

my post aggregator config like:

“postAggregations” : [{
“type” : “arithmetic”,

“name” : “avg”,

“fn” : “/”,

“fields” : [

{ “type” : “thetaSketchEstimate”,“name”:“uv”, “field” : “uv” },

{ “type” : “fieldAccess”, “name” : “pv”, “fieldName” : “pv” }

]

}]

Do you have some ideas here?Thanks~~

在 2017年2月14日星期二 UTC+8下午2:31:47,cool…@126.com写道:

The “field” of the thetaSketchEstimate is meant to be another PostAggregator object, so that should be:

{

“type”: “thetaSketchEstimate”,

“name”: “uv_estimate”,

“field”: {

“type”: “fieldAccess”,

“fieldName”: “uv”

}

}