mingmwang commented on a change in pull request #1987:
URL: https://github.com/apache/arrow-datafusion/pull/1987#discussion_r825584839



##########
File path: datafusion/src/execution/context.rs
##########
@@ -132,32 +134,34 @@ use super::{
 /// # use datafusion::error::Result;
 /// # #[tokio::main]
 /// # async fn main() -> Result<()> {
-/// let mut ctx = ExecutionContext::new();
+/// let mut ctx = SessionContext::new();
 /// ctx.register_csv("example", "tests/example.csv", 
CsvReadOptions::new()).await?;
 /// let results = ctx.sql("SELECT a, MIN(b) FROM example GROUP BY a LIMIT 
100").await?;
 /// # Ok(())
 /// # }
 /// ```
 #[derive(Clone)]
-pub struct ExecutionContext {
+pub struct SessionContext {
+    /// Uuid for the session
+    pub session_id: String,
     /// Internal state for the context
-    pub state: Arc<Mutex<ExecutionContextState>>,
+    pub state: Arc<Mutex<SessionState>>,

Review comment:
       > it looks like there is an invariant between session_id and 
state.session_id, if so, it's better to keep `session_id` private so it is 
always in sync with the id in state. we can add a `session_id` method to make 
the id reader to users.
   
   Done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to