Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ksqlDb Java Client should support EXPLAIN statements #8042

Open
wicknicks opened this issue Aug 23, 2021 · 0 comments
Open

ksqlDb Java Client should support EXPLAIN statements #8042

wicknicks opened this issue Aug 23, 2021 · 0 comments
Labels
enhancement java-client streaming-engine Tickets owned by the ksqlDB Streaming Team

Comments

@wicknicks
Copy link
Member

Is your feature request related to a problem? Please describe.
We are using the java client to interact with ksqldb clusters. but the client is unable to execute EXPLAIN statements, which is useful to look at output schemas and execution plan of queries.

Describe the solution you'd like
The Java client should add support for QueryDescription entities which contains the bulk of the response for this statement.

Describe alternatives you've considered
Would be nice to have a "low level" method that returns the raw response for any generic ksqldb statement. This way, users don't have to wait for changes in java client to unblock them.

Additional context
Error message when trying to run explain statements:

java.util.concurrent.ExecutionException: io.confluent.ksql.api.client.exception.KsqlClientException: The executeStatement() method is only for 'CREATE', 'CREATE ... AS SELECT', 'DROP', 'TERMINATE', and 'INSERT INTO ... AS SELECT' statements. The client does not currently support 'EXPLAIN <QUERY_ID>' statements.
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)

Caused by: io.confluent.ksql.api.client.exception.KsqlClientException: The executeStatement() method is only for 'CREATE', 'CREATE ... AS SELECT', 'DROP', 'TERMINATE', and 'INSERT INTO ... AS SELECT' statements. The client does not currently support 'EXPLAIN <QUERY_ID>' statements.
	at io.confluent.ksql.api.client.impl.DdlDmlResponseHandlers.handleUnexpectedEntity(DdlDmlResponseHandlers.java:97)
	at io.confluent.ksql.api.client.impl.DdlDmlResponseHandlers.handleExecuteStatementResponse(DdlDmlResponseHandlers.java:41)
	at io.confluent.ksql.api.client.impl.ClientImpl.lambda$handleSingleEntityResponse$22(ClientImpl.java:579)
	at io.vertx.core.http.impl.HttpClientResponseImpl$BodyHandler.notifyHandler(HttpClientResponseImpl.java:292)
@cprasad1 cprasad1 added the streaming-engine Tickets owned by the ksqlDB Streaming Team label Aug 23, 2021
@vcrfxia vcrfxia assigned wicknicks and unassigned wicknicks Aug 24, 2021
wicknicks added a commit that referenced this issue Sep 14, 2021
…he ksqldb-api-client (#8118)

* Add classes for low level HTTP calls

This PR adds methods and classes that allow users to directly execute HTTP requests against ksqldb's REST server. The API client today uses a number of "high level" classes. With an 'escape hatch' as implemented in this PR, users do not need to wait for all the REST APIs, request and response objects to be implemented as java objects and classes in the api-client.

This PR resolves one of the issues described in #8042.

Signed-off-by: Arjun Satish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement java-client streaming-engine Tickets owned by the ksqlDB Streaming Team
Projects
None yet
Development

No branches or pull requests

3 participants