From 343acd39ff34ddd62c859f4e8b71d4b6b1213528 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Wed, 15 Jan 2025 11:35:08 +0300 Subject: [PATCH 1/3] Extend references with new SHowSchemas type --- datafusion/core/src/catalog_common/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/datafusion/core/src/catalog_common/mod.rs b/datafusion/core/src/catalog_common/mod.rs index 68c78dda4899..9827f259bd13 100644 --- a/datafusion/core/src/catalog_common/mod.rs +++ b/datafusion/core/src/catalog_common/mod.rs @@ -156,6 +156,8 @@ pub fn resolve_table_references( | Statement::ShowColumns { .. } | Statement::ShowTables { .. } | Statement::ShowCollation { .. } + | Statement::ShowSchemas { .. } + | Statement::ShowDatabases { .. } ); if requires_information_schema { for s in INFORMATION_SCHEMA_TABLES { From ced699941cd3c3967c2446df2b9c8c50aec33294 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Wed, 15 Jan 2025 11:41:22 +0300 Subject: [PATCH 2/3] Make resolve_table_ref as pub --- datafusion/core/src/execution/session_state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index c5874deb6ed5..f7e964210005 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -285,7 +285,7 @@ impl SessionState { .build() } - pub(crate) fn resolve_table_ref( + pub fn resolve_table_ref( &self, table_ref: impl Into, ) -> ResolvedTableReference { From 9ab7d5803f86ac40db95698b671a18e88c6e85f6 Mon Sep 17 00:00:00 2001 From: osipovartem Date: Wed, 15 Jan 2025 11:54:56 +0300 Subject: [PATCH 3/3] Fix docs linter --- datafusion/core/src/execution/session_state.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index f7e964210005..19d0fae207be 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -285,6 +285,8 @@ impl SessionState { .build() } + /// Resolves a [`TableReference`] to a [`ResolvedTableReference`] + /// using the default catalog and schema. pub fn resolve_table_ref( &self, table_ref: impl Into, @@ -845,9 +847,9 @@ impl SessionState { overwrite: bool, ) -> Result<(), DataFusionError> { let ext = file_format.get_ext().to_lowercase(); - match (self.file_formats.entry(ext.clone()), overwrite){ - (Entry::Vacant(e), _) => {e.insert(file_format);}, - (Entry::Occupied(mut e), true) => {e.insert(file_format);}, + match (self.file_formats.entry(ext.clone()), overwrite) { + (Entry::Vacant(e), _) => { e.insert(file_format); } + (Entry::Occupied(mut e), true) => { e.insert(file_format); } (Entry::Occupied(_), false) => return config_err!("File type already registered for extension {ext}. Set overwrite to true to replace this extension."), }; Ok(())