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

[jira] [Resolved] (ARROW-12781) [R] Implement is.type() functions for dplyr

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

Ian Cook resolved ARROW-12781.
------------------------------
    Resolution: Fixed

Issue resolved by pull request 10327
[https://github.com/apache/arrow/pull/10327]

> [R] Implement is.type() functions for dplyr
> -------------------------------------------
>
>                 Key: ARROW-12781
>                 URL: https://issues.apache.org/jira/browse/ARROW-12781
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Ian Cook
>            Assignee: Ian Cook
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 5.0.0
>
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Define functions in {{nse_funcs}} for all the important base R generic {{is.type()}} functions, including:
>  * {{is.numeric()}}
>  * {{is.double()}}
>  * {{is.integer()}}
>  * {{is.integer64()}}
>  * {{is.character()}}
>  * {{is.logical()}}
> Maybe also:
>  * {{is.factor() # TRUE for dictionary types}}
>  * {{is.ordered() # TRUE for ordered dictionary types}}
>  * {{is.list() # TRUE for ListArrays}}
> I think the easiest way to implement this would be to check {{$type_id()}} against the {{Type}} enum values, for example:
> {code:r}
> array$type_id() %in% Type[c("UINT8", "INT8", ...)]
> {code}
> For this to work the same way on unevaluated {{Expression}} columns in {{arrow_dplyr_query}} objects, add a public function {{type_id()}} to the {{Expression}} R6 class like this:
> {code:r}
> type_id = function(schema) compute___expr__type(self, schema)$id,{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)