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
11 changes: 10 additions & 1 deletion datafusion/execution/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use std::{
sync::Arc,
};

use datafusion_common::{config::ConfigOptions, Result, ScalarValue};
use datafusion_common::{
config::{ConfigExtension, ConfigOptions},
Result, ScalarValue,
};

/// Configuration options for [`SessionContext`].
///
Expand Down Expand Up @@ -198,6 +201,12 @@ impl SessionConfig {
self
}

/// Insert new [ConfigExtension]
pub fn with_option_extension<T: ConfigExtension>(mut self, extension: T) -> Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have discussed with_extension_options as the method name, but it make more sense to me to name it like this, not to be confused with with_extension

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree this is a reasonable name, even though it still a bit awkward

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm horrible with naming things 😀 open to suggestions

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, if I had a better alternative I would give it.

self.options_mut().extensions.insert(extension);
self
}

/// Get [`target_partitions`]
///
/// [`target_partitions`]: datafusion_common::config::ExecutionOptions::target_partitions
Expand Down