drin commented on PR #20059:
URL: https://github.com/apache/datafusion/pull/20059#issuecomment-4034120420
@alamb it was a misunderstanding on my part. I thought that preimage would
transform any expression of the form `fn(x) <op> <constant>` by transforming
the `constant` using a range of equivalent inputs ("the interval") for
comparison. For example, if `N` is `2`, then its equivalent interval for
`floor(x)` would be `[2, 3)`. Then, `floor(x) <op> 2` could be rewritten as `x`
and some comparison with `[2, 3)`. Similarly for `floor(x) <op> 2.8`.
However, for `floor(x)`, the actual preimage implementation only considers
the lower bound. For the same example, where `N` is some constant in the range
`[2, 3)`, only `2` is considered for the rewrite, thus: `x < 2`, or `x <= 2`,
or `x >= 2 and x < 3`.
Based on the discussion in #18648 , the current implementation works as
expected and if the constant is some value in the range `(2, 3)` it will remain
in the expression to be evaluated in the usual way. For example, `floor(x) =
2.8` does not get simplified to `false`, it remains in the predicate to be
evaluated as usual.
My comments here can be ignored and I will address them in a follow-up PR
that expands the preimage simplification.
--
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]