xiedeyantu commented on PR #4577:
URL: https://github.com/apache/calcite/pull/4577#issuecomment-3402446103

   > I have changed my mind, I don't think this is an ideal design for two 
reasons:
   > 
   > * it is not sustainable to add flags to all functions for every property 
that may be interesting
   > * simplify is not the right place for all optimizations; this optimization 
in particular should be done only once, while simplify runs frequently.
   >   I think the right way to solve this is through a visitor pattern; the 
visitor will know which functions are idempotent.
   
   I don't entirely agree with your perspective. On the contrary, I believe 
adding possible function properties to `SqlOperator` is very appropriate. 
Moreover, if the refactoring is done well, adding future properties will be 
straightforward. Although `simplify` may be called frequently, the actual 
processing might only occur once. However, this optimization point is indeed 
very niche. If it's deemed unnecessary to implement, I think we could also 
close this JIRA.


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