You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Dragoș Moldovan-Grünfeld (Jira)" <ji...@apache.org> on 2022/03/07 15:16:00 UTC

[jira] [Updated] (ARROW-15858) [R][C++] Support duration creation from integer diff time

     [ https://issues.apache.org/jira/browse/ARROW-15858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dragoș Moldovan-Grünfeld updated ARROW-15858:
---------------------------------------------
    Summary: [R][C++] Support duration creation from integer diff time  (was: [R][C++] Support duration creation from integer)

> [R][C++] Support duration creation from integer diff time
> ---------------------------------------------------------
>
>                 Key: ARROW-15858
>                 URL: https://issues.apache.org/jira/browse/ARROW-15858
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, R
>            Reporter: Dragoș Moldovan-Grünfeld
>            Priority: Major
>
> I would expect both {{a}} and {{b}} to create a {{duration}} object of 32 seconds, but the second one returns an {{int32}}
> {code:r}
> library(arrow, warn.conflicts = FALSE)
> a <- as.difftime(32, units = "secs")
> b <- as.difftime(32L, units = "secs")
> Array$create(a)
> #> Array
> #> <duration[s]>
> #> [
> #>   32
> #> ]
> Array$create(b)
> #> Array
> #> <int32>
> #> [
> #>   32
> #> ]
> {code}
> If I try to be explicit, I get somewhat of a clue why that might be happening:
> {code:r}
>  
> Array$create(a, type = duration())
> #> Array
> #> <duration[s]>
> #> [
> #>   32
> #> ]
> Array$create(b, type = duration())
> #> Error:
> #> ! NotImplemented: Extend
> {code}
> Nevertheless, the fallback to creating an integer was unexpected.
> Also, not sure if this is a bug, an improvement or a new feature.



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