diff --git a/Cargo.lock b/Cargo.lock index b2a7b3e1035..2abfa9b7c37 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -653,7 +653,7 @@ dependencies = [ [[package]] name = "arrow-pg" version = "0.15.0" -source = "git+https://github.com/GreptimeTeam/datafusion-postgres.git?rev=3c77e6c32b8db80635a0d2f4b318a36b31170bc3#3c77e6c32b8db80635a0d2f4b318a36b31170bc3" +source = "git+https://github.com/datafusion-contrib/datafusion-postgres.git?rev=ffb14a52b3d7c7489559812e1ec38096f225ce93#ffb14a52b3d7c7489559812e1ec38096f225ce93" dependencies = [ "arrow 59.2.0", "arrow-schema 59.2.0", @@ -4280,7 +4280,7 @@ dependencies = [ [[package]] name = "datafusion-pg-catalog" version = "0.18.3" -source = "git+https://github.com/GreptimeTeam/datafusion-postgres.git?rev=3c77e6c32b8db80635a0d2f4b318a36b31170bc3#3c77e6c32b8db80635a0d2f4b318a36b31170bc3" +source = "git+https://github.com/datafusion-contrib/datafusion-postgres.git?rev=ffb14a52b3d7c7489559812e1ec38096f225ce93#ffb14a52b3d7c7489559812e1ec38096f225ce93" dependencies = [ "arrow-pg", "async-trait", @@ -10698,9 +10698,9 @@ dependencies = [ [[package]] name = "pg_interval" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c386dd54fce258fc04e668126ae68589a0d92e03a90ea67881d1300f70fd6170" +checksum = "8408fb1e08ebf2e7676d001caa6482d1b33e7e1f1dad9d3a758a05640eea2026" dependencies = [ "bytes", "chrono", @@ -10709,9 +10709,9 @@ dependencies = [ [[package]] name = "pgwire" -version = "0.40.7" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8265901ede50d0879fe401c6fe282e7e4ff83ae10a48c1f8e4f89b92f7d5f604" +checksum = "c667f8f4046889d52ed11e17aae954b1816d3df48dd23bdebcf199cef332df93" dependencies = [ "async-trait", "aws-lc-rs", diff --git a/Cargo.toml b/Cargo.toml index f1b5577d391..54fddcce397 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -376,8 +376,8 @@ datafusion-physical-plan = { git = "https://github.com/GreptimeTeam/datafusion.g datafusion-proto = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "b66dca3260c8e04f314c8036cdfbb08f1a564d95" } datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "b66dca3260c8e04f314c8036cdfbb08f1a564d95" } datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "b66dca3260c8e04f314c8036cdfbb08f1a564d95" } -datafusion-pg-catalog = { git = "https://github.com/GreptimeTeam/datafusion-postgres.git", rev = "3c77e6c32b8db80635a0d2f4b318a36b31170bc3" } -arrow-pg = { git = "https://github.com/GreptimeTeam/datafusion-postgres.git", rev = "3c77e6c32b8db80635a0d2f4b318a36b31170bc3" } +datafusion-pg-catalog = { git = "https://github.com/datafusion-contrib/datafusion-postgres.git", rev = "ffb14a52b3d7c7489559812e1ec38096f225ce93" } +arrow-pg = { git = "https://github.com/datafusion-contrib/datafusion-postgres.git", rev = "ffb14a52b3d7c7489559812e1ec38096f225ce93" } sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "9e9019bb1c7040ed956f654e39378dd42ab17884" } # Temporary: use the GreptimeTeam fork of tikv-jemalloc-sys embedding diff --git a/src/servers/Cargo.toml b/src/servers/Cargo.toml index 3baba2d6634..5fa10313e04 100644 --- a/src/servers/Cargo.toml +++ b/src/servers/Cargo.toml @@ -95,8 +95,8 @@ operator.workspace = true otel-arrow-rust.workspace = true parking_lot.workspace = true partition.workspace = true -pg_interval = "0.5" -pgwire = { version = "0.40", default-features = false, features = [ +pg_interval = "0.6" +pgwire = { version = "0.41", default-features = false, features = [ "server-api-aws-lc-rs", "pg-ext-types", ] } diff --git a/src/servers/src/postgres/handler.rs b/src/servers/src/postgres/handler.rs index aca4362bd34..204fa7745a5 100644 --- a/src/servers/src/postgres/handler.rs +++ b/src/servers/src/postgres/handler.rs @@ -317,23 +317,20 @@ impl QueryParser for DefaultQueryParser { _client: &C, sql: &str, _types: &[Option], - ) -> PgWireResult { + ) -> PgWireResult> { crate::metrics::METRIC_POSTGRES_PREPARED_COUNT.inc(); let query_ctx = self.session.new_query_context(); // do not parse if query is empty or matches rules if sql.is_empty() { - return Ok(PgSqlPlan { - plan: SqlPlan::Empty, - copy_to_stdout_format: None, - }); + return Ok(None); } if fixtures::matches(sql) { - return Ok(PgSqlPlan { + return Ok(Some(PgSqlPlan { plan: SqlPlan::Shortcut(sql.to_string()), copy_to_stdout_format: None, - }); + })); } let parsed_statements = self.compatibility_parser.parse(sql); @@ -367,15 +364,15 @@ impl QueryParser for DefaultQueryParser { .map_err(convert_err)? .map(|DescribeResult { logical_plan }| logical_plan) { - Ok(PgSqlPlan { + Ok(Some(PgSqlPlan { plan: SqlPlan::Plan(logical_plan, stmt), copy_to_stdout_format, - }) + })) } else { - Ok(PgSqlPlan { + Ok(Some(PgSqlPlan { plan: SqlPlan::Statement(stmt, sql), copy_to_stdout_format, - }) + })) } } }