alamb commented on a change in pull request #8097:
URL: https://github.com/apache/arrow/pull/8097#discussion_r483275351



##########
File path: rust/datafusion/src/execution/context.rs
##########
@@ -417,7 +445,16 @@ impl ExecutionConfig {
         mut self,
         physical_planner: Arc<dyn PhysicalPlanner>,
     ) -> Self {
-        self.physical_planner = Some(physical_planner);
+        self.physical_planner = physical_planner;
+        self
+    }
+
+    /// Optional source of additional optimization passes
+    pub fn with_optimizer_rule_source(

Review comment:
       @jorgecarleitao got it -- I will perhaps try with Clone later. There is  
a style of writing optimizers that actually does put state on the optimizer 
object itself -- another style, which I think you used for predicate pushdown, 
is to pass state as explicit arguments.
   
   The challenge with using function arguments is that I can't think of any way 
to write generic functions like `optimize_children` in that style: 
https://github.com/apache/arrow/pull/8097/files#diff-4a428d98d7a9b116e888c2abd108fbedR32-R43.
   
   I'll think about it this evening and maybe something will pop into my head




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to