-
Notifications
You must be signed in to change notification settings - Fork 41
Sql4DDriver
srikalyan chandrashekar edited this page Jul 29, 2014
·
2 revisions
A simple java (jdbc kind of) driver for Druid that understands DSQL (Druid SQL) .
- Ability to fire groupBy, search, timeseries, topN, select queries.
- Accepts NamedParameters for template based queries(similar to Template JDBC mechanism in Spring). Ex:
String searchContainsAndStrlenSort = "SELECT a, b FROM wiki WHERE interval BETWEEN :startT AND :endT WHICH CONTAINS(:someStuff) SORT('strlen')";
NamedParameters params = new NamedParameters();
params.add("someStuff", "somestuff");
params.add("startT", new Date());
params.add("endT", new DateTime());
DDataSource source = new DDataSource("abc.com", 23);
source.setNamedParams(params);
Either<JSONObject, JSONArray> response = source.query(searchContainsAndStrlenSort);