-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
apache/arrow-rs
#4201Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
The scalar coercion logic currently incorrectly interprets a timezone without a timezone qualifier as a time since the UTC epoch. It should instead interpret it as relative to the timezone it is being cast to.
To Reproduce
#5914 added the following test (known to be incorrect at the time)
query P
select arrow_cast(timestamp '2000-01-01T00:00:00', 'Timestamp(Nanosecond, Some( "+08:00" ))');
----
2000-01-01T08:00:00+08:00
Expected behavior
The correct result is
2000-01-01T00:00:00+08:00
Additional context
Following #5782 which includes the fix for apache/arrow-rs#1936 the array cast is now correct
create table foo as select '2000-01-01T00:00:00' as ts;
❯ select arrow_cast(ts, 'Timestamp(Nanosecond, Some( "+08:00" ))') from foo;
+---------------------------+
| foo.ts |
+---------------------------+
| 2000-01-01T00:00:00+08:00 |
+---------------------------+
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed