alamb commented on code in PR #25112:
URL: https://github.com/apache/datafusion/pull/25112#discussion_r4076140928


##########
datafusion/session/src/catalog.rs:
##########
@@ -206,6 +216,17 @@ pub trait CatalogProviderList: Any + Debug + Sync + Send {
         catalog: Arc<dyn CatalogProvider>,
     ) -> Option<Arc<dyn CatalogProvider>>;
 
+    /// Removes a catalog from this list, returning it if it existed.
+    ///
+    /// Implementations of this method should return `Ok(None)` if no catalog
+    /// with `name` exists.
+    ///
+    /// By default returns a "Not Implemented" error
+    fn deregister_catalog(&self, name: &str) -> Result<Option<Arc<dyn 
CatalogProvider>>> {

Review Comment:
   > Conversely cascade: false implicitly means restrict, but then I have no 
way to disconnect from the catalog unless it's empty.
   
   I am not sure we need to implement any cascade semantics but I was triyng to 
design the API in such a way that we don't have to make a breaking change in 
the future 
   
   For example if someone wanted to create catalogs into which you could create 
tables they may want to have `CASCADE`
   
   ```sql
   create catalog foo;
   create schema foo.bar;
   create table foo.bar.baz;
   drop catalog foo; -- would fail because the catalog has a table
   drop catalog foo cascade; // would recursively drop all schema / tables
   ```
   
   So I was thinking if the API passed the flag through we could support this 
usecase



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to