-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add SessionStateBuilder::with_object_store method
#12578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
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