From 42adc32bee8b8007ba2a7bd94677876f81f005e8 Mon Sep 17 00:00:00 2001 From: Adam Curtis Date: Wed, 29 May 2024 15:06:00 -0400 Subject: [PATCH] fix(flightsql): remove Any encoding of DoPutPreparedStatementUpdateResult --- arrow-flight/src/sql/client.rs | 3 +-- arrow-flight/src/sql/server.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arrow-flight/src/sql/client.rs b/arrow-flight/src/sql/client.rs index 29782a2bc44..dc145cf63f1 100644 --- a/arrow-flight/src/sql/client.rs +++ b/arrow-flight/src/sql/client.rs @@ -485,8 +485,7 @@ impl PreparedStatement { .await .map_err(status_to_arrow_error)? .unwrap(); - let any = Any::decode(&*result.app_metadata).map_err(decode_error_to_arrow_error)?; - let result: DoPutUpdateResult = any.unpack()?.unwrap(); + let result: DoPutUpdateResult = Message::decode(&*result.app_metadata).map_err(decode_error_to_arrow_error)?; Ok(result.record_count) } diff --git a/arrow-flight/src/sql/server.rs b/arrow-flight/src/sql/server.rs index c18024cf068..d758388c981 100644 --- a/arrow-flight/src/sql/server.rs +++ b/arrow-flight/src/sql/server.rs @@ -736,7 +736,7 @@ where .await?; let result = DoPutUpdateResult { record_count }; 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))) }