A couple of months ago, I mentioned on this list that I was developing a Druid adapter for Apache Calcite. The initial version of that adapter is complete, and has just been released as part of Calcite 1.8.0.
If anyone would like to kick the tires, the easiest way might be to build from source. Using JDK 1.7 or 1.8, maven 3.2.1 or later, and Druid 0.9.0:
$ git clone
https://github.com/apache/calcite.git
$ cd calcite
$ git checkout calcite-1.8.0
$ mvn -DskipTests install
$ ./sqlline
> !connect jdbc:calcite:schemaFactory=org.apache.calcite.adapter.druid.DruidSchemaFactory;schema.url=http://localhost:8082;schema.coordinatorUrl=
http://localhost:8081 admin admin
> !tables
+-----------+-------------+------------+
| TABLE_CAT | TABLE_SCHEM | TABLE_NAME |
+-----------+-------------+------------+
| | adhoc | foodmart |
| | adhoc | wikiticker |
| | metadata | COLUMNS |
| | metadata | TABLES |
+-----------+-------------+------------+
> select count(*) from "wikiticker";
+---------------------+
| EXPR$0 |
+---------------------+
| 39244 |
+---------------------+
1 row selected (1.005 seconds)
> explain plan for select count(*) from "wikiticker";
EnumerableInterpreter
DruidQuery(table=[[adhoc, wikiticker]], projects=[[]], groups=[{}], aggs=[[COUNT()]])
1 row selected (0.047 seconds)
> !quit
Change the URLs in your connect string appropriate for your Druid configuration. Calcite should find your data sources automatically, and expose them as tables that you can query.
There are also pre-built jars in Maven central:
<dependencies>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-druid</artifactId>
<version>1.8.0</version>
</dependency>
</dependencies>
Please give it a try. There is more online documentation[1]. If you find bugs, log a JIRA case [2] or post to Calcite's dev list[3].
Julian
[1]
http://calcite.apache.org/docs/druid_adapter.html
[2]
https://issues.apache.org/jira/browse/CALCITE
[3]
https://mail-archives.apache.org/mod_mbox/calcite-dev/