This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 29fda881ae Minor: Clarify `SessionContext::state` docs (#10847)
29fda881ae is described below

commit 29fda881aefdf3a235be586ae529e4c8d2c44ba0
Author: Andrew Lamb <[email protected]>
AuthorDate: Mon Jun 10 11:30:32 2024 -0400

    Minor: Clarify `SessionContext::state` docs (#10847)
    
    * Minor: Clarify `SessionContext::state` docs
    
    * Apply suggestions from code review
    
    Co-authored-by: Trent Hauck <[email protected]>
    
    ---------
    
    Co-authored-by: Trent Hauck <[email protected]>
---
 datafusion/core/src/execution/context/mod.rs | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/datafusion/core/src/execution/context/mod.rs 
b/datafusion/core/src/execution/context/mod.rs
index e247263964..6fa83d3d93 100644
--- a/datafusion/core/src/execution/context/mod.rs
+++ b/datafusion/core/src/execution/context/mod.rs
@@ -1249,8 +1249,18 @@ impl SessionContext {
         Arc::new(TaskContext::from(self))
     }
 
-    /// Snapshots the [`SessionState`] of this [`SessionContext`] setting the
-    /// `query_execution_start_time` to the current time
+    /// Return a new  [`SessionState`] suitable for executing a single query.
+    ///
+    /// Notes:
+    ///
+    /// 1. `query_execution_start_time` is set to the current time for the
+    /// returned state.
+    ///
+    /// 2. The returned state is not shared with the current session state
+    /// and this changes to the returned `SessionState` such as changing
+    /// [`ConfigOptions`] will not be reflected in this `SessionContext`.
+    ///
+    /// [`ConfigOptions`]: crate::config::ConfigOptions
     pub fn state(&self) -> SessionState {
         let mut state = self.state.read().clone();
         state.execution_props_mut().start_execution();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to