Skip to content

Commit

Permalink
Fix missing client_execution_handle on CommandStatementQuery (apache#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-telles committed Aug 27, 2021
1 parent 1a17470 commit de5deae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 3 additions & 0 deletions format/FlightSql.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit de5deae

Please sign in to comment.