Skip to content

Commit

Permalink
implement default for execution config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayu Liu committed Jun 16, 2021
1 parent 51e5445 commit 9dee39b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions datafusion/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 9dee39b

Please sign in to comment.