Skip to content

Commit

Permalink
Minor: improve documentation on SessionState (#11642)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Jul 27, 2024
1 parent 3cfb99d commit a721be1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
19 changes: 16 additions & 3 deletions datafusion/core/src/execution/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,23 @@ use std::fmt::Debug;
use std::sync::Arc;
use uuid::Uuid;

/// Execution context for registering data sources and executing queries.
/// See [`SessionContext`] for a higher level API.
/// `SessionState` contains all the necessary state to plan and execute queries,
/// such as configuration, functions, and runtime environment. Please see the
/// documentation on [`SessionContext`] for more information.
///
/// Use the [`SessionStateBuilder`] to build a SessionState object.
///
/// # Example: `SessionState` from a [`SessionContext`]
///
/// ```
/// use datafusion::prelude::*;
/// let ctx = SessionContext::new();
/// let state = ctx.state();
/// ```
///
/// # Example: `SessionState` via [`SessionStateBuilder`]
///
/// You can also use [`SessionStateBuilder`] to build a `SessionState` object
/// directly:
///
/// ```
/// use datafusion::prelude::*;
Expand Down
6 changes: 3 additions & 3 deletions datafusion/execution/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ use datafusion_expr::{AggregateUDF, ScalarUDF, WindowUDF};

/// Task Execution Context
///
/// A [`TaskContext`] contains the state required during a single
/// query's execution. Please see [`SessionContext`] for a user level
/// multi-query API.
/// A [`TaskContext`] contains the state required during a single query's
/// execution. Please see the documentation on [`SessionContext`] for more
/// information.
///
/// [`SessionContext`]: https://docs.rs/datafusion/latest/datafusion/execution/context/struct.SessionContext.html
#[derive(Debug)]
Expand Down

0 comments on commit a721be1

Please sign in to comment.