Skip to content

Commit

Permalink
Proposed API improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Dec 19, 2024
1 parent de2fbae commit f2d3029
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions datafusion/substrait/src/logical_plan/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,17 +477,23 @@ pub struct DefaultSubstraitConsumer {
}

impl DefaultSubstraitConsumer {
pub fn new(extensions: Arc<Extensions>, state: Arc<SessionState>) -> Self {
DefaultSubstraitConsumer { extensions, state }
/// Create a new DefaultSubstraitConsumer
pub fn new(state: Arc<SessionState>) -> Self {
DefaultSubstraitConsumer {
extensions: Arc::new(Extensions::default()),
state,
}
}

pub fn with_extensions(mut self, extensions: Arc<Extensions>) -> Self {
self.extensions = extensions;
self
}
}

impl Default for DefaultSubstraitConsumer {
fn default() -> Self {
DefaultSubstraitConsumer {
extensions: Arc::new(Extensions::default()),
state: Arc::new(SessionContext::default().state()),
}
DefaultSubstraitConsumer::new(Arc::new(SessionContext::default().state()))
}
}

Expand Down

0 comments on commit f2d3029

Please sign in to comment.