Accessing data using Apache Druid
Also available as:
PDF

Query Apache Druid

You use the Druid native query format in JSON to query Druid for the top 10 Wikipedia articles from the data Druid ingested earlier.

  1. Create the following file and save it as wickiticker-top.json.
    {
      "queryType" : "topN",
      "dataSource" : "wikipedia",
      "intervals" : ["2015-09-12/2015-09-13"],
      "granularity" : "all",
      "dimension" : "page",
      "metric" : "count",
      "threshold" : 10,
      "aggregations" : [
         {
           "type" : "count",
           "name" : "count"
          }
       ]
    }
  2. Call HTTP to query Druid for the top 10 most-edited Wikipedia articles.
    curl -X 'POST' -H 'Content-Type:application/json' -d @wikiticker-top.json http://localhost:8082/druid/v2?pretty