--- layout: docs_default --- Aggregations are specifications of processing over metrics available in Druid. Available aggregations are: ### Sum aggregators #### `longSum` aggregator computes the sum of values as a 64-bit, signed integer { "type" : "longSum", "name" : , "fieldName" : } `name` – output name for the summed value `fieldName` – name of the metric column to sum over #### `doubleSum` aggregator Computes the sum of values as 64-bit floating point value. Similar to `longSum` { "type" : "doubleSum", "name" : , "fieldName" : } ### Count aggregator `count` computes the row count that match the filters { "type" : "count", "name" : , } ### Min / Max aggregators #### `min` aggregator `min` computes the minimum metric value { "type" : "min", "name" : , "fieldName" : } #### `max` aggregator `max` computes the maximum metric value { "type" : "max", "name" : , "fieldName" : } ### JavaScript aggregator Computes an arbitrary JavaScript function over a set of columns (both metrics and dimensions). All JavaScript functions must return numerical values. { "type": "javascript", "name": "", "fieldNames" : [ , , ... ], "fnAggregate" : "function(current, column1, column2, ...) { return }" "fnCombine" : "function(partialA, partialB) { return ; }" "fnReset" : "function() { return ; }" } **Example** { "type": "javascript", "name": "sum(log(x)/y) + 10", "fieldNames": ["x", "y"], "fnAggregate" : "function(current, a, b) { return current + (Math.log(a) * b); }" "fnCombine" : "function(partialA, partialB) { return partialA + partialB; }" "fnReset" : "function() { return 10; }" }