Instantiation of [simple type, class io.druid.query.aggregation.JavaScriptAggregatorFactory]

I have this query using Javascript, and am getting error while running. I have druid.javascript.enabled=true, so I’m not sure what else is wrong with my query.

{

“queryType”:“groupBy”,

“dataSource”:“ds”,

“granularity”:“day”,

“dimensions”: [“name”],

“filter”: {

"type": "and",

"fields": [

	{"type": "selector", "dimension": "user", "value": "smith"}

]

},

“aggregations”:[

  { "type":"count", "name": "total_runs", "fieldName": "total_runs"},

  { "type": "javascript",

    "name": "total_passed",

    "fieldName"  : ["status"],

    "fnAggregate": "function(current, status) { return current + (status != null && status == 'passed' ? 1 : 0); }",

    "fnCombine"  : "function(partialA, partialB) { return partialA + partialB; }",

    "fnReset"    : "function()                   { return 0; }"

  }

],

“intervals”:[

  "2018-02-13/2018-02-14"

]

}

This is the error being thrown:

{

"error": "Unknown exception",

"errorMessage": "Instantiation of [simple type, class io.druid.query.aggregation.JavaScriptAggregatorFactory] value failed: Must have a valid, non-null fieldNames (through reference chain: java.util.ArrayList[1])",

"errorClass": "com.fasterxml.jackson.databind.JsonMappingException",

"host": null

}

Any idea? Thanks.

L

Nevermind, i found my typo “fieldNames” missing a ‘s’. :stuck_out_tongue: