Omega359 commented on issue #9030:
URL: https://github.com/apache/arrow-rs/issues/9030#issuecomment-3684350200
Currently with df/arrow it looks like it's handled correctly:
```sql
> set timezone TO 'CET';
0 row(s) fetched.
Elapsed 0.003 seconds.
> SELECT '2020-03-29 00:00:00 Europe/Prague'::timestamptz + INTERVAL '1'
DAY, '2020-03-29 00:00:00 Europe/Prague'::timestamptz + INTERVAL '24' HOUR;
+---------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Utf8("2020-03-29 00:00:00 Europe/Prague") +
IntervalMonthDayNano("IntervalMonthDayNano { months: 0, days: 1, nanoseconds: 0
}") | Utf8("2020-03-29 00:00:00 Europe/Prague") +
IntervalMonthDayNano("IntervalMonthDayNano { months: 0, days: 0, nanoseconds:
86400000000000 }") |
+---------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| 2020-03-30T00:00:00+02:00
|
2020-03-30T01:00:00+02:00
|
+---------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
1 row(s) fetched.
Elapsed 0.005 seconds.
```
This aligns with
[postgresql](https://www.postgresql.org/docs/current/functions-datetime.html):
> When adding an interval value to (or subtracting an interval value from) a
timestamp with time zone value, the days component advances (or decrements) the
date of the timestamp with time zone by the indicated number of days. Across
daylight saving time changes (with the session time zone set to a time zone
that recognizes DST), this means interval '1 day' does not necessarily equal
interval '24 hours'. For example, with the session time zone set to CST7CDT,
timestamp with time zone '2005-04-02 12:00-07' + interval '1 day' will produce
timestamp with time zone '2005-04-03 12:00-06', while adding interval '24
hours' to the same initial timestamp with time zone produces timestamp with
time zone '2005-04-03 13:00-06', as there is a change in daylight saving time
at 2005-04-03 02:00 in time zone CST7CDT.
However, in the this issue the interval isn't related to anything that has a
timezone so I think that mapping a day to 24 hours is reasonable. I believe
postgresql treats it exactly that way too:
```sql
> select interval '1 day' / 3;
----
08:00:00
```
--
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]