-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
date_part doesn't work for timestamptz with non-utc timezone
To Reproduce
arrow_cast allows us to cast timestamp to timestamptz (though the behavior of arrow_cast is incorrect now #5952)
❯ select arrow_cast('2000-01-01T00:00:00'::timestamp, 'Timestamp(Nanosecond, Some("+08:00"))');
+-----------------------------+
| Utf8("2000-01-01T00:00:00") |
+-----------------------------+
| 2000-01-01T08:00:00+08:00 |
+-----------------------------+
1 row in set. Query took 0.002 seconds.❯ select date_part('hour', arrow_cast('2000-01-01T00:00:00'::timestamp, 'Timestamp(Nanosecond, Some("+08:00"))'));
+----------------------------------------------------+
| datepart(Utf8("hour"),Utf8("2000-01-01T00:00:00")) |
+----------------------------------------------------+
| 0.0 |
+----------------------------------------------------+
1 row in set. Query took 0.003 seconds.Expected behavior
should returns 8.0
Additional context
cc @tustvold will apache/arrow-rs#1936 solve this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working