Can you use any field name in a post-aggregation or just aggregates?
iI have this event coming back as the result of a query:
{
"version" : "v1",
"timestamp" : "2013-08-19T00:00:00.000Z",
"event" : {
"totalcount" : 92918,
"searchphrase" : "apple jobs",
"relevance" : 1.0,
"word" : "your",
"baseline" : "834953"
}
I'm trying to divide totalcount by baseline w/ the following:
"postAggregations": [{
"type": "arithmetic",
"name": "relevance",
"fn": "/",
"fields": [
{ "type": "fieldAccess", "fieldName": "totalcount" },
{ "type": "fieldAccess", "fieldName": "baseline" }
]
}],
This results in:
Instantiation of [simple type, class com.metamx.druid.query.group.GroupByQuery] value failed: Missing fields [[baseline]] for postAggregator [relevance]
But the same works if I s/baseline/totalcount/g.
What am I missing? It looks like the type of baseline might be a String? (is that the issue?)
I'm constructing the row with:
Long baseline = (Long) tuple.getValue(3);
theMap.put("baseline", baseline);
-brian