You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Weston Pace (Jira)" <ji...@apache.org> on 2021/12/02 02:30:00 UTC

[jira] [Commented] (ARROW-14817) [R] Implement bindings for lubridate::tz

    [ https://issues.apache.org/jira/browse/ARROW-14817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452126#comment-17452126 ] 

Weston Pace commented on ARROW-14817:
-------------------------------------

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...

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

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...

{noformat}
SELECT score, 'America/Denver' FROM my_table
{noformat}

> [R] Implement bindings for lubridate::tz
> ----------------------------------------
>
>                 Key: ARROW-14817
>                 URL: https://issues.apache.org/jira/browse/ARROW-14817
>             Project: Apache Arrow
>          Issue Type: Sub-task
>          Components: R
>            Reporter: Nicola Crane
>            Priority: Major
>              Labels: good-first-issue
>
> This can be achieved via strftime



--
This message was sent by Atlassian Jira
(v8.20.1#820001)