Skip to content

Commit

Permalink
fix(flightsql): remove Any encoding of DoPutPreparedStatementUpdateRe…
Browse files Browse the repository at this point in the history
…sult
  • Loading branch information
erratic-pattern committed May 29, 2024
1 parent 1634a65 commit 319fde6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions arrow-flight/src/sql/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,9 @@ impl PreparedStatement<Channel> {
&self,
put_result: &PutResult,
) -> Result<Option<Bytes>, ArrowError> {
let any = Any::decode(&*put_result.app_metadata).map_err(decode_error_to_arrow_error)?;
Ok(any
.unpack::<DoPutPreparedStatementResult>()?
.and_then(|result| result.prepared_statement_handle))
let result: DoPutPreparedStatementResult =
Message::decode(&*put_result.app_metadata).map_err(decode_error_to_arrow_error)?;
Ok(result.prepared_statement_handle)
}

/// Close the prepared statement, so that this PreparedStatement can not used
Expand Down
2 changes: 1 addition & 1 deletion arrow-flight/src/sql/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ where
.do_put_prepared_statement_query(command, request)
.await?;
let output = futures::stream::iter(vec![Ok(PutResult {
app_metadata: result.as_any().encode_to_vec().into(),
app_metadata: result.encode_to_vec().into(),
})]);
Ok(Response::new(Box::pin(output)))
}
Expand Down

0 comments on commit 319fde6

Please sign in to comment.