Skip to content

Commit d689a88

Browse files
authored
chore: Use serde_json::value::RawValue for data and columns (#73)
* chore: Use serde_json::value::RawValue for data and columns * changelog
1 parent 37c1a29 commit d689a88

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ All notable changes to this project will be documented in this file.
88

99
- Support configuring compression for OTEL ([#70]).
1010
- Improve tracing details by adding a `tower_http::trace::TraceLayer` that creates spans for every HTTP request ([#71]).
11+
12+
### Changed
13+
1114
- Improve tracing for running queries on Trino, adding spans for the request to Trino and parsing ([#71]).
15+
- 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]).
1216

1317
[#70]: https://github.com/stackabletech/trino-lb/pull/70
1418
[#71]: https://github.com/stackabletech/trino-lb/pull/71
19+
[#73]: https://github.com/stackabletech/trino-lb/pull/73
1520

1621
## [0.4.1] - 2025-03-03
1722

trino-lb-core/src/trino_api.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::{
55

66
use prusto::{QueryError, Warning};
77
use serde::{Deserialize, Serialize};
8+
use serde_json::value::RawValue;
89
use snafu::{ResultExt, Snafu};
910
use tracing::instrument;
1011
use url::Url;
@@ -42,8 +43,8 @@ pub struct TrinoQueryApiResponse {
4243
pub info_uri: String,
4344
pub partial_cancel_uri: Option<String>,
4445

45-
pub columns: Option<serde_json::Value>,
46-
pub data: Option<serde_json::Value>,
46+
pub columns: Option<Box<RawValue>>,
47+
pub data: Option<Box<RawValue>>,
4748

4849
pub error: Option<QueryError>,
4950
pub warnings: Vec<Warning>,

0 commit comments

Comments
 (0)