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


##########
datafusion/execution/src/config.rs:
##########
@@ -152,7 +157,7 @@ impl SessionConfig {
     /// assert_eq!(config.options().execution.batch_size, 1024);
     /// ```
     pub fn options_mut(&mut self) -> &mut ConfigOptions {
-        &mut self.options
+        Arc::make_mut(&mut self.options)

Review Comment:
   This is the key function call -- it basically does "copy on write" and if 
there are existing references to the options a new copy is created.
   
   



##########
datafusion/execution/src/config.rs:
##########
@@ -91,16 +91,16 @@ use datafusion_common::{
 /// [`SessionContext::new_with_config`]: 
https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html#method.new_with_config
 #[derive(Clone, Debug)]
 pub struct SessionConfig {
-    /// Configuration options
-    options: ConfigOptions,
+    /// Configuration options, copy on write
+    options: Arc<ConfigOptions>,

Review Comment:
   The idea is to pass this pointer down into the ExecutionProps



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to