Skip to content

Commit

Permalink
minor: reuse SessionStateBuilder methods for default builder (#12330)
Browse files Browse the repository at this point in the history
  • Loading branch information
comphead authored Sep 6, 2024
1 parent f638df3 commit 9d819e1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions datafusion/core/src/execution/session_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,17 +1035,15 @@ impl SessionStateBuilder {
}
}

/// Set defaults for table_factories, file formats, expr_planners and builtin
/// scalar and aggregate functions.
pub fn with_default_features(mut self) -> Self {
self.table_factories = Some(SessionStateDefaults::default_table_factories());
self.file_formats = Some(SessionStateDefaults::default_file_formats());
self.expr_planners = Some(SessionStateDefaults::default_expr_planners());
self.scalar_functions = Some(SessionStateDefaults::default_scalar_functions());
self.aggregate_functions =
Some(SessionStateDefaults::default_aggregate_functions());
self.window_functions = Some(SessionStateDefaults::default_window_functions());
self
/// Create default builder with defaults for table_factories, file formats, expr_planners and builtin
/// scalar, aggregate and windows functions.
pub fn with_default_features(self) -> Self {
self.with_table_factories(SessionStateDefaults::default_table_factories())
.with_file_formats(SessionStateDefaults::default_file_formats())
.with_expr_planners(SessionStateDefaults::default_expr_planners())
.with_scalar_functions(SessionStateDefaults::default_scalar_functions())
.with_aggregate_functions(SessionStateDefaults::default_aggregate_functions())
.with_window_functions(SessionStateDefaults::default_window_functions())
}

/// Set the session id.
Expand Down

0 comments on commit 9d819e1

Please sign in to comment.