This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 0b955776d1 Make it easier to register configuration extension ... 
(#9781)
0b955776d1 is described below

commit 0b955776d172b4eb304097d8bab0bd82c3d20915
Author: Marko Milenković <[email protected]>
AuthorDate: Mon Mar 25 14:50:22 2024 +0000

    Make it easier to register configuration extension ... (#9781)
    
    ... options
    
    closes #9529
---
 datafusion/execution/src/config.rs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/datafusion/execution/src/config.rs 
b/datafusion/execution/src/config.rs
index 360bac71c5..0a7a87c7d8 100644
--- a/datafusion/execution/src/config.rs
+++ b/datafusion/execution/src/config.rs
@@ -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`].
 ///
@@ -198,6 +201,12 @@ impl SessionConfig {
         self
     }
 
+    /// Insert new [ConfigExtension]
+    pub fn with_option_extension<T: ConfigExtension>(mut self, extension: T) 
-> Self {
+        self.options_mut().extensions.insert(extension);
+        self
+    }
+
     /// Get [`target_partitions`]
     ///
     /// [`target_partitions`]: 
datafusion_common::config::ExecutionOptions::target_partitions

Reply via email to