alamb commented on code in PR #11087:
URL: https://github.com/apache/datafusion/pull/11087#discussion_r1650176954
##########
datafusion/core/src/execution/session_state.rs:
##########
@@ -402,6 +402,16 @@ impl SessionState {
self
}
+ // the add_optimizer_rule takes an owned reference
Review Comment:
I noticed the naming in SessionState is pretty inconsistent
##########
datafusion/core/src/execution/context/mod.rs:
##########
@@ -332,13 +332,21 @@ impl SessionContext {
self
}
- /// Adds an analyzer rule to the `SessionState` in the current
`SessionContext`.
- pub fn add_analyzer_rule(
- self,
- analyzer_rule: Arc<dyn AnalyzerRule + Send + Sync>,
- ) -> Self {
+ /// Adds an optimizer rule to the end of the existing rules.
+ ///
+ /// See [`SessionState`] for more control of when the rule is applied.
+ pub fn add_optimizer_rule(
+ &self,
+ optimizer_rule: Arc<dyn OptimizerRule + Send + Sync>,
+ ) {
+ self.state.write().append_optimizer_rule(optimizer_rule);
+ }
+
+ /// Adds an analyzer rule to the end of the existing rules.
+ ///
+ /// See [`SessionState`] for more control of when the rule is applied.
+ pub fn add_analyzer_rule(&self, analyzer_rule: Arc<dyn AnalyzerRule + Send
+ Sync>) {
Review Comment:
This API was added in #10849 by @pingsutw and not yet released, thus it is
not an API change
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]