You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/01 18:14:22 UTC

[GitHub] [arrow-datafusion] andygrove commented on a diff in pull request #2812: Allow setting of config options via environment variables

andygrove commented on code in PR #2812:
URL: https://github.com/apache/arrow-datafusion/pull/2812#discussion_r912165234


##########
datafusion/core/src/execution/context.rs:
##########
@@ -1041,6 +1041,22 @@ impl SessionConfig {
         Default::default()
     }
 
+    /// Create an execution config with config options read from the environment
+    pub fn from_env() -> Self {
+        Self {
+            target_partitions: num_cpus::get(),
+            default_catalog: DEFAULT_CATALOG.to_owned(),
+            default_schema: DEFAULT_SCHEMA.to_owned(),
+            create_default_catalog_and_schema: true,
+            information_schema: false,
+            repartition_joins: true,
+            repartition_aggregations: true,
+            repartition_windows: true,
+            parquet_pruning: true,
+            config_options: ConfigOptions::from_env(),
+        }

Review Comment:
   Rather than copy and paste code from the `default` method here, perhaps it would be better to do something like this?
   
   ```suggestion
           let mut config = Self::default();
           config.config_options = ConfigOptions::from_env();
           config
   ```



-- 
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-unsubscribe@arrow.apache.org

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