From 118b1b7c0d72910e7bd6f79087e29258867f383f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 02:11:28 +0000 Subject: [PATCH 1/3] chore(deps): bump pgwire from 0.35.0 to 0.36.0 Bumps [pgwire](https://github.com/sunng87/pgwire) from 0.35.0 to 0.36.0. - [Release notes](https://github.com/sunng87/pgwire/releases) - [Changelog](https://github.com/sunng87/pgwire/blob/master/CHANGELOG.md) - [Commits](https://github.com/sunng87/pgwire/compare/v0.35.0...v0.36.0) --- updated-dependencies: - dependency-name: pgwire dependency-version: 0.36.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2af31ae..7bf4fd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2728,9 +2728,9 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af67f4c689d97c91fb95132942f1e05eadc765448e9ffcc16e792783286d99d" +checksum = "f5cc59678d0c10c73a552d465ce9156995189d1c678f2784dc817fe8623487f5" dependencies = [ "async-trait", "base64", diff --git a/Cargo.toml b/Cargo.toml index 61e526c..3582800 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ bytes = "1.11.0" chrono = { version = "0.4", features = ["std"] } datafusion = { version = "50", default-features = false } futures = "0.3" -pgwire = { version = "0.35", default-features = false } +pgwire = { version = "0.36", default-features = false } postgres-types = "0.2" rust_decimal = { version = "1.39", features = ["db-postgres"] } tokio = { version = "1", default-features = false } From 676183d21e45589e43db1817de6f6bfb4b540921 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Mon, 24 Nov 2025 18:25:52 +0800 Subject: [PATCH 2/3] fix: update pgwire and api adoption --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- arrow-pg/src/datatypes/df.rs | 13 ++++++++++--- datafusion-postgres/src/handlers.rs | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bf4fd4..9f29914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2728,9 +2728,9 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5cc59678d0c10c73a552d465ce9156995189d1c678f2784dc817fe8623487f5" +checksum = "d331bb0eef5bc83a221c0a85b1f205bccf094d4f72a26ae1d68a1b1c535123b7" dependencies = [ "async-trait", "base64", diff --git a/Cargo.toml b/Cargo.toml index 3582800..3ac9eaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ bytes = "1.11.0" chrono = { version = "0.4", features = ["std"] } datafusion = { version = "50", default-features = false } futures = "0.3" -pgwire = { version = "0.36", default-features = false } +pgwire = { version = "0.36.1", default-features = false } postgres-types = "0.2" rust_decimal = { version = "1.39", features = ["db-postgres"] } tokio = { version = "1", default-features = false } diff --git a/arrow-pg/src/datatypes/df.rs b/arrow-pg/src/datatypes/df.rs index 256b1c4..7880df1 100644 --- a/arrow-pg/src/datatypes/df.rs +++ b/arrow-pg/src/datatypes/df.rs @@ -64,7 +64,7 @@ where S: Clone, { fn get_pg_type( - pg_type_hint: Option<&Type>, + pg_type_hint: Option, inferenced_type: Option<&DataType>, ) -> PgWireResult { if let Some(ty) = pg_type_hint { @@ -80,7 +80,14 @@ where let mut deserialized_params = Vec::with_capacity(param_len); for i in 0..param_len { let inferenced_type = inferenced_types.get(i).and_then(|v| v.to_owned()); - let pg_type = get_pg_type(portal.statement.parameter_types.get(i), inferenced_type)?; + let pg_type = get_pg_type( + portal + .statement + .parameter_types + .get(i) + .and_then(|f| f.clone()), + inferenced_type, + )?; match pg_type { // enumerate all supported parameter types and deserialize the // type to ScalarValue @@ -337,7 +344,7 @@ mod tests { #[test] fn test_deserialise_time_params() { - let postgres_types = vec![Type::TIME]; + let postgres_types = vec![Some(Type::TIME)]; let us: i64 = 1_000_000; // 1 second diff --git a/datafusion-postgres/src/handlers.rs b/datafusion-postgres/src/handlers.rs index 7da8fb4..c12b801 100644 --- a/datafusion-postgres/src/handlers.rs +++ b/datafusion-postgres/src/handlers.rs @@ -651,7 +651,7 @@ impl QueryParser for Parser { &self, client: &C, sql: &str, - _types: &[Type], + _types: &[Option], ) -> PgWireResult where C: ClientInfo + Unpin + Send + Sync, From 6e80e8e3dfbecc11f74ecdb2a11202fbd96a6859 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 25 Nov 2025 13:20:18 +0800 Subject: [PATCH 3/3] test: fix test by giving encoding format --- arrow-pg/src/datatypes/df.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arrow-pg/src/datatypes/df.rs b/arrow-pg/src/datatypes/df.rs index 7880df1..d478cbe 100644 --- a/arrow-pg/src/datatypes/df.rs +++ b/arrow-pg/src/datatypes/df.rs @@ -163,6 +163,7 @@ where } Type::TIME => { let value = portal.parameter::(i, &pg_type)?; + dbg!(&value); let ns = value.map(|t| { t.num_seconds_from_midnight() as i64 * 1_000_000_000 + t.nanosecond() as i64 @@ -336,7 +337,7 @@ mod tests { use datafusion::{common::ParamValues, scalar::ScalarValue}; use pgwire::{ api::{portal::Portal, stmt::StoredStatement}, - messages::extendedquery::Bind, + messages::{data::FORMAT_CODE_BINARY, extendedquery::Bind}, }; use postgres_types::Type; @@ -351,7 +352,7 @@ mod tests { let bind = Bind::new( None, None, - vec![], + vec![FORMAT_CODE_BINARY], vec![Some(Bytes::from(i64::to_be_bytes(us).to_vec()))], vec![], );