You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/19 08:24:04 UTC

[GitHub] [arrow-datafusion] crepererum commented on a diff in pull request #2940: add extension system to `SessionConfig`

crepererum commented on code in PR #2940:
URL: https://github.com/apache/arrow-datafusion/pull/2940#discussion_r924206887


##########
datafusion/core/src/execution/context.rs:
##########
@@ -1173,6 +1215,29 @@ impl SessionConfig {
         );
         map
     }
+
+    /// Add extensions.
+    pub fn with_extension<T>(mut self, ext: Arc<T>) -> Self
+    where
+        T: Send + Sync + 'static,
+    {
+        let ext = ext as Arc<dyn Any + Send + Sync + 'static>;
+        let id = TypeId::of::<T>();
+        self.extensions.insert(id, ext);
+        self
+    }
+
+    /// Get extension.

Review Comment:
   "..for specific **type**". The ID is invisible to the user. I've heavily extended the docs to make that clearer.



##########
datafusion/core/src/execution/context.rs:
##########
@@ -1173,6 +1215,29 @@ impl SessionConfig {
         );
         map
     }
+
+    /// Add extensions.

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org