rdettai commented on issue #1160:
URL: 
https://github.com/apache/arrow-datafusion/issues/1160#issuecomment-952958330


   Great thanks! This is very clear now. So if I understand correctly, this 
problem has two solutions:
   - walk the tree once, and at each node apply either expression folding or 
constant evaluation
   - walk the tree multiple times, alternating between expression folding and 
constant evaluation
   
   The solution 1 (similar to what @pjmore proposed in #1128) would likely be 
more expensive in terms of space because more state needs no be tracked in the 
subtrees, and more critically would result in a much more complex algorithm. So 
we have opted for solution 2, which will be easier to implement and test, and 
the time overhead of walking the tree multiple times will likely be negligible 
as expression trees are usually rather small (and will grow even smaller at 
each iteration).


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