mhilton commented on issue #8899: URL: https://github.com/apache/arrow-datafusion/issues/8899#issuecomment-1916386822
> @mhilton could you possibly provide some example inputs / expected outputs for your proposal in [#8899 (comment)](https://github.com/apache/arrow-datafusion/issues/8899#issuecomment-1900642058)? This is what postgresql does for times around the DST switchover. ``` mhilton=# SET TIMEZONE='Europe/Berlin'; SET mhilton=# SELECT date_trunc('day', column1) AS day, date_trunc('hour', column1) AS hour, column1 as time FROM (VALUES (TIMESTAMPTZ '2024-10-26 23:30:10Z'), (TIMESTAMPTZ '2024-10-27 00:30:10Z'), (TIMESTAMPTZ '2024-10-27 01:30:10Z'), (TIMESTAMPTZ '2024-10-27 02:30:10Z')); day | hour | time ------------------------+------------------------+------------------------ 2024-10-27 00:00:00+02 | 2024-10-27 01:00:00+02 | 2024-10-27 01:30:10+02 2024-10-27 00:00:00+02 | 2024-10-27 02:00:00+02 | 2024-10-27 02:30:10+02 2024-10-27 00:00:00+02 | 2024-10-27 02:00:00+01 | 2024-10-27 02:30:10+01 2024-10-27 00:00:00+02 | 2024-10-27 03:00:00+01 | 2024-10-27 03:30:10+01 ``` Here I made the input UTC so that it is equivalent to how arrow stores timestamp values. As you can see the trucated hours that have the same wall-clock value (2nd and 3rd row) still maintain the offset value from the time that was truncated. -- 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]
