diff --git a/datafusion/core/src/execution/session_state.rs b/datafusion/core/src/execution/session_state.rs index 226e8085341e..ea7a65cc308f 100644 --- a/datafusion/core/src/execution/session_state.rs +++ b/datafusion/core/src/execution/session_state.rs @@ -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::*; diff --git a/datafusion/execution/src/task.rs b/datafusion/execution/src/task.rs index df7fd0dbd92c..21a644284c42 100644 --- a/datafusion/execution/src/task.rs +++ b/datafusion/execution/src/task.rs @@ -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)]