2010YOUY01 commented on PR #22906:
URL: https://github.com/apache/datafusion/pull/22906#issuecomment-4696816626

   This PR looks like a very nice solution for the cast pattern. I'm 
comfortable proceeding with it, but please forgive me for briefly advocating an 
alternative approach (that I'm to happy to help reviewing or implementing):
   
   I believe the fundamental goal here is to enable pruning through nested 
expressions, and the propagation based approach could be a better long term 
solution.
   
   - https://github.com/apache/datafusion/issues/19487
   
   My concern with the preimage approach is that it requires introducing and 
maintaining an ever-growing set of reverse-transformation rules. Even with 
additional rules, there will likely still be cases that cannot be handled. If 
this becomes a supported pattern, I worry that the long-term maintenance burden 
could be significant.
   
   In contrast, the propagation approach seems both more general and easier to 
reason about. The key intuition is that it follows a forward-evaluation model, 
similar to normal expression evaluation, whereas the preimage approach attempts 
to reverse complex expressions back into a simpler form. In many cases, the 
latter is inherently more difficult and may require expression-specific logic.
   
   


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