alamb commented on issue #18319:
URL: https://github.com/apache/datafusion/issues/18319#issuecomment-3797037133

   > Fundamentally, this is just expression simplification. The difference is 
that traditional expression-simplification routines aim to reduce computation 
cost, while in the “preimage” case the simplification is done to enable 
predicate pruning. Here, we can tolerate slightly slower evaluation if it makes 
pruning possible. (and this issue's simplification case both made compute fast, 
and pruning possible)
   
   I think it is a little more complicated than this -- specifically the API 
that was added is **not** a general purpose simplification for predicate 
evaluation -- it is pretty specific for functions that can bound input columns 
to a known range (the "preimage") 
   
   The reason for this is that the simplification looks like
   
   ```sql
   <constant> <op> <function_call>
   ```
   
   If kicks in if `function_call` can provide a range (preimage) over which it 
always evaluates to the `<constant>` and then the simplifier rewrites the 
expression in terms of new operations and that range
   
   


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