mrob95 commented on code in PR #2812:
URL: https://github.com/apache/arrow-datafusion/pull/2812#discussion_r911083161
##########
datafusion/core/src/config.rs:
##########
@@ -179,7 +189,18 @@ impl ConfigOptions {
let mut options = HashMap::new();
let built_in = BuiltInConfigs::new();
for config_def in &built_in.config_definitions {
- options.insert(config_def.key.clone(),
config_def.default_value.clone());
+ let config_value = {
+ let mut env_key = config_def.key.replace('.', "_");
+ env_key.make_ascii_uppercase();
+ match env::var(env_key) {
+ Ok(value) => match scalar_from_string(value,
&config_def.data_type) {
+ Ok(value) => value,
+ Err(_) => config_def.default_value.clone(),
Review Comment:
Added a warning here
##########
datafusion/core/src/config.rs:
##########
@@ -260,4 +281,24 @@ mod test {
assert!(config.get(invalid_key).is_none());
assert!(!config.get_bool(invalid_key));
}
+
+ #[test]
+ fn get_from_env() {
Review Comment:
Done
--
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]