mhilton commented on issue #8899:
URL:
https://github.com/apache/arrow-datafusion/issues/8899#issuecomment-1900642058
> Is it the wrong hour? If I input a timestamp of `2024-10-27 02:30:00
Europe/Berlin`
That is not the only way you could end up with such a timestamp though. The
more likely thing is to have a stream of input from a machine produced in UTC.
If one wants to display the output in a local timezone then one could use a
query like:
```
SELECT date_trunc('hour', arrow_cast(time, 'Timestamp(Nanosecond,
Some("UTC"))')) AS hour, COUNT(*) FROM events GROUP BY hour
```
Which would produce results like, if the earliest is always chosen for the
ambiguous cases:
```
hour count(*)
2024-10-27 00:00:00 +0200 10
2024-10-27 01:00:00 +0200 10
2024-10-27 02:00:00 +0200 20
2024-10-27 02:00:00 +0100 0
2024-10-27 03:00:00 +0100 10
2024-10-27 04:00:00 +0100 10
```
Incidentally arrow doesn't like that time string so you can't input it
anyway `Parser error: Error parsing timestamp from '2024-10-27 02:30:00
Europe/Berlin': error computing timezone offset`.
--
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]