Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions datafusion/core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ use datafusion_common::ScalarValue;
use itertools::Itertools;
use log::warn;
use parking_lot::RwLock;
use std::collections::HashMap;
use std::collections::{BTreeMap, HashMap};
use std::env;
use std::fmt::{Debug, Formatter};
use std::sync::Arc;

/// Configuration option "datafusion.optimizer.filter_null_join_keys"
Expand Down Expand Up @@ -274,11 +275,23 @@ impl BuiltInConfigs {
}

/// Configuration options struct. This can contain values for built-in and custom options
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct ConfigOptions {
options: HashMap<String, ScalarValue>,
}

/// Print the configurations in an ordered way so that we can directly compare the equality of two ConfigOptions by their debug strings
impl Debug for ConfigOptions {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ConfigOptions")
.field(
"options",
&format!("{:?}", BTreeMap::from_iter(self.options.iter())),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

)
.finish()
}
}

impl Default for ConfigOptions {
fn default() -> Self {
Self::new()
Expand Down