abreis commented on a change in pull request #9445:
URL: https://github.com/apache/arrow/pull/9445#discussion_r572276779



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -287,6 +287,21 @@ impl ExecutionContext {
             .insert(name.to_string(), provider.into());
     }
 
+    /// Deregisters the named table.
+    /// 
+    /// Returns true if the table was successfully de-reregistered.
+    pub fn deregister_table(
+        &mut self,
+        name: &str
+    ) -> bool {

Review comment:
       There is precedent in Rust's stdlib for returning a boolean here (e.g. 
[`HashSet::remove`](https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.remove)),
 or an `Option<>` if it makes sense to reuse the removed `TableProvider`.
   
   (also, unless the function is `#[must_use]`, you don't have to `let _ = ..` 
to ignore a boolean return)
   
   I guess the question is whether accidentally failing to deregister a table 
can trigger an issue later on. Perhaps not? The user would have to execute a 
query against a table they thought had been deregistered. 
   
   I agree that `register_table` should probably return a `Some(TableProvider)` 
when it replaces an existing table, though.




----------------------------------------------------------------
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.

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


Reply via email to