Add SessionStateBuilder::with_object_store method#12578
Conversation
| url: &Url, | ||
| object_store: Arc<dyn ObjectStore>, | ||
| ) -> Self { | ||
| if self.runtime_env.is_none() { |
There was a problem hiding this comment.
There was a problem hiding this 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 PR adds the the method `SessionStateBuilder::with_object_store`, which registers an object store with a specified URL to the RuntimeEnv.
3562b8d to
f676722
Compare
alamb
left a comment
There was a problem hiding this comment.
Thank you (again) @OussamaSaoudi -- this looks great.
I think your comments about with_runtime_env make lots of sense
| url: &Url, | ||
| object_store: Arc<dyn ObjectStore>, | ||
| ) -> Self { | ||
| if self.runtime_env.is_none() { |
There was a problem hiding this 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
| /// 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. |
|
Thanks again @OussamaSaoudi |
This PR adds the the method `SessionStateBuilder::with_object_store`, which registers an object store with a specified URL to the RuntimeEnv.
Which issue does this PR close?
Closes #12553
Rationale for this change
This PR provides an API for adding
ObjectStores to aSessionStateBuilder'sRuntimeEnvby introducing the new method:SessionStateBuilder::with_object_store.What changes are included in this PR?
Are these changes tested?
I add a doctest to document and validate the new method.
Are there any user-facing changes?
None