From 038047c087d378620867845ad4a710348f4cf594 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 29 Nov 2024 07:07:52 -0500 Subject: [PATCH] fix cargo --- datafusion/sql/src/statement.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/datafusion/sql/src/statement.rs b/datafusion/sql/src/statement.rs index 20de8627f5dee..56ec00bda472c 100644 --- a/datafusion/sql/src/statement.rs +++ b/datafusion/sql/src/statement.rs @@ -754,7 +754,9 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { return not_impl_err!("SHOW COLUMNS LIMIT FROM not supported")?; } if filter_position.is_some() { - return not_impl_err!("SHOW COLUMNS with WHERE or LIKE is not supported")?; + return not_impl_err!( + "SHOW COLUMNS with WHERE or LIKE is not supported" + )?; } let Some(ShowStatementIn { // specifies if the syntax was `SHOW COLUMNS IN` or `SHOW @@ -1919,6 +1921,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { self.options.enable_ident_normalization, ); + if !self.has_table("information_schema", "columns") { + return plan_err!( + "SHOW COLUMNS is not supported unless information_schema is enabled" + ); + } + // Do a table lookup to verify the table exists let table_ref = self.object_name_to_table_reference(sql_table_name)?; let _ = self.context_provider.get_table_source(table_ref)?;