Can not build project
There are three compile errors:
- The constructor DruidNode(String, null, null) is undefined
JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class),
new DruidNode("druid-client", null, null));
- The constructor DirectDruidClient(QueryToolChestWarehouse, QueryWatcher, ObjectMapper, HttpClient, String, ServiceEmitter) is undefined
final DirectDruidClient directDruidClient = new DirectDruidClient(WAREHOUSE, WATCHER, SMILE_MAPPER, httpClient,
host, SERVICE_EMITTER);
- The constructor DirectDruidClient(QueryToolChestWarehouse, QueryWatcher, ObjectMapper, HttpClient, String, ServiceEmitter) is undefined
final DirectDruidClient directDruidClient = new DirectDruidClient(WAREHOUSE, WATCHER, SMILE_MAPPER, httpClient,
host, SERVICE_EMITTER);
Please review it! (Thank for great project)
Yes. Have the same issue in main branch as well. Seems it's due to the api change in the upstream druid-server. May need to update the client as well .Thanks
Seems the DirectDruidClient constructor needs a new string parameter named scheme, it's http or https based on the server port config. In client, I guess we need to pass in the parameter based on the broker config. Hope somebody who is familiar with the druid source can confirm and fix it .Thanks.
public DirectDruidClient(
QueryToolChestWarehouse warehouse,
QueryWatcher queryWatcher,
ObjectMapper objectMapper,
HttpClient httpClient,
String scheme,
String host,
ServiceEmitter emitter
)
final DirectDruidClient directDruidClient = new DirectDruidClient(
WAREHOUSE,
WATCHER,
SMILE_MAPPER,
httpClient,
"http",
host,
SERVICE_EMITTER
);
Seems the DirectDruidClient constructor needs a new string parameter named scheme, it's http or https based on the server port config. In client, I guess we need to pass in the parameter based on the broker config. Hope somebody who is familiar with the druid source can confirm and fix it .Thanks.
public DirectDruidClient(
QueryToolChestWarehouse warehouse,
QueryWatcher queryWatcher,
ObjectMapper objectMapper,
HttpClient httpClient,
String scheme,
String host,
ServiceEmitter emitter
)
final DirectDruidClient directDruidClient = new DirectDruidClient(
WAREHOUSE,
WATCHER,
SMILE_MAPPER,
httpClient,
"http",
host,
SERVICE_EMITTER
);
Can someone please fix this ASAP?
Hi @Janesh this repository is just an example of how you might use internal unstable Druid APIs, and it isn't officially supported. If you are looking for something more stable then try Druid SQL (http://druid.io/docs/latest/querying/sql.html) -- which includes a JDBC driver -- or the Druid native JSON API.
@gianm - Thanks for the clarification. How about using the druid-processing API directly (i.e using classes like https://github.com/druid-io/druid/blob/master/processing/src/main/java/io/druid/query/Druids.java, https://github.com/druid-io/druid/blob/master/processing/src/main/java/io/druid/query/Query.java etc)? Is the druid-processing API stable for external client use? Or, is it better for Java clients to use the SQL queries? The 3rd option being direct JSON request-response from Java. Any guidance is much appreciated.
Hi @Janesh, none of the query stuff in druid-processing is considered a stable API. They will work, but if you use them then you will often need to fix compile breakages due to API changes.
The three stable APIs for external clients are all either web or jdbc based.
- Native queries using HTTP (http://druid.io/docs/latest/querying/querying.html)
- SQL using HTTP (http://druid.io/docs/latest/querying/sql.html)
- SQL using JDBC through Avatica (http://druid.io/docs/latest/querying/sql.html)
@gianm - Thank you so much for clarifying this :-). Really appreciate your help 👍
@Janesh happy to help
@gianm thanks for your support. A "working" java client like this would be very useful and make a great addition to the Druid ecosystem.
Hi @fmarelli, I agree in principle although currently we are focusing our efforts on supporting JSON/HTTP clients and on the SQL layer. If only we had infinite resources :)
In the meantime I hope you find what you are looking for.
HI @gianm I fully understand where you are coming from. I've been effectively using Druid with jdbc SQL in the last few months, thanks for the great work. Cheers