You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/02/13 16:30:08 UTC
[GitHub] [arrow] abreis commented on a change in pull request #9487: ARROW-11620: [Rust][DataFusion] Consistently use Arc rather than Box and Arc
abreis commented on a change in pull request #9487:
URL: https://github.com/apache/arrow/pull/9487#discussion_r575685201
##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -278,25 +278,23 @@ impl ExecutionContext {
pub fn register_table(
&mut self,
name: &str,
- provider: Box<dyn TableProvider + Send + Sync>,
+ provider: Arc<dyn TableProvider + Send + Sync>,
) {
self.state
.lock()
.unwrap()
.datasources
- .insert(name.to_string(), provider.into());
Review comment:
Perhaps this could be a good time to also make this method return an `Option<Arc<..>>` so users can tell when they register a table over an existing table (consistent with `deregister_table`).
----------------------------------------------------------------
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:
users@infra.apache.org