seddonm1 commented on a change in pull request #9448:
URL: https://github.com/apache/arrow/pull/9448#discussion_r573337566



##########
File path: rust/datafusion/src/datasource/memory.rs
##########
@@ -107,7 +107,7 @@ impl MemTable {
 
     /// Create a mem table by reading from another data source
     pub async fn load(
-        t: &dyn TableProvider,
+        t: Box<dyn TableProvider + Send + Sync>,

Review comment:
       Thanks @alamb .
   
   You make a good point and it is confusing to me why `Box` is used in some 
places and `Arc` in others (given the I thought ideal characteristics of 
`Arc`): e.g.
   
   ```rust
   /// Execution context for registering data sources and executing queries
   #[derive(Clone)]
   pub struct ExecutionContextState {
       /// Data sources that are registered with the context
       pub datasources: HashMap<String, Arc<dyn TableProvider + Send + Sync>>,
   ```
   
   vs
   
   ```rust
       pub fn register_table(
           &mut self,
           name: &str,
           provider: Box<dyn TableProvider + Send + Sync>,
   ```




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