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

cast to timestamp with time zone drops timezone #3149

Closed
Tracked by #3148
waitingkuo opened this issue Aug 15, 2022 · 2 comments
Closed
Tracked by #3148

cast to timestamp with time zone drops timezone #3149

waitingkuo opened this issue Aug 15, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@waitingkuo
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

now() originally output Timestamp(Nanosecond, Some("UTC"))

select arrow_typeof(now());
+------------------------------------+
| arrowtypeof(now())                 |
+------------------------------------+
| Timestamp(Nanosecond, Some("UTC")) |
+------------------------------------+
1 row in set. Query took 0.002 seconds.

it becomes Timestamp(NanoSecond, None) after casting to timestamp with time zone

select arrow_typeof(now()::timestamp with time zone);
+---------------------------------------------------------+
| arrowtypeof(CAST(now() AS Timestamp(Nanosecond, None))) |
+---------------------------------------------------------+
| Timestamp(Nanosecond, None)                             |
+---------------------------------------------------------+
1 row in set. Query took 0.002 seconds.

Expected behavior
A clear and concise description of what you expected to happen.

should keep the timezone

Additional context
Add any other context about the problem here.

@waitingkuo waitingkuo added the bug Something isn't working label Aug 15, 2022
@Jefffrey
Copy link
Contributor

Jefffrey commented Mar 4, 2023

Seems resolved as of latest main:

jeffrey:~/Code/arrow-datafusion/datafusion-cli$ git rev-parse HEAD
e9852074bacd8c891d84eba38b3417aa16a2d18c
jeffrey:~/Code/arrow-datafusion/datafusion-cli$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `/media/jeffrey/1tb_860evo_ssd/.cargo_target_cache/debug/datafusion-cli`
DataFusion CLI v19.0.0
❯ select arrow_typeof(now());
+---------------------------------------+
| arrowtypeof(now())                    |
+---------------------------------------+
| Timestamp(Nanosecond, Some("+00:00")) |
+---------------------------------------+
1 row in set. Query took 0.003 seconds.
❯ select arrow_typeof(now()::timestamp with time zone);
+---------------------------------------+
| arrowtypeof(now())                    |
+---------------------------------------+
| Timestamp(Nanosecond, Some("+00:00")) |
+---------------------------------------+
1 row in set. Query took 0.002 seconds.
❯

I think might have been resolved by #3698

cc @waitingkuo @alamb

@alamb
Copy link
Contributor

alamb commented Mar 4, 2023

I agree -- thanks for checking @Jefffrey

@alamb alamb closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants