Skip to content

Commit

Permalink
fix cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Nov 29, 2024
1 parent 426c6d3 commit 038047c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datafusion/sql/src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)?;
Expand Down

0 comments on commit 038047c

Please sign in to comment.