Querying

Imply includes several different ways you can interact with your data.

Direct Druid queries

Druid supports a rich family of JSON-based queries. You can make these queries through the Druid Broker by POSTing to http://QUERY_SERVER:8082/druid/v2/.

PlyQL

PlyQL is a SQL-like query language for Druid. You can query it using the plyql command line tool included in the Imply distribution. For example, if you have the wikiticker dataset from the quickstart loaded, you could run this query:

bin/plyql --host QUERY_SERVER:8082 -q "SELECT page, SUM(count) AS Edits FROM wikiticker WHERE '2015-09-12T00:00:00' <= __time AND __time < '2015-09-13T00:00:00' GROUP BY page ORDER BY Edits DESC LIMIT 5"

And it will return the five most frequently edited pages for 2015-09-12:

page                                                                  Edits
Wikipedia:Vandalismusmeldung                                          33
User:Cyde/List of candidates for speedy deletion/Subpage              28
Jeremy Corbyn                                                         27
Wikipedia:Administrators' noticeboard/Incidents                       21
Flavia Pennetta                                                       20

To learn more, see the documentation.

Pivot

Pivot is a web-based exploratory visualization UI for Druid built on top of Plywood. You can visit it in your browser at http://QUERY_SERVER:9095/pivot.

With Pivot, you explore a dataset by filtering and splitting it across any dimension. For each filtered split of your data, Pivot can show you the aggregate value of any of your measures. Pivot offers different visualizations based on how you split your data. If you split on a string column, you will generally see a table. If you split on time, you can see either a timeseries plot or a table.

Pivot can be customized through settings, as described on our Pivot configuration page.

Plywood

Plywood is a JavaScript library that simplifies building interactive visualizations and applications for large data sets. Plywood acts as a middle-layer between data visualizations and data stores.

Plywood is architected around the principles of nested Split-Apply-Combine, a powerful divide-and-conquer algorithm that can be used to construct all types of data visualizations. Plywood comes with its own expression language where a single Plywood expression can translate to multiple database queries, and where results are returned in a nested data structure so they can be easily consumed by visualizaton libraries such as D3.js.

You can use Plywood in the browser and/or in node.js to easily create your own visualizations and applications.

To learn more, see the Plywood documentation.

Other options

There are many more query tools for Druid than we've included here, including other UIs, other SQL engines, and libraries for various languages like Python and Ruby. Please see the list of libraries at the Druid site for more!

How can we help?