Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into issue_14909
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuqi-lucas committed Mar 5, 2025
2 parents e4bff75 + 3dc212c commit 7ec3bb0
Show file tree
Hide file tree
Showing 5 changed files with 677 additions and 590 deletions.
19 changes: 19 additions & 0 deletions datafusion/core/src/execution/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,9 @@ impl SessionStateBuilder {
///
/// See [`Self::with_default_features`] to install the default set of functions,
/// catalogs, etc.
///
/// To create a `SessionStateBuilder` with default features such as functions,
/// please see [`Self::new_with_default_features`].
pub fn new() -> Self {
Self {
session_id: None,
Expand Down Expand Up @@ -1144,6 +1147,22 @@ impl SessionStateBuilder {
self
}

/// Returns a new [`SessionStateBuilder`] with default features.
///
/// This is equivalent to calling [`Self::new()`] followed by [`Self::with_default_features()`].
///
/// ```
/// use datafusion::execution::session_state::SessionStateBuilder;
///
/// // Create a new SessionState with default features
/// let session_state = SessionStateBuilder::new_with_default_features()
/// .with_session_id("my_session".to_string())
/// .build();
/// ```
pub fn new_with_default_features() -> Self {
Self::new().with_default_features()
}

/// Set the session id.
pub fn with_session_id(mut self, session_id: String) -> Self {
self.session_id = Some(session_id);
Expand Down
Loading

0 comments on commit 7ec3bb0

Please sign in to comment.