Convert the current `SessionContext` into a [`SessionStateBuilder`] This is useful to switch back to `SessionState` with custom settings such as [`Self::enable_url_table`]. Avoids cloning the SessionState if possible. # Example ``` # use std::sync::Arc; # use datafusion::prelude::*; # use datafusion::execution::SessionStateBuilder; # use datafusion_optimizer::push_down_filter::PushDownFilter; l
(self)
| 454 | /// let builder = context.enable_url_table().into_state_builder(); |
| 455 | /// ``` |
| 456 | pub fn into_state_builder(self) -> SessionStateBuilder { |
| 457 | let SessionContext { |
| 458 | session_id: _, |
| 459 | session_start_time: _, |
| 460 | state, |
| 461 | } = self; |
| 462 | let state = match Arc::try_unwrap(state) { |
| 463 | Ok(rwlock) => rwlock.into_inner(), |
| 464 | Err(state) => state.read().clone(), |
| 465 | }; |
| 466 | SessionStateBuilder::from(state) |
| 467 | } |
| 468 | |
| 469 | /// Returns the time this `SessionContext` was created |
| 470 | pub fn session_start_time(&self) -> DateTime<Utc> { |
no test coverage detected