From 64bfbc46b66f75734214961e23f3cddf1abbc34b Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 12 Mar 2025 12:59:54 +0100 Subject: [PATCH 1/2] chore: Use serde_json::value::RawValue for data and columns --- CHANGELOG.md | 4 ++++ trino-lb-core/src/trino_api.rs | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb8a38e..69622b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,11 @@ All notable changes to this project will be documented in this file. - Support configuring compression for OTEL ([#70]). - Improve tracing details by adding a `tower_http::trace::TraceLayer` that creates spans for every HTTP request ([#71]). + +### Changed + - Improve tracing for running queries on Trino, adding spans for the request to Trino and parsing ([#71]). +- Improve performance by using [`serde_json::value::RawValue`](https://docs.rs/serde_json/latest/serde_json/value/struct.RawValue.html) for the `data` and `columns` attributes to avoid unended deserialization and serialization of them ([#XX]). [#70]: https://github.com/stackabletech/trino-lb/pull/70 [#71]: https://github.com/stackabletech/trino-lb/pull/71 diff --git a/trino-lb-core/src/trino_api.rs b/trino-lb-core/src/trino_api.rs index 60e3ce9..5867151 100644 --- a/trino-lb-core/src/trino_api.rs +++ b/trino-lb-core/src/trino_api.rs @@ -5,6 +5,7 @@ use std::{ use prusto::{QueryError, Warning}; use serde::{Deserialize, Serialize}; +use serde_json::value::RawValue; use snafu::{ResultExt, Snafu}; use tracing::instrument; use url::Url; @@ -42,8 +43,8 @@ pub struct TrinoQueryApiResponse { pub info_uri: String, pub partial_cancel_uri: Option, - pub columns: Option, - pub data: Option, + pub columns: Option>, + pub data: Option>, pub error: Option, pub warnings: Vec, From f726d325dc896a11884949b863aabc05a8568ada Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 12 Mar 2025 13:03:34 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69622b9..a3f2e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,11 @@ All notable changes to this project will be documented in this file. ### Changed - Improve tracing for running queries on Trino, adding spans for the request to Trino and parsing ([#71]). -- Improve performance by using [`serde_json::value::RawValue`](https://docs.rs/serde_json/latest/serde_json/value/struct.RawValue.html) for the `data` and `columns` attributes to avoid unended deserialization and serialization of them ([#XX]). +- Improve performance by using [`serde_json::value::RawValue`](https://docs.rs/serde_json/latest/serde_json/value/struct.RawValue.html) for the `data` and `columns` attributes to avoid unneeded deserialization and serialization of them ([#73]). [#70]: https://github.com/stackabletech/trino-lb/pull/70 [#71]: https://github.com/stackabletech/trino-lb/pull/71 +[#73]: https://github.com/stackabletech/trino-lb/pull/73 ## [0.4.1] - 2025-03-03