alamb commented on PR #18648:
URL: https://github.com/apache/datafusion/pull/18648#issuecomment-4007542307
> just so we're clear, the first case can only capture when the right-hand
constant is aligned. I agree it's a clear win, but continuing with the
date_trunc('month', ...) example, it's applicable to 1 value for every 30
values, and that's not including time and timezone offsets.
I am not sure why it is not applicable to timezone offsets
In my mind writing
```sql
date_trunc(col, 'month') = 2025-12-01
```
is the natural way to write queries that look to bucket date by month (aka
to compare date trunc to a date/time with the granulatity of the truncation).
the expression
```sql
date_trunc(col, 'month') = 2025-12-03`. -- <-- A value that is not a natural
boundary
```
Doesn't make sense to me at all (as that will be FALSE for all values)
The expression
```sql
date_trunc(col, 'month') < 2025-12-03
```
Makes slightly more sense as it will actually pass some rows, but I still
would be surprised if this was a common epression as the constant doesn't align
to the truncation granularity
--
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]