alamb commented on a change in pull request #7972:
URL: https://github.com/apache/arrow/pull/7972#discussion_r471438457



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -89,12 +91,18 @@ impl ExecutionConfig {
 }
 
 /// Execution context for registering data sources and executing queries
-pub struct ExecutionContext {
-    datasources: HashMap<String, Box<dyn TableProvider + Send + Sync>>,
-    scalar_functions: HashMap<String, Box<ScalarFunction>>,
+#[derive(Clone)]
+pub struct ExecutionContextState {
+    datasources: Rc<RefCell<HashMap<String, Box<dyn TableProvider + Send + 
Sync>>>>,

Review comment:
       I guess I was thinking that users would register new datasources 
before/during query planning time (when `ExecutionContextState` was owned by a 
single thread and therefore the entire `struct` would be mutable, not just a 
field. I probably misunderstand what is going on




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