discord9 commented on PR #22906:
URL: https://github.com/apache/datafusion/pull/22906#issuecomment-4705159375

   Follow-up note on the optimizer snapshot change: the new cast-preimage 
rewrite models timestamp precision narrowing as a half-open source-domain 
bucket. For example, `CAST(ts_ns AS TIMESTAMP(3)) > 1000ms` is not equivalent 
to `ts_ns > 1_000_000_000ns`; because the cast truncates nanoseconds to 
milliseconds, the first source value that casts above `1000ms` is 
`1_001_000_000ns`, so the preimage is `ts_ns >= 1_001_000_000ns`.
   
   That is why the integration snapshot changes from a same-operator unwrap to 
the stricter `>= 1001000000` bound. The original cast predicate is still 
retained where needed as an inexact/partial filter, while the added 
source-domain predicate is a safe preimage that enables better pruning/pushdown.
   
   I also pushed a small follow-up commit adding a timezone-handling comment 
for timestamp preimages and direct physical-expression tests for `IS DISTINCT 
FROM` / `IS NOT DISTINCT FROM` range preimage rewrites.


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