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

[R] Implement bindings for lubridate::tz #18954

Closed
Tracked by #18952
asfimport opened this issue Nov 24, 2021 · 2 comments
Closed
Tracked by #18952

[R] Implement bindings for lubridate::tz #18954

asfimport opened this issue Nov 24, 2021 · 2 comments

Comments

@asfimport
Copy link

asfimport commented Nov 24, 2021

This can be achieved via strftime

Reporter: Nicola Crane / @thisisnic
Assignee: Dragoș Moldovan-Grünfeld / @dragosmg

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-14817. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Weston Pace / @westonpace:
I don't think you even need strftime. For example, strftime will run an operation on every item in the array. So if you have an array with 1 million elements you will string-format 1 million items.

On the other hand, in Arrow, we know the time zone will be consistent across the entire array. So we only need to take the time zone from the array's dtype. For example, in python, I could do...


>>> a = pa.array([0, 1, 2], type=pa.timestamp('us', 'America/Denver'))
>>> print(a.type.tz)
'America/Denver'

Although, if you then wanted to take that value and feed it further in the query engine...I'm not sure what the right way to go about that would be. Basically you should know the value at query production time so I think you can just feed it in as a constant value in the query plan. For example...


SELECT score, 'America/Denver' FROM my_table

@asfimport
Copy link
Author

Jonathan Keane / @jonkeane:
Issue resolved by pull request 12357
#12357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant