Java Query Library?

My company needs Druid for interactive analytics.

With all the query libraries available as listed (, why is there no java client library? Java is very popular.

I need the client library to issue nested groupBys or iterated topNs. I don’t wanna reinvent the wheel of the logic to create the json query string especially in a nested form.

Does anyone know why?


Hi Geoff,

Quite simply because no one so far has needed one badly enough to make it happen. I guess Java web frameworks aren’t that popular these days.

That being said, there are some helper classes to write queries within the Druid codebase, but currently they require you to pull in most of Druid itself to write any kind of queries. Splitting those out of the main Druid codebase is a significant undertaking that has not made it high enough on anyone’s priority list yet.




Thanks for reply, but I’m not talking about a web framework - just a java client library to make nested queries easier than manipulating a json string.

In addition, if Druid has client library for js, clojure, python, R, ruby, SQL - why would Java be NOT on the list? That seems very strange to me.

Maybe I’m missing something?


druid-api and druid-processing is its own query library in a way. If you’re using stock druid query types and aggregates, then you can just build a query with druid-processing and make sure your http-client can serialize with Jackson.

It’s been a long time since I tinkered with that, so there may be some corner cases.

The best Java query library for Druid right now is this class:

You can include it in your project and use it to construct Druid queries.

We should definitely take the class out and put it into an explicit Java library. Other folks in the community have asked for this before.

– FJ