alamb commented on code in PR #2771:
URL: https://github.com/apache/arrow-datafusion/pull/2771#discussion_r906288677
##########
datafusion/core/src/config.rs:
##########
@@ -139,6 +167,11 @@ impl ConfigOptions {
self.set(key, ScalarValue::Boolean(Some(value)))
}
+ /// set a boolean configuration option
Review Comment:
```suggestion
/// set a `u64` configuration option
```
##########
datafusion/core/src/execution/context.rs:
##########
@@ -1118,10 +1115,27 @@ impl SessionConfig {
self
}
- /// Convert configuration to name-value pairs
+ /// Get the currently configured batch size
+ pub fn batch_size(&self) -> usize {
+ self.config_options
+ .get_u64(OPT_BATCH_SIZE)
+ .try_into()
+ .unwrap()
+ }
+
+ /// Get the current configuration options
+ pub fn config_options(&self) -> &ConfigOptions {
+ &self.config_options
+ }
+
+ /// Convert configuration options to name-value pairs with values
converted to strings. Note
+ /// that this method will eventually be deprecated and replaced by
[config_options].
pub fn to_props(&self) -> HashMap<String, String> {
let mut map = HashMap::new();
- map.insert(BATCH_SIZE.to_owned(), format!("{}", self.batch_size));
+ // copy configs from config_options
Review Comment:
❤️
--
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]