Skip to content

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
// 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 👍

/// 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