datafusion
datafusion copied to clipboard
Should `Cast(UTF-8 AS Timestamp)` apply local time zone?
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
dataufusion v10.0.0's applies local time zone (i'm in UTC+8)
❯ select cast('2000-01-01T00:00:00' as timestamp);
+------------------------------------------------------------------+
| CAST(Utf8("2000-01-01T00:00:00") AS Timestamp(Nanosecond, None)) |
+------------------------------------------------------------------+
| 1999-12-31 16:00:00 |
+------------------------------------------------------------------+
1 row in set. Query took 0.004 seconds.
while postgresql's is not
willy=# select cast('2000-01-01T00:00:00' as timestamp);
timestamp
---------------------
2000-01-01 00:00:00
(1 row)
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
depends on apache/arrow-rs#1936
I wonder if this item is now complete
the original issue is fixed now
❯ select '2000-01-01T00:00:00'::timestamp;
+-----------------------------+
| Utf8("2000-01-01T00:00:00") |
+-----------------------------+
| 2000-01-01T00:00:00 |
+-----------------------------+
1 row in set. Query took 0.002 seconds
however it's not yet totally aligned with postgrseql datafusion
❯ select '2000-01-01T00:00:00+01:00'::timestamp;
+-----------------------------------+
| Utf8("2000-01-01T00:00:00+01:00") |
+-----------------------------------+
| 1999-12-31T23:00:00 |
+-----------------------------------+
1 row in set. Query took 0.002 seconds.
postgresql
willy=# select '2000-01-01T00:00:00+01:00'::timestamp;
timestamp
---------------------
2000-01-01 00:00:00
(1 row)
Looks like Postgresql's behavior is to completely ignore the timezone part while casting string to timestamp