Aggregate Queries With Druid


I am having some trouble getting aggregates in druid. Most likely its something that I am missing.

I am using tranquility to write my event. Event and Beam look like :

case class SimpleEvent(ts: DateTime, fields: collection.mutable.Map[String, String]) {
  def toMap = fields ++ Map(DruidBeams.DefaultTimestampSpec.getTimestampColumn -> ts.toString())

val aggregators = Seq(new LongSumAggregatorFactory("count", "count"))
    .builder((eventMap: SimpleEvent) => new DateTime())
    .location(DruidLocation(indexService, firehosePattern, dataSource))
    .rollup(DruidRollup(DruidDimensions.schemalessWithExclusions(util.Arrays.asList("test")), aggregators, QueryGranularity.MINUTE))
        segmentGranularity = Granularity.HOUR,
        windowPeriod = new Period("PT10M"),
        partitions = 1,
        replicants = 1

My event map indexes dimensions “channel” and “enrich”. I am expecting that the count will provide me with an aggregate of these channels.

Please find attached 2 queries that I have tried.

curl -X POST ‘http://localhost:8082/druid/v2/?pretty’ -H ‘content-type: application/json’ -d@test-enrich-group.body

[ {

“timestamp” : “2015-11-12T18:00:00.000Z”,

“result” : [ {

“dimension” : “enrich”,

“value” : “n”

} ]

} ]

But the group by returns nothing. Could you please help me figure out what is the issue with the group by query?


test-enrich.body (323 Bytes)

test-enrich-group.body (376 Bytes)

Hi Deepika, do you happen to have a sample event?