Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Scalar Timezone Coercion #5952

Closed
tustvold opened this issue Apr 11, 2023 · 0 comments · Fixed by apache/arrow-rs#4201
Closed

Incorrect Scalar Timezone Coercion #5952

tustvold opened this issue Apr 11, 2023 · 0 comments · Fixed by apache/arrow-rs#4201
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tustvold
Copy link
Contributor

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 |
+---------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant