From 9dee39b2b43e4f62f783d932ead4c5751ff20aaf Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Wed, 16 Jun 2021 21:58:24 +0800 Subject: [PATCH] implement default for execution config --- datafusion/src/execution/context.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/datafusion/src/execution/context.rs b/datafusion/src/execution/context.rs index 183524497940..c1a40ba10552 100644 --- a/datafusion/src/execution/context.rs +++ b/datafusion/src/execution/context.rs @@ -642,9 +642,8 @@ pub struct ExecutionConfig { pub repartition_aggregations: bool, } -impl ExecutionConfig { - /// Create an execution config with default setting - pub fn new() -> Self { +impl Default for ExecutionConfig { + fn default() -> Self { Self { concurrency: num_cpus::get(), batch_size: 8192, @@ -671,6 +670,13 @@ impl ExecutionConfig { repartition_aggregations: true, } } +} + +impl ExecutionConfig { + /// Create an execution config with default setting + pub fn new() -> Self { + Default::default() + } /// Customize max_concurrency pub fn with_concurrency(mut self, n: usize) -> Self {