waitingkuo commented on code in PR #3455:
URL: https://github.com/apache/arrow-datafusion/pull/3455#discussion_r968907557
##########
datafusion/core/src/execution/context.rs:
##########
@@ -1166,14 +1167,14 @@ impl SessionConfig {
/// Create an execution config with config options read from the
environment
pub fn from_env() -> Self {
Self {
- config_options: ConfigOptions::from_env(),
+ config_options: Arc::new(RwLock::new(ConfigOptions::from_env())),
..Default::default()
}
}
/// Set a configuration option
- pub fn set(mut self, key: &str, value: ScalarValue) -> Self {
- self.config_options.set(key, value);
+ pub fn set(self, key: &str, value: ScalarValue) -> Self {
+ self.config_options.write().set(key, value);
self
Review Comment:
`config_options.write()` to unlock the write lock and set the value
##########
datafusion/core/src/execution/context.rs:
##########
@@ -1252,22 +1253,18 @@ impl SessionConfig {
/// Get the currently configured batch size
pub fn batch_size(&self) -> usize {
self.config_options
+ .read()
.get_u64(OPT_BATCH_SIZE)
.try_into()
.unwrap()
}
Review Comment:
`config_options.read()` to unlock the read lock to get the value
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]