Abdullahsab3 opened a new issue, #10308:
URL: https://github.com/apache/datafusion/issues/10308
### Describe the bug
When using the `date_bin` function, while providing a time zone to the
column used in `date_bin` , and using a range that contains daylight savings
(i.e. part of the range would be for example with an offset of `+01:00`, and
another part with an offset of `+02:00`), the querying fails with the following
error:
```
rpc error: code = InvalidArgument desc = External error: Arrow error: Cast
error: Cannot cast timezone to different timezone
```
The query that I used is:
```
select
date_bin(interval '1 hour', time at time zone 'Europe/Brussels')
from
raw_data
where
time >= '2021-03-27T22:00:00.000Z'
and
time <= '2021-03-29T00:00:00.000Z'
group by date_bin(interval '1 hour', time at time zone 'Europe/Brussels')
```
Notice that the interval used `[2021-03-27T22:00:00.000Z,
2021-03-29T00:00:00.000Z]` contains daylight savings within the range, meaning
that in this case part of the range will be with an offset of `+01:00` (before
the daylight savings), and another part will be with an offset of `+02:00`
(after the daylight savings)
I suspect the issue is that Arrow is attempting to case the times with a 2
hours offset to the times of an 1 hour offset
### To Reproduce
Execute the following query
```
select
date_bin(interval '1 hour', time at time zone 'Europe/Brussels')
from
raw_data
where
time >= '2021-03-27T22:00:00.000Z'
and
time <= '2021-03-29T00:00:00.000Z'
group by date_bin(interval '1 hour', time at time zone 'Europe/Brussels')
```
### Expected behavior
I should get the data aggregated by time. Part of the interval will be with
a 2 hours offset, another part will be with a 1 hour offset
### Additional context
_No response_
--
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]