alamb commented on code in PR #20337:
URL: https://github.com/apache/datafusion/pull/20337#discussion_r2805278824


##########
datafusion/physical-plan/src/execution_plan.rs:
##########
@@ -204,6 +204,17 @@ pub trait ExecutionPlan: Debug + DisplayAs + Send + Sync {
     /// joins).
     fn children(&self) -> Vec<&Arc<dyn ExecutionPlan>>;
 
+    /// Returns all expressions (non-recursively) evaluated by the current

Review Comment:
   This API forces an allocation and also cloning all the PhysicalExprs -- what 
would you think about adding apply_expressions and map_expressions methods to 
parallel the ones on LogicalPlan instead?
   
   
   
   * 
https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.LogicalPlan.html#method.apply_expressions
   * 
https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.LogicalPlan.html#method.map_expressions
   
   Maybe you can start with just the `apply_expressions` one in this PR
   
   I think we should probably also not provide a default implementation to 
force all implementations to properly visit the expressions
   
   If we provide this default implementation, then downstream implementors will 
likely not implement the API and if something in the datafusion core depends on 
the API in the future it will be hard to debug what is going on



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

Reply via email to