From de5deaeb36e98bc5444ae1ad3e05380e1fe05e8b Mon Sep 17 00:00:00 2001 From: Rafael Telles Date: Wed, 18 Aug 2021 16:37:57 -0300 Subject: [PATCH] Fix missing client_execution_handle on CommandStatementQuery (#86) --- format/FlightSql.proto | 3 +++ .../java/org/apache/arrow/flight/sql/FlightSqlClient.java | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/format/FlightSql.proto b/format/FlightSql.proto index 5777c43012343..e77c17ff4cef1 100644 --- a/format/FlightSql.proto +++ b/format/FlightSql.proto @@ -384,6 +384,9 @@ message CommandStatementQuery { // The SQL syntax. string query = 1; + + // Unique identifier for the instance of the statement to execute. + bytes client_execution_handle = 2; } /* diff --git a/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java b/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java index fef954e378c9e..2ab8ecd705af0 100644 --- a/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java +++ b/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java @@ -361,7 +361,6 @@ public PreparedStatement prepare(final String query, final CallOption... options public static class PreparedStatement implements AutoCloseable { private final FlightClient client; private final ActionCreatePreparedStatementResult preparedStatementResult; - private final AtomicLong invocationCount; private VectorSchemaRoot parameterBindingRoot; private boolean isClosed; private Schema resultSetSchema; @@ -389,7 +388,6 @@ public PreparedStatement(final FlightClient client, final String sql, final Call preparedStatementResults.next().getBody(), ActionCreatePreparedStatementResult.class); - invocationCount = new AtomicLong(0); isClosed = false; } @@ -464,8 +462,6 @@ public FlightInfo execute(final CallOption... options) throws SQLException { final FlightDescriptor descriptor = FlightDescriptor .command(Any.pack(CommandPreparedStatementQuery.newBuilder() - .setClientExecutionHandle( - ByteString.copyFrom(ByteBuffer.allocate(Long.BYTES).putLong(invocationCount.getAndIncrement()))) .setPreparedStatementHandle(preparedStatementResult.getPreparedStatementHandle()) .build()) .toByteArray()); @@ -502,8 +498,6 @@ public long executeUpdate(final CallOption... options) { checkOpen(); final FlightDescriptor descriptor = FlightDescriptor .command(Any.pack(FlightSql.CommandPreparedStatementUpdate.newBuilder() - .setClientExecutionHandle( - ByteString.copyFrom(ByteBuffer.allocate(Long.BYTES).putLong(invocationCount.getAndIncrement()))) .setPreparedStatementHandle(preparedStatementResult.getPreparedStatementHandle()) .build()) .toByteArray());