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

Ian Cook updated ARROW-13262:
-----------------------------
    Description: 
NOTE: This issue was originally named "[R] Support namespacing of function 
maps?". [~icook] renamed it to reflect the resolution described below.

With our NSE function map setup, we translate various functions into Arrow 
equivalents:
{code:java}
library(arrow)
library(dplyr)

arrow_table <- Table$create(tibble::tibble(
  v = c("A", "B", "C"),
  w = c("a", "b", "c"),
  x = c("d", NA_character_, "f"),
  y = c(NA_character_, "h", "i"),
  z = c(1.1, 2.2, NA)
))

arrow_table %>%
  transmute(str_c(x, y, sep = " ")) %>%
  collect()
#> # A tibble: 3 x 1
#>   `str_c(x, y, sep = " ")`
#>   <chr>                   
#> 1 <NA>                    
#> 2 <NA>                    
#> 3 f i
{code}
Which is great, however if the code that is being used uses the `sringr::` 
namespace prefix this errors:
{code:java}
arrow_table %>%
  transmute(stringr::str_c(x, y, sep = " ")) %>%
  collect()
#> Warning: Expression stringr::str_c(x, y, sep = " ") not supported in Arrow;
#> pulling data into R
#> Error: Problem with `mutate()` input `..1`.
#> ℹ `..1 = ..1`.
#> x object 'x' not found
{code}
Should we support this (basically *also* translate {{stringr::str_c()}} to what 
we have for {{str_c()}})? Or warn/error more clearly what happened if we don't 
support any namespace prefixed functions? Something else?

  was:
With our NSE function map setup, we translate various functions into Arrow 
equivalents:

{code}
library(arrow)
library(dplyr)

arrow_table <- Table$create(tibble::tibble(
  v = c("A", "B", "C"),
  w = c("a", "b", "c"),
  x = c("d", NA_character_, "f"),
  y = c(NA_character_, "h", "i"),
  z = c(1.1, 2.2, NA)
))

arrow_table %>%
  transmute(str_c(x, y, sep = " ")) %>%
  collect()
#> # A tibble: 3 x 1
#>   `str_c(x, y, sep = " ")`
#>   <chr>                   
#> 1 <NA>                    
#> 2 <NA>                    
#> 3 f i
{code}

Which is great, however if the code that is being used uses the `sringr::` 
namespace prefix this errors:

{code}
arrow_table %>%
  transmute(stringr::str_c(x, y, sep = " ")) %>%
  collect()
#> Warning: Expression stringr::str_c(x, y, sep = " ") not supported in Arrow;
#> pulling data into R
#> Error: Problem with `mutate()` input `..1`.
#> ℹ `..1 = ..1`.
#> x object 'x' not found
{code}

Should we support this (basically *also* translate {{stringr::str_c()}} to what 
we have for {{str_c()}})? Or warn/error more clearly what happened if we don't 
support any namespace prefixed functions? Something else?




> [R] transmute() fails after pulling data into R
> -----------------------------------------------
>
>                 Key: ARROW-13262
>                 URL: https://issues.apache.org/jira/browse/ARROW-13262
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Jonathan Keane
>            Priority: Major
>
> NOTE: This issue was originally named "[R] Support namespacing of function 
> maps?". [~icook] renamed it to reflect the resolution described below.
> With our NSE function map setup, we translate various functions into Arrow 
> equivalents:
> {code:java}
> library(arrow)
> library(dplyr)
> arrow_table <- Table$create(tibble::tibble(
>   v = c("A", "B", "C"),
>   w = c("a", "b", "c"),
>   x = c("d", NA_character_, "f"),
>   y = c(NA_character_, "h", "i"),
>   z = c(1.1, 2.2, NA)
> ))
> arrow_table %>%
>   transmute(str_c(x, y, sep = " ")) %>%
>   collect()
> #> # A tibble: 3 x 1
> #>   `str_c(x, y, sep = " ")`
> #>   <chr>                   
> #> 1 <NA>                    
> #> 2 <NA>                    
> #> 3 f i
> {code}
> Which is great, however if the code that is being used uses the `sringr::` 
> namespace prefix this errors:
> {code:java}
> arrow_table %>%
>   transmute(stringr::str_c(x, y, sep = " ")) %>%
>   collect()
> #> Warning: Expression stringr::str_c(x, y, sep = " ") not supported in Arrow;
> #> pulling data into R
> #> Error: Problem with `mutate()` input `..1`.
> #> ℹ `..1 = ..1`.
> #> x object 'x' not found
> {code}
> Should we support this (basically *also* translate {{stringr::str_c()}} to 
> what we have for {{str_c()}})? Or warn/error more clearly what happened if we 
> don't support any namespace prefixed functions? Something else?



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

Reply via email to