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

Dragoș Moldovan-Grünfeld edited comment on ARROW-15996 at 3/23/22, 11:18 AM:
-----------------------------------------------------------------------------

Moreso, I discovered we are actually mapping Arrow's {{time32()}} and 
{{time64()}} to R's {{hms::difftime}} (a somewhat special flavour of 
{{base::difftime}}). Arrow's {{duration}} is mapped to {{base::difftime}}.


was (Author: dragosmg):
Moreso, I discovered we are actually mapping Arrow's {{time32()}} and 
{{time64()}} to R's {{hms::difftime}} (a somewhat special flavour of 
{{base::difftime}}). 

> [C++] Support casting from time32 and time64 to duration
> --------------------------------------------------------
>
>                 Key: ARROW-15996
>                 URL: https://issues.apache.org/jira/browse/ARROW-15996
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Dragoș Moldovan-Grünfeld
>            Priority: Critical
>
> It would be really helpful if we could convert {{time32}} and {{time64}} to 
> {{duration}}. For example, it could simplify the implementation of some of 
> the R bindings (e.g. {{difftime}}). 
> {code:r}
> library(arrow, warn.conflicts = FALSE)
> a <- Array$create(32000L)
> a
> #> Array
> #> <int32>
> #> [
> #>   32000
> #> ]
> a$cast(time32())
> #> Array
> #> <time32[ms]>
> #> [
> #>   00:00:32.000
> #> ]
> a$cast(int64())$cast(time64())
> #> Array
> #> <time64[ns]>
> #> [
> #>   00:00:00.000032000
> #> ]
> a$cast(time32())$cast(duration())
> #> Error: NotImplemented: Unsupported cast from time32[ms] to duration using 
> function cast_duration
> a$cast(int64())$cast(time64())$cast(duration())
> #> Error: NotImplemented: Unsupported cast from time64[ns] to duration using 
> function cast_duration
> {code}



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

Reply via email to