Skip to content

Commit 95ef912

Browse files
fix(flightsql): remove Any encoding of DoPutPreparedStatementUpdateResult (#5817)
1 parent 1634a65 commit 95ef912

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

arrow-flight/src/sql/client.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,9 @@ impl PreparedStatement<Channel> {
552552
&self,
553553
put_result: &PutResult,
554554
) -> Result<Option<Bytes>, ArrowError> {
555-
let any = Any::decode(&*put_result.app_metadata).map_err(decode_error_to_arrow_error)?;
556-
Ok(any
557-
.unpack::<DoPutPreparedStatementResult>()?
558-
.and_then(|result| result.prepared_statement_handle))
555+
let result: DoPutPreparedStatementResult =
556+
Message::decode(&*put_result.app_metadata).map_err(decode_error_to_arrow_error)?;
557+
Ok(result.prepared_statement_handle)
559558
}
560559

561560
/// Close the prepared statement, so that this PreparedStatement can not used

arrow-flight/src/sql/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ where
718718
.do_put_prepared_statement_query(command, request)
719719
.await?;
720720
let output = futures::stream::iter(vec![Ok(PutResult {
721-
app_metadata: result.as_any().encode_to_vec().into(),
721+
app_metadata: result.encode_to_vec().into(),
722722
})]);
723723
Ok(Response::new(Box::pin(output)))
724724
}

0 commit comments

Comments
 (0)