diff --git a/Cargo.lock b/Cargo.lock index 1f65f1289c..f54ef1b810 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9619,8 +9619,7 @@ dependencies = [ [[package]] name = "pgwire" version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d5e5a60d3f6e40c91f6a2a7f8d09665e636272bd5611977253559b6651aabb" +source = "git+https://github.com/sunng87/pgwire?rev=26ee9805c433bc56262c6075b8c12f9c9e132364#26ee9805c433bc56262c6075b8c12f9c9e132364" dependencies = [ "async-trait", "base64 0.22.1", diff --git a/Cargo.toml b/Cargo.toml index 5041f167c3..bd63f9d91f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -345,6 +345,7 @@ datafusion-datasource = { git = "https://github.com/GreptimeTeam/datafusion.git" datafusion-sql = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "02b82535e0160c4545667f36a03e1ff9d1d2e51f" } datafusion-substrait = { git = "https://github.com/GreptimeTeam/datafusion.git", rev = "02b82535e0160c4545667f36a03e1ff9d1d2e51f" } sqlparser = { git = "https://github.com/GreptimeTeam/sqlparser-rs.git", rev = "2aefa08a8d69c96eec2d6d6703598a009bba6e4c" } # on branch v0.61.x +pgwire = { git = "https://github.com/sunng87/pgwire", rev = "26ee9805c433bc56262c6075b8c12f9c9e132364" } [profile.release] debug = 1 diff --git a/src/query/src/datafusion.rs b/src/query/src/datafusion.rs index dc84c4afac..405ec05cbd 100644 --- a/src/query/src/datafusion.rs +++ b/src/query/src/datafusion.rs @@ -444,32 +444,17 @@ impl QueryEngine for DatafusionQueryEngine { async fn describe( &self, plan: LogicalPlan, - query_ctx: QueryContextRef, + _query_ctx: QueryContextRef, ) -> Result { - let ctx = self.engine_context(query_ctx); - if let Ok(optimised_plan) = self.optimize(&ctx, &plan) { - let schema = optimised_plan - .schema() - .clone() - .try_into() - .context(ConvertSchemaSnafu)?; - Ok(DescribeResult { - schema, - logical_plan: optimised_plan, - }) - } else { - // Table's like those in information_schema cannot be optimized when - // it contains parameters. So we fallback to original plans. - let schema = plan - .schema() - .clone() - .try_into() - .context(ConvertSchemaSnafu)?; - Ok(DescribeResult { - schema, - logical_plan: plan, - }) - } + let schema = plan + .schema() + .clone() + .try_into() + .context(ConvertSchemaSnafu)?; + Ok(DescribeResult { + schema, + logical_plan: plan, + }) } async fn execute(&self, plan: LogicalPlan, query_ctx: QueryContextRef) -> Result {