You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/08 05:11:20 UTC
[jira] [Commented] (DRILL-4732) Update JDBC driver to use the new
prepared statement APIs on DrillClient
[ https://issues.apache.org/jira/browse/DRILL-4732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15411298#comment-15411298 ]
ASF GitHub Bot commented on DRILL-4732:
---------------------------------------
Github user vkorukanti commented on a diff in the pull request:
https://github.com/apache/drill/pull/532#discussion_r73822938
--- Diff: exec/jdbc/src/main/java/org/apache/drill/jdbc/impl/DrillConnectionImpl.java ---
@@ -362,12 +364,33 @@ public PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetHoldability) throws SQLException {
throwIfClosed();
try {
- DrillPrepareResult prepareResult = new DrillPrepareResult(sql);
+ DrillRpcFuture<CreatePreparedStatementResp> respFuture = client.createPreparedStatement(sql);
+
+ CreatePreparedStatementResp resp;
+ try {
+ resp = respFuture.get();
+ } catch (InterruptedException e) {
+ // Preserve evidence that the interruption occurred so that code higher up
+ // on the call stack can learn of the interruption and respond to it if it
+ // wants to.
+ Thread.currentThread().interrupt();
+
+ throw new SQLException( "Interrupted", e );
--- End diff --
This is a create prepared statement query. Even if the client receives a message after the interrupt, the response is going to be a protobuf message (no DrillBufs). The query that is executed on client side (`LIMIT 0` query) has definitive timeout and result buffers are already released on server side (see `UserClientConnectionWrapper` in `PreparedStatementProvider`), before preparing a response message to create prepare statement request.
> Update JDBC driver to use the new prepared statement APIs on DrillClient
> ------------------------------------------------------------------------
>
> Key: DRILL-4732
> URL: https://issues.apache.org/jira/browse/DRILL-4732
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Metadata
> Reporter: Venki Korukanti
> Assignee: Venki Korukanti
> Fix For: 1.8.0
>
>
> DRILL-4729 is adding new prepared statement implementation on server side and it provides APIs on DrillClient to create new prepared statement which returns metadata along with a opaque handle and submit prepared statement for execution.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)