Skip to content

chore: Update api docs for SessionContext, TaskContext, etc #6106

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

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Apr 24, 2023

Which issue does this PR close?

Related to #3058

Rationale for this change

I am trying to make the API docs published to crates.io more useful and stand on their own

What changes are included in this PR?

  1. Improve the docs for SessionContext and consolidate some other docs from the execution module that were hard to discover

Are these changes tested?

Yes (with CI checks)

Are there any user-facing changes?

Hopefully better docs

@github-actions github-actions bot added core Core DataFusion crate physical-expr Changes to the physical-expr crates labels Apr 24, 2023
@@ -15,30 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//! This module contains the shared state available at different parts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was hard to find, so I moved the content on to the structs that were referenced

Copy link
Contributor

@r4ntix r4ntix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍

@@ -33,6 +33,15 @@ use url::Url;

#[derive(Clone)]
/// Execution runtime environment.
///
/// A [`RuntimeEnv`] can be created from a [`RuntimeConfig`] and
/// stores state to be shared across multiple sessions. In most
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably I'm wrong here, but not sure RuntimeEnv is shared between sessions.
The runtime will be shared between queries within single session.
But SessionContext::new() creates new session with new UUID and new runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point -- by default a SessionContext creates a new instance of RuntimeEnv -- however that means any limits are not enforced across queries. I think this comment was trying to say if you want limits enforced across multiple session contexts you need to use the same RuntimeEnv

I have tried to clarify this in 0bbf687

/// `RuntimeEnv`, and therefore will not enforce memory or disk
/// limits for queries run on different `SessionContext`s.
///
/// To enforce resource limits (e.g. to limit the total amount of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thanks

@alamb alamb merged commit a384809 into apache:main Apr 26, 2023
@alamb alamb added the documentation Improvements or additions to documentation label Apr 26, 2023
@alamb alamb deleted the alamb/session_context_docs branch April 26, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate documentation Improvements or additions to documentation physical-expr Changes to the physical-expr crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants