peter-toth commented on PR #8835:
URL: 
https://github.com/apache/arrow-datafusion/pull/8835#issuecomment-1892678190

   > Suppose in the future we will introduce an optimization rule mixed with 
multiple conditions. For example,
   > `if rule A is applied, then return new plan; else if rule B is applied, 
then return new plan; else return original plan`
   
   Currently we don't seem to propagate up the `Transformed` state neither do 
`TreeNode::transform()` or `TreeNode::rewrite()` return that state.
   But when we need to know that a `TreeNode::transform()` or 
`TreeNode::rewrite()` actually modified a tree (and decide next steps based on 
that) wouldn't be easier to pass in a closure that sets an outer "modified" 
flag when changes are made to any node than propagating up this `Transformed` 
state?


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

Reply via email to