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

   I don't mind if the API is named preimage, but it feels like a very broad 
term for a very specific optimization.
   
   This is the entirety of what the clickhouse paper has to say about 
`preimage`:
   > Second, some functions can compute the preimage of a given function 
result. This is used to replace comparisons of constants with function calls on 
the key columns by comparing the key column value with the preimage. For 
example, toYear(k) = 2024 can be replaced by k >= 2024-01-01 && k < 2025-01-01
   
   The optimization of `toYear(k) = 2024` to `k >= 2024-01-01 && k < 
2025-01-01` is literally that the year 2024 is an interval that ranges from 
`2024-01-01` (interval minimum value) to `2025-01-01` (interval maximum value). 
Which, to me is simply interval containment.
   
   That being said, if the preimage API can be easily extended to other 
functions then I think preimage is a great name. For example, if a function can 
register its inverse (its "preimage function"). I tried looking at the API just 
now and it can probably be expanded beyond interval arithmetic?


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