You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "David Li (Jira)" <ji...@apache.org> on 2022/03/22 12:27:00 UTC
[jira] [Commented] (ARROW-15996) [C++] Support casting from time32 and time64 to duration
[ https://issues.apache.org/jira/browse/ARROW-15996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17510461#comment-17510461 ]
David Li commented on ARROW-15996:
----------------------------------
Does this really make sense? I'm curious how it would help implement other bindings.
> [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)