alamb commented on code in PR #12578:
URL: https://github.com/apache/datafusion/pull/12578#discussion_r1770539646
##########
datafusion/core/src/execution/session_state.rs:
##########
@@ -1229,6 +1231,41 @@ impl SessionStateBuilder {
self
}
+ /// Register an `ObjectStore` to the [`RuntimeEnv`]. See
[`RuntimeEnv::register_object_store`]
+ /// for more details.
+ ///
+ /// Note that this creates a default [`RuntimeEnv`] if there isn't one
passed in already.
Review Comment:
👍
##########
datafusion/core/src/execution/session_state.rs:
##########
@@ -1229,6 +1231,41 @@ impl SessionStateBuilder {
self
}
+ /// Register an `ObjectStore` to the [`RuntimeEnv`]. See
[`RuntimeEnv::register_object_store`]
+ /// for more details.
+ ///
+ /// Note that this creates a default [`RuntimeEnv`] if there isn't one
passed in already.
+ ///
+ /// ```
+ /// # use datafusion::prelude::*;
+ /// # use datafusion::execution::session_state::SessionStateBuilder;
+ /// # use datafusion_execution::runtime_env::RuntimeEnv;
+ /// # use url::Url;
+ /// # use std::sync::Arc;
+ /// # let http_store = object_store::local::LocalFileSystem::new();
+ /// let url = Url::try_from("file://").unwrap();
+ /// let object_store = object_store::local::LocalFileSystem::new();
+ /// let state = SessionStateBuilder::new()
+ /// .with_config(SessionConfig::new())
+ /// .with_object_store(&url, Arc::new(object_store))
+ /// .with_default_features()
+ /// .build();
+ /// ```
+ pub fn with_object_store(
+ mut self,
+ url: &Url,
+ object_store: Arc<dyn ObjectStore>,
+ ) -> Self {
+ if self.runtime_env.is_none() {
Review Comment:
I see what you mean about the existing signature:
https://docs.rs/datafusion/latest/datafusion/execution/session_state/struct.SessionStateBuilder.html#method.runtime_env
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]